Browse Source

feature: 登陆,后端服务;message弹窗,vuex状态管理迁移

ljc 7 months ago
parent
commit
0b897ef536

+ 9 - 7
src/App.vue

@@ -1,26 +1,28 @@
 <template>
-  <el-config-provider :size="globalComSize" :locale="zhCn">
+  <el-config-provider :size="globalComSize">
     <router-view v-if="isRouterAlive"></router-view>
   </el-config-provider>
 </template>
 
 <script lang="ts" setup>
-  import { computed, provide, nextTick } from 'vue'
+  import { computed, provide, nextTick, onMounted, ref } from 'vue'
   import { useSettingStore } from '@/store/modules/setting'
-  // 配置element中文
-  import zhCn from 'element-plus/es/locale/lang/zh-cn'
 
-  let isRouterAlive = true
+  let isRouterAlive = ref(true)
   const SettingStore = useSettingStore()
   // 配置全局组件大小
   const globalComSize = computed((): string => SettingStore.themeConfig.globalComSize)
   const reload = () => {
-    isRouterAlive = false
+    isRouterAlive.value = false
     nextTick(function () {
-      isRouterAlive = true
+      isRouterAlive.value = true
     })
   }
   provide('reload', reload)
+
+  onMounted(() => {
+    window.document.documentElement.setAttribute('data-theme', 'theme1')
+  })
 </script>
 
 <style lang="scss">

+ 0 - 114
src/assets/iconfont/iconfont.css

@@ -1,114 +0,0 @@
-@font-face {
-  font-family: 'iconfont'; /* Project id 3641732 */
-  src: url('./iconfont.woff2?t=1663216428515') format('woff2'),
-    url('./iconfont.woff?t=1663216428515') format('woff'),
-    url('./iconfont.ttf?t=1663216428515') format('truetype');
-}
-
-.iconfont {
-  font-family: 'iconfont' !important;
-  font-size: 16px;
-  font-style: normal;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-}
-
-.icon-yin:before {
-  content: '\e6a0';
-}
-
-.icon-dabaoyu:before {
-  content: '\e6a7';
-}
-
-.icon-shuaxin1:before {
-  content: '\e627';
-}
-
-.icon-shuaxin:before {
-  content: '\e629';
-}
-
-.icon-duoyun-2-copy:before {
-  content: '\e68d';
-}
-
-.icon-duoyun-1:before {
-  content: '\e679';
-}
-
-.icon-daxue:before {
-  content: '\e67a';
-}
-
-.icon-dayu:before {
-  content: '\e67b';
-}
-
-.icon-feng:before {
-  content: '\e67c';
-}
-
-.icon-duoyun-3:before {
-  content: '\e67d';
-}
-
-.icon-duoyun-2:before {
-  content: '\e67e';
-}
-
-.icon-leiyujiaojia:before {
-  content: '\e67f';
-}
-
-.icon-duoyun:before {
-  content: '\e680';
-}
-
-.icon-zhongyu:before {
-  content: '\e681';
-}
-
-.icon-wu:before {
-  content: '\e682';
-}
-
-.icon-xiaoyu:before {
-  content: '\e683';
-}
-
-.icon-xiaoxue:before {
-  content: '\e684';
-}
-
-.icon-shandian:before {
-  content: '\e685';
-}
-
-.icon-xue:before {
-  content: '\e686';
-}
-
-.icon-zhongxue:before {
-  content: '\e687';
-}
-
-.icon-yangchen:before {
-  content: '\e688';
-}
-
-.icon-yueliang:before {
-  content: '\e689';
-}
-
-.icon-yujiaxue:before {
-  content: '\e68a';
-}
-
-.icon-qing:before {
-  content: '\e68b';
-}
-
-.icon-mai:before {
-  content: '\e68c';
-}

BIN
src/assets/iconfont/iconfont.eot


File diff suppressed because it is too large
+ 0 - 1
src/assets/iconfont/iconfont.js


+ 696 - 122
src/assets/iconfont/iconfont.json

@@ -1,184 +1,758 @@
 {
-  "id": "3641732",
-  "name": "weather",
+  "id": "1913866",
+  "name": "Admin",
   "font_family": "iconfont",
-  "css_prefix_text": "icon-",
-  "description": "",
+  "css_prefix_text": "icon",
+  "description": "后台管理图标",
   "glyphs": [
     {
-      "icon_id": "28557556",
-      "name": "阴",
-      "font_class": "yin",
+      "icon_id": "875544",
+      "name": "FaceBook",
+      "font_class": "tian7_facebook",
+      "unicode": "e624",
+      "unicode_decimal": 58916
+    },
+    {
+      "icon_id": "7221902",
+      "name": "you-tube",
+      "font_class": "you-tube",
+      "unicode": "e628",
+      "unicode_decimal": 58920
+    },
+    {
+      "icon_id": "11357802",
+      "name": "ins",
+      "font_class": "tmp",
+      "unicode": "e63c",
+      "unicode_decimal": 58940
+    },
+    {
+      "icon_id": "11988493",
+      "name": "地址 (1)",
+      "font_class": "dizhi",
+      "unicode": "e661",
+      "unicode_decimal": 58977
+    },
+    {
+      "icon_id": "12852320",
+      "name": "TW",
+      "font_class": "TW",
+      "unicode": "e651",
+      "unicode_decimal": 58961
+    },
+    {
+      "icon_id": "9265415",
+      "name": "服务器",
+      "font_class": "fuwuqi",
+      "unicode": "e718",
+      "unicode_decimal": 59160
+    },
+    {
+      "icon_id": "488591",
+      "name": "电脑",
+      "font_class": "diannao",
+      "unicode": "e64e",
+      "unicode_decimal": 58958
+    },
+    {
+      "icon_id": "3771278",
+      "name": "失败",
+      "font_class": "shibai",
+      "unicode": "e660",
+      "unicode_decimal": 58976
+    },
+    {
+      "icon_id": "9282498",
+      "name": "YouTube",
+      "font_class": "YouTube",
+      "unicode": "e63b",
+      "unicode_decimal": 58939
+    },
+    {
+      "icon_id": "9162746",
+      "name": "完善资料",
+      "font_class": "ziliao",
+      "unicode": "e623",
+      "unicode_decimal": 58915
+    },
+    {
+      "icon_id": "9145505",
+      "name": "密码",
+      "font_class": "mima",
+      "unicode": "e66c",
+      "unicode_decimal": 58988
+    },
+    {
+      "icon_id": "965156",
+      "name": "钱包",
+      "font_class": "wallet",
+      "unicode": "e632",
+      "unicode_decimal": 58930
+    },
+    {
+      "icon_id": "12996475",
+      "name": "会员取款",
+      "font_class": "huiyuanqukuan",
+      "unicode": "e6d5",
+      "unicode_decimal": 59093
+    },
+    {
+      "icon_id": "3109732",
+      "name": "警示",
+      "font_class": "jingshi",
+      "unicode": "e622",
+      "unicode_decimal": 58914
+    },
+    {
+      "icon_id": "614996",
+      "name": "iconfont-arrowdown",
+      "font_class": "iconfontarrowdown-copy",
+      "unicode": "e618",
+      "unicode_decimal": 58904
+    },
+    {
+      "icon_id": "2247612",
+      "name": "链接",
+      "font_class": "lianjie",
+      "unicode": "e619",
+      "unicode_decimal": 58905
+    },
+    {
+      "icon_id": "3004828",
+      "name": "成功",
+      "font_class": "chenggong",
+      "unicode": "eaed",
+      "unicode_decimal": 60141
+    },
+    {
+      "icon_id": "5315870",
+      "name": "等待",
+      "font_class": "dengdai",
+      "unicode": "e63a",
+      "unicode_decimal": 58938
+    },
+    {
+      "icon_id": "5360978",
+      "name": "灯泡",
+      "font_class": "dengpao",
+      "unicode": "e61e",
+      "unicode_decimal": 58910
+    },
+    {
+      "icon_id": "9697021",
+      "name": "向右箭头",
+      "font_class": "shaixuanjiantou-you",
+      "unicode": "e620",
+      "unicode_decimal": 58912
+    },
+    {
+      "icon_id": "11136487",
+      "name": "五角星 星型 ",
+      "font_class": "wujiaoxingxingxing",
+      "unicode": "e630",
+      "unicode_decimal": 58928
+    },
+    {
+      "icon_id": "11150109",
+      "name": "标签",
+      "font_class": "biaoqian",
+      "unicode": "e654",
+      "unicode_decimal": 58964
+    },
+    {
+      "icon_id": "11177050",
+      "name": "五角星 星型 收藏",
+      "font_class": "wujiaoxingxingxingshoucang",
       "unicode": "e6a0",
       "unicode_decimal": 59040
     },
     {
-      "icon_id": "28557770",
-      "name": "大暴雨",
-      "font_class": "dabaoyu",
-      "unicode": "e6a7",
-      "unicode_decimal": 59047
+      "icon_id": "11639950",
+      "name": "五角星 星型 收藏",
+      "font_class": "wujiaoxingxingxingshoucang1",
+      "unicode": "e621",
+      "unicode_decimal": 58913
     },
     {
-      "icon_id": "7724796",
+      "icon_id": "13704691",
+      "name": "上传",
+      "font_class": "-shangchuan",
+      "unicode": "e6b9",
+      "unicode_decimal": 59065
+    },
+    {
+      "icon_id": "11175072",
+      "name": "待办  等待 审核",
+      "font_class": "daibandengdaishenhe",
+      "unicode": "e67b",
+      "unicode_decimal": 59003
+    },
+    {
+      "icon_id": "7324218",
+      "name": "资料补充",
+      "font_class": "ziliaobuchong",
+      "unicode": "e677",
+      "unicode_decimal": 58999
+    },
+    {
+      "icon_id": "2242817",
+      "name": "二维码",
+      "font_class": "erweima",
+      "unicode": "e614",
+      "unicode_decimal": 58900
+    },
+    {
+      "icon_id": "2779009",
+      "name": "加号",
+      "font_class": "jiahao",
+      "unicode": "e9c8",
+      "unicode_decimal": 59848
+    },
+    {
+      "icon_id": "3461113",
+      "name": "手机",
+      "font_class": "shouji1",
+      "unicode": "e616",
+      "unicode_decimal": 58902
+    },
+    {
+      "icon_id": "5101420",
+      "name": "加号",
+      "font_class": "jiahao1",
+      "unicode": "e617",
+      "unicode_decimal": 58903
+    },
+    {
+      "icon_id": "125852",
+      "name": "i",
+      "font_class": "i",
+      "unicode": "e615",
+      "unicode_decimal": 58901
+    },
+    {
+      "icon_id": "9668011",
+      "name": "图片上传",
+      "font_class": "tupianshangchuan",
+      "unicode": "e62f",
+      "unicode_decimal": 58927
+    },
+    {
+      "icon_id": "420834",
+      "name": "身份核验须知",
+      "font_class": "shenfenheyanxuzhi",
+      "unicode": "e613",
+      "unicode_decimal": 58899
+    },
+    {
+      "icon_id": "2739055",
+      "name": "个人信息",
+      "font_class": "iconcopy",
+      "unicode": "e682",
+      "unicode_decimal": 59010
+    },
+    {
+      "icon_id": "4734189",
+      "name": "知识",
+      "font_class": "zhishi",
+      "unicode": "e66d",
+      "unicode_decimal": 58989
+    },
+    {
+      "icon_id": "934735",
+      "name": "箭头",
+      "font_class": "jiantou1",
+      "unicode": "e6c5",
+      "unicode_decimal": 59077
+    },
+    {
+      "icon_id": "1035716",
+      "name": "箭头",
+      "font_class": "jiantou-copy",
+      "unicode": "e612",
+      "unicode_decimal": 58898
+    },
+    {
+      "icon_id": "2715703",
+      "name": "箭头",
+      "font_class": "arrow-round-r",
+      "unicode": "e61c",
+      "unicode_decimal": 58908
+    },
+    {
+      "icon_id": "8360731",
       "name": "刷新",
-      "font_class": "shuaxin1",
+      "font_class": "shuaxin2",
+      "unicode": "e6f6",
+      "unicode_decimal": 59126
+    },
+    {
+      "icon_id": "8731683",
+      "name": "发布时间",
+      "font_class": "fabushijian",
+      "unicode": "e650",
+      "unicode_decimal": 58960
+    },
+    {
+      "icon_id": "13435768",
+      "name": "参数",
+      "font_class": "canshu",
+      "unicode": "e65f",
+      "unicode_decimal": 58975
+    },
+    {
+      "icon_id": "867560",
+      "name": "交易账户",
+      "font_class": "tradingbook",
+      "unicode": "e61b",
+      "unicode_decimal": 58907
+    },
+    {
+      "icon_id": "964047",
+      "name": "个人信息 (1)",
+      "font_class": "gerenxinxi1",
+      "unicode": "e6a2",
+      "unicode_decimal": 59042
+    },
+    {
+      "icon_id": "1614132",
+      "name": "退出",
+      "font_class": "icon-system-signout",
+      "unicode": "e643",
+      "unicode_decimal": 58947
+    },
+    {
+      "icon_id": "4065700",
+      "name": "安全",
+      "font_class": "anquan",
+      "unicode": "e61d",
+      "unicode_decimal": 58909
+    },
+    {
+      "icon_id": "10321609",
+      "name": "文件管理",
+      "font_class": "wenjianguanli",
+      "unicode": "e690",
+      "unicode_decimal": 59024
+    },
+    {
+      "icon_id": "6541936",
+      "name": "客服",
+      "font_class": "kefu",
+      "unicode": "e79c",
+      "unicode_decimal": 59292
+    },
+    {
+      "icon_id": "8386515",
+      "name": "用户",
+      "font_class": "yonghu",
+      "unicode": "e62e",
+      "unicode_decimal": 58926
+    },
+    {
+      "icon_id": "2258114",
+      "name": "邮箱",
+      "font_class": "youxiang1",
+      "unicode": "e9b2",
+      "unicode_decimal": 59826
+    },
+    {
+      "icon_id": "14420910",
+      "name": "定位",
+      "font_class": "dingwei",
+      "unicode": "e611",
+      "unicode_decimal": 58897
+    },
+    {
+      "icon_id": "959702",
+      "name": "验证码",
+      "font_class": "yanzhengma",
+      "unicode": "e730",
+      "unicode_decimal": 59184
+    },
+    {
+      "icon_id": "14386940",
+      "name": "手机",
+      "font_class": "shouji",
+      "unicode": "e610",
+      "unicode_decimal": 58896
+    },
+    {
+      "icon_id": "12614697",
+      "name": "首 页-01",
+      "font_class": "shouye-",
+      "unicode": "e633",
+      "unicode_decimal": 58931
+    },
+    {
+      "icon_id": "13020783",
+      "name": "空",
+      "font_class": "kong",
+      "unicode": "e6c8",
+      "unicode_decimal": 59080
+    },
+    {
+      "icon_id": "940196",
+      "name": "入金",
+      "font_class": "Deposit",
+      "unicode": "e62c",
+      "unicode_decimal": 58924
+    },
+    {
+      "icon_id": "7881674",
+      "name": "钻石",
+      "font_class": "zuanshi",
+      "unicode": "e64d",
+      "unicode_decimal": 58957
+    },
+    {
+      "icon_id": "8225242",
+      "name": "代理",
+      "font_class": "daili",
+      "unicode": "e60f",
+      "unicode_decimal": 58895
+    },
+    {
+      "icon_id": "3528787",
+      "name": "下载",
+      "font_class": "xiazai",
+      "unicode": "e60b",
+      "unicode_decimal": 58891
+    },
+    {
+      "icon_id": "4909541",
+      "name": "眼睛",
+      "font_class": "yanjing",
+      "unicode": "e60c",
+      "unicode_decimal": 58892
+    },
+    {
+      "icon_id": "7766772",
+      "name": "icon_photo",
+      "font_class": "icon_photo",
+      "unicode": "eb9a",
+      "unicode_decimal": 60314
+    },
+    {
+      "icon_id": "8790047",
+      "name": "眼睛",
+      "font_class": "eye",
+      "unicode": "e60d",
+      "unicode_decimal": 58893
+    },
+    {
+      "icon_id": "11738959",
+      "name": "选择框-部分选择",
+      "font_class": "xuanzekuang-bufenxuanze",
+      "unicode": "e681",
+      "unicode_decimal": 59009
+    },
+    {
+      "icon_id": "12188792",
+      "name": "选中框",
+      "font_class": "xuanzhongkuang",
+      "unicode": "e65d",
+      "unicode_decimal": 58973
+    },
+    {
+      "icon_id": "12346863",
+      "name": "未选中框",
+      "font_class": "weixuanzhongkuang",
+      "unicode": "e62b",
+      "unicode_decimal": 58923
+    },
+    {
+      "icon_id": "14195997",
+      "name": "上 传",
+      "font_class": "shangchuan",
+      "unicode": "e60e",
+      "unicode_decimal": 58894
+    },
+    {
+      "icon_id": "10909705",
+      "name": "邮箱",
+      "font_class": "youxiang",
+      "unicode": "e609",
+      "unicode_decimal": 58889
+    },
+    {
+      "icon_id": "8019560",
+      "name": "箭头",
+      "font_class": "jiantou",
       "unicode": "e627",
       "unicode_decimal": 58919
     },
     {
-      "icon_id": "6999224",
+      "icon_id": "8196664",
+      "name": "搜索",
+      "font_class": "icon_sousuo",
+      "unicode": "e607",
+      "unicode_decimal": 58887
+    },
+    {
+      "icon_id": "10728910",
+      "name": "排序",
+      "font_class": "paixu",
+      "unicode": "e6a7",
+      "unicode_decimal": 59047
+    },
+    {
+      "icon_id": "147012",
       "name": "刷新",
       "font_class": "shuaxin",
-      "unicode": "e629",
-      "unicode_decimal": 58921
+      "unicode": "e631",
+      "unicode_decimal": 58929
     },
     {
-      "icon_id": "31772217",
-      "name": "多云-2-copy",
-      "font_class": "duoyun-2-copy",
-      "unicode": "e68d",
-      "unicode_decimal": 59021
+      "icon_id": "287187",
+      "name": "下拉箭头",
+      "font_class": "xialajiantou",
+      "unicode": "e638",
+      "unicode_decimal": 58936
     },
     {
-      "icon_id": "29265274",
-      "name": "多云-1",
-      "font_class": "duoyun-1",
-      "unicode": "e679",
-      "unicode_decimal": 59001
+      "icon_id": "608098",
+      "name": "刷新",
+      "font_class": "shuaxin1",
+      "unicode": "e653",
+      "unicode_decimal": 58963
     },
     {
-      "icon_id": "29265275",
-      "name": "大雪",
-      "font_class": "daxue",
-      "unicode": "e67a",
-      "unicode_decimal": 59002
+      "icon_id": "663949",
+      "name": "详细",
+      "font_class": "xiangxi",
+      "unicode": "e65b",
+      "unicode_decimal": 58971
     },
     {
-      "icon_id": "29265276",
-      "name": "大雨",
-      "font_class": "dayu",
-      "unicode": "e67b",
-      "unicode_decimal": 59003
+      "icon_id": "1143156",
+      "name": "菜单",
+      "font_class": "caidan",
+      "unicode": "e625",
+      "unicode_decimal": 58917
     },
     {
-      "icon_id": "29265277",
-      "name": "风",
-      "font_class": "feng",
-      "unicode": "e67c",
-      "unicode_decimal": 59004
+      "icon_id": "2197046",
+      "name": "铃铛",
+      "font_class": "lingdang",
+      "unicode": "e6fb",
+      "unicode_decimal": 59131
     },
     {
-      "icon_id": "29265278",
-      "name": "多云-3",
-      "font_class": "duoyun-3",
-      "unicode": "e67d",
-      "unicode_decimal": 59005
+      "icon_id": "2204665",
+      "name": "申请管理",
+      "font_class": "shenqingguanli",
+      "unicode": "e646",
+      "unicode_decimal": 58950
     },
     {
-      "icon_id": "29265279",
-      "name": "多云-2",
-      "font_class": "duoyun-2",
-      "unicode": "e67e",
-      "unicode_decimal": 59006
+      "icon_id": "2845887",
+      "name": "全屏",
+      "font_class": "quanping",
+      "unicode": "e672",
+      "unicode_decimal": 58994
     },
     {
-      "icon_id": "29265280",
-      "name": "雷雨交加",
-      "font_class": "leiyujiaojia",
-      "unicode": "e67f",
-      "unicode_decimal": 59007
+      "icon_id": "3454265",
+      "name": "对勾",
+      "font_class": "duigou-",
+      "unicode": "e600",
+      "unicode_decimal": 58880
     },
     {
-      "icon_id": "29265281",
-      "name": "多云",
-      "font_class": "duoyun",
-      "unicode": "e680",
-      "unicode_decimal": 59008
+      "icon_id": "3500380",
+      "name": "下拉箭头",
+      "font_class": "xialajiantou1",
+      "unicode": "e601",
+      "unicode_decimal": 58881
     },
     {
-      "icon_id": "29265282",
-      "name": "中雨",
-      "font_class": "zhongyu",
-      "unicode": "e681",
-      "unicode_decimal": 59009
+      "icon_id": "3613399",
+      "name": "编辑",
+      "font_class": "bianji",
+      "unicode": "e608",
+      "unicode_decimal": 58888
     },
     {
-      "icon_id": "29265283",
-      "name": "雾",
-      "font_class": "wu",
-      "unicode": "e682",
-      "unicode_decimal": 59010
+      "icon_id": "3790527",
+      "name": "错误",
+      "font_class": "cuowu",
+      "unicode": "e6e9",
+      "unicode_decimal": 59113
+    },
+    {
+      "icon_id": "3976155",
+      "name": "错误 (1)",
+      "font_class": "cuowu1",
+      "unicode": "e65c",
+      "unicode_decimal": 58972
+    },
+    {
+      "icon_id": "4253728",
+      "name": "编辑",
+      "font_class": "bianji1",
+      "unicode": "e602",
+      "unicode_decimal": 58882
+    },
+    {
+      "icon_id": "4734749",
+      "name": "编辑",
+      "font_class": "bianji2",
+      "unicode": "e64c",
+      "unicode_decimal": 58956
+    },
+    {
+      "icon_id": "5868863",
+      "name": "客户管理",
+      "font_class": "kehu",
+      "unicode": "e65e",
+      "unicode_decimal": 58974
+    },
+    {
+      "icon_id": "6499103",
+      "name": "网站管理",
+      "font_class": "wangzhanguanli",
+      "unicode": "e641",
+      "unicode_decimal": 58945
+    },
+    {
+      "icon_id": "7543006",
+      "name": "收起",
+      "font_class": "shouqi",
+      "unicode": "e64a",
+      "unicode_decimal": 58954
+    },
+    {
+      "icon_id": "8148592",
+      "name": "时间",
+      "font_class": "shijian",
+      "unicode": "e605",
+      "unicode_decimal": 58885
+    },
+    {
+      "icon_id": "8589223",
+      "name": "错误",
+      "font_class": "cuowu2",
+      "unicode": "e62d",
+      "unicode_decimal": 58925
+    },
+    {
+      "icon_id": "8590304",
+      "name": "日历",
+      "font_class": "rili",
+      "unicode": "e626",
+      "unicode_decimal": 58918
+    },
+    {
+      "icon_id": "8927678",
+      "name": "展 开",
+      "font_class": "zhankai",
+      "unicode": "e603",
+      "unicode_decimal": 58883
+    },
+    {
+      "icon_id": "9217729",
+      "name": "潜在客户",
+      "font_class": "qianzaikehu",
+      "unicode": "e6f1",
+      "unicode_decimal": 59121
+    },
+    {
+      "icon_id": "9609922",
+      "name": "关  闭",
+      "font_class": "guanbi",
+      "unicode": "e61f",
+      "unicode_decimal": 58911
+    },
+    {
+      "icon_id": "10138843",
+      "name": "报告",
+      "font_class": "baogao",
+      "unicode": "e6b4",
+      "unicode_decimal": 59060
+    },
+    {
+      "icon_id": "10262279",
+      "name": "头像 男",
+      "font_class": "touxiangnan",
+      "unicode": "e64f",
+      "unicode_decimal": 58959
+    },
+    {
+      "icon_id": "10551463",
+      "name": "增加 新增",
+      "font_class": "zengjiaxinzeng",
+      "unicode": "e726",
+      "unicode_decimal": 59174
     },
     {
-      "icon_id": "29265284",
-      "name": "小雨",
-      "font_class": "xiaoyu",
-      "unicode": "e683",
-      "unicode_decimal": 59011
+      "icon_id": "10874401",
+      "name": "对勾",
+      "font_class": "duigou",
+      "unicode": "e639",
+      "unicode_decimal": 58937
     },
     {
-      "icon_id": "29265285",
-      "name": "小雪",
-      "font_class": "xiaoxue",
-      "unicode": "e684",
-      "unicode_decimal": 59012
+      "icon_id": "12467926",
+      "name": "财务管理",
+      "font_class": "caiwu",
+      "unicode": "e604",
+      "unicode_decimal": 58884
     },
     {
-      "icon_id": "29265286",
-      "name": "闪电",
-      "font_class": "shandian",
-      "unicode": "e685",
-      "unicode_decimal": 59013
+      "icon_id": "12602851",
+      "name": "控制台",
+      "font_class": "kongzhitai",
+      "unicode": "e7cc",
+      "unicode_decimal": 59340
     },
     {
-      "icon_id": "29265287",
-      "name": "雪",
-      "font_class": "xue",
-      "unicode": "e686",
-      "unicode_decimal": 59014
+      "icon_id": "12711837",
+      "name": "用户管理",
+      "font_class": "yonghuguanli",
+      "unicode": "e61a",
+      "unicode_decimal": 58906
     },
     {
-      "icon_id": "29265288",
-      "name": "中雪",
-      "font_class": "zhongxue",
-      "unicode": "e687",
-      "unicode_decimal": 59015
+      "icon_id": "12953634",
+      "name": "报告",
+      "font_class": "baogao1",
+      "unicode": "e652",
+      "unicode_decimal": 58962
     },
     {
-      "icon_id": "29265289",
-      "name": "扬尘",
-      "font_class": "yangchen",
-      "unicode": "e688",
-      "unicode_decimal": 59016
+      "icon_id": "13087809",
+      "name": "设 置",
+      "font_class": "shezhi",
+      "unicode": "e674",
+      "unicode_decimal": 58996
     },
     {
-      "icon_id": "29265290",
-      "name": "月亮",
-      "font_class": "yueliang",
-      "unicode": "e689",
-      "unicode_decimal": 59017
+      "icon_id": "13200958",
+      "name": "删 除",
+      "font_class": "shanchu",
+      "unicode": "e73f",
+      "unicode_decimal": 59199
     },
     {
-      "icon_id": "29265291",
-      "name": "雨夹雪",
-      "font_class": "yujiaxue",
-      "unicode": "e68a",
-      "unicode_decimal": 59018
+      "icon_id": "13283692",
+      "name": "收 起",
+      "font_class": "zhankai1",
+      "unicode": "e6a6",
+      "unicode_decimal": 59046
     },
     {
-      "icon_id": "29265292",
-      "name": "晴",
-      "font_class": "qing",
-      "unicode": "e68b",
-      "unicode_decimal": 59019
+      "icon_id": "14020019",
+      "name": "收 起",
+      "font_class": "zhankai2",
+      "unicode": "e606",
+      "unicode_decimal": 58886
     },
     {
-      "icon_id": "29265293",
-      "name": "霾",
-      "font_class": "mai",
-      "unicode": "e68c",
-      "unicode_decimal": 59020
+      "icon_id": "14513234",
+      "name": "编 辑",
+      "font_class": "bianji3",
+      "unicode": "e60a",
+      "unicode_decimal": 58890
     }
   ]
 }

File diff suppressed because it is too large
+ 3 - 0
src/assets/iconfont/iconfont.scss


File diff suppressed because it is too large
+ 34 - 0
src/assets/iconfont/iconfont.svg


BIN
src/assets/iconfont/iconfont.ttf


BIN
src/assets/iconfont/iconfont.woff


BIN
src/assets/iconfont/iconfont.woff2


+ 2 - 1
src/i18n/index.ts

@@ -30,9 +30,10 @@ const i18n = createI18n({
   locale: LocaleLanguage(),
   fallbackLocale: import.meta.env.VITE_APP_I18N_FALLBACK_LOCALE || 'cn',
   globalInjection: true,
+  legacy: false,
   messages: {
     en,
-    zh: cn,
+    cn,
   },
 })
 

+ 7 - 5
src/layout/components/Header/components/Language.vue

@@ -21,7 +21,9 @@
   import { ArrowDown } from '@element-plus/icons-vue'
   import axios from 'axios'
   import { getCurrentInstance, onMounted, inject } from 'vue'
+  import { useI18n } from 'vue-i18n'
   const reload = inject('reload')
+  const { locale } = useI18n()
   const langs = {
     cn: '中文简体',
     en: 'English',
@@ -29,7 +31,7 @@
   // vue3实例
   const v3This = getCurrentInstance()
   //显示语言
-  let langName = ''
+  let langName = ref('')
 
   // 切换显示语言
   const SwitchLanguage = (lang) => {
@@ -39,8 +41,8 @@
   }
   //修改语言
   const switchLang = async (lang) => {
-    v3This.ctx.$i18n.locale = lang
-    langName = langs[lang]
+    locale.value = lang
+    langName.value = langs[lang]
     v3This.ctx.Session.Set('lang', lang)
     axios.defaults.headers.common['Language'] = sessionStorage.getItem('lang')
     setTimeout(() => {
@@ -54,8 +56,8 @@
       v3This.ctx.Session.Set('lang', 'cn')
     }
     let lang = v3This.ctx.Session.Get('lang') || 'cn'
-    v3This.ctx.$i18n.locale = lang
-    langName = langs[lang]
+    locale.value = lang
+    langName.value = langs[lang]
   }
 
   onMounted(() => {

+ 160 - 0
src/lib/pigeon.js

@@ -0,0 +1,160 @@
+/*
+ * @Description: 消息系统
+ * @Author: sql
+ * @Date: 2018-11-26 11:06:55
+ * @LastEditTime: 2018-11-30 11:25:43
+ */
+
+import { getCurrentInstance } from 'vue'
+
+const { proxy } = getCurrentInstance()
+
+class Pigeon {
+  constructor() {
+    this.vue = proxy
+  }
+
+  /**
+   * 系统提醒
+   * @param {string} msg 提醒信息
+   * @param {int} type 0 信息, 1 成功, 2警告, 3 错误
+   */
+  message(msg, type = 0) {
+    if (msg == '' || msg == null) {
+      this.vue.$message.error('msg不能为空!!!')
+      return false
+    }
+    switch (type) {
+      case 0:
+        this.vue.$message({ customClass: 'crm_message crm_msg_info', message: msg })
+        break
+      case 1:
+        this.vue.$message.success({ customClass: 'crm_message crm_msg_suc', message: msg })
+        break
+      case 2:
+        this.vue.$message.warning({ customClass: 'crm_message crm_msg_war', message: msg })
+        break
+      case 3:
+        this.vue.$message.error({ customClass: 'crm_message crm_msg_err', message: msg })
+        break
+      default:
+        this.vue.$message({ customClass: 'crm_message crm_msg_info', message: msg })
+        break
+    }
+  }
+
+  /**
+   * 成功的系统提醒
+   * @param {string} msg
+   */
+  MessageOK(msg) {
+    this.message(msg, 1)
+  }
+
+  /**
+   * 错误的系统提醒
+   * @param {string} msg
+   */
+  MessageError(msg) {
+    this.message(msg, 3)
+  }
+
+  /**
+   * 警告的系统提醒
+   * @param {string} msg
+   */
+  MessageWarning(msg) {
+    this.message(msg, 2)
+  }
+
+  /**
+   * 普通的系统提醒
+   * @param {string} msg
+   */
+  MessageInfo(msg) {
+    this.message(msg, 0)
+  }
+
+  /**
+   * 确认消息
+   * @param {string} msg 提示信息
+   * @param {string} title 头部
+   * @param {function} confirmHandle 确认回调函数
+   * @param {function} cancelHandle 取消回调函数
+   * @param {string} confirmText 确认按钮文字
+   * @param {string} cancalText 取消按钮文字
+   * @param {string} settings 其他配置项
+   */
+  MessageConfirm(msg, title, confirmText, cancalText, confirmHandle, cancelHandle, settings = {}) {
+    this.vue
+      .$confirm(msg, title, {
+        confirmButtonText: confirmText,
+        cancelButtonText: cancalText,
+        customClass: 'crm_message_box',
+        ...settings,
+      })
+      .then(({ value }) => {
+        confirmHandle(value)
+      })
+      .catch(() => {
+        cancelHandle()
+      })
+  }
+
+  /**
+   * 提交内容
+   * @param {string} msg 提示信息
+   * @param {function} confirmHandle 确认回调函数
+   * @param {function} cancelHandle 取消回调函数
+   * @param {string} confirmText 确认按钮文字
+   * @param {string} cancalText 取消按钮文字
+   * @param {string} pattern 提交内容正则
+   * @param {string} errorMsg 提交内容错误提醒
+   */
+  MessagePrompt(
+    msg,
+    confirmHandle,
+    cancelHandle,
+    settings = {
+      inputType: 'text',
+      inputPattern: null,
+      inputErrorMessage: null,
+    }
+  ) {
+    this.vue
+      .$prompt(msg, '系统提示', {
+        confirmButtonText: settings.confirmButtonText || '确定',
+        cancelButtonText: settings.cancelButtonText || '取消',
+        ...settings,
+        beforeClose: (action, instance, done) => {
+          if (action === 'confirm') {
+            instance.confirmButtonLoading = true
+            instance.confirmButtonText = '执行中...'
+            setTimeout(() => {
+              done()
+              setTimeout(() => {
+                instance.confirmButtonLoading = false
+              }, 100)
+            }, 500)
+          } else {
+            instance.cancelButtonLoading = true
+            instance.cancelButtonText = '执行中...'
+            setTimeout(() => {
+              done()
+              setTimeout(() => {
+                instance.cancelButtonLoading = false
+              }, 100)
+            }, 500)
+          }
+        },
+      })
+      .then(({ value }) => {
+        confirmHandle(value)
+      })
+      .catch(() => {
+        cancelHandle()
+      })
+  }
+}
+
+export default new Pigeon()

+ 85 - 0
src/lib/service.js

@@ -0,0 +1,85 @@
+import axios from 'axios'
+import Config from '../config'
+import { useRouter } from 'vue-router'
+import { useStore } from 'vuex'
+// axios.defaults.baseURL = Config.Host
+
+if (sessionStorage.getItem('access_token')) {
+  axios.defaults.headers.common['Access-Token'] = sessionStorage.getItem('access_token')
+}
+if (sessionStorage.getItem('lang')) {
+  axios.defaults.headers.common['Language'] = sessionStorage.getItem('lang')
+}
+if (sessionStorage.getItem('CLIENT')) {
+  axios.defaults.headers.common['CLIENT'] = sessionStorage.getItem('CLIENT')
+}
+
+class Service {
+  constructor() {
+    this.axio = axios
+    this.router = useRouter()
+  }
+
+  // session过期
+  SessionExpire() {
+    // 状态管理去处理过期事件
+    const store = useStore()
+    console.log(store)
+    // this.vue.$store.commit('InfoExpire', true)
+  }
+
+  // 统一登出
+  Logout() {
+    this.router.push({
+      name: 'login',
+    })
+    location.reload()
+  }
+
+  // method GET
+  get(url, params) {
+    return this.axio
+      .get(url, params)
+      .then((response) => {
+        if (response.data.code == Config.Code.StatusSessionExpire) {
+          this.SessionExpire()
+        } else {
+          return response.data
+        }
+      })
+      .catch(() => {
+        this.SessionExpire()
+
+        return {
+          code: Config.Code.StatusFail,
+          msg: 'System error',
+        }
+      })
+  }
+
+  // method POST
+  post(url, params) {
+    return this.axio
+      .post(url, params)
+      .then((response) => {
+        if (response.data.code == Config.Code.StatusSessionExpire) {
+          this.SessionExpire()
+        } else if (response.data.code == Config.Code.StatusSNotFound) {
+          return {
+            code: Config.Code.StatusFail,
+            msg: 'System error',
+          }
+        } else {
+          return response.data
+        }
+      })
+      .catch(() => {
+        return {
+          code: Config.Code.StatusFail,
+          msg: 'System error',
+        }
+      })
+  }
+}
+
+export default Service

+ 6 - 3
src/main.ts

@@ -1,7 +1,7 @@
 import { createApp } from 'vue'
 import App from './App.vue'
 import router from './routers'
-import pinia from './store'
+import vuex from './store/index'
 
 import { registerElIcons } from '@/plugins/ElIcons'
 // 引入全局组件布局
@@ -19,19 +19,22 @@ import 'element-plus/dist/index.css'
 import 'element-plus/theme-chalk/dark/css-vars.css'
 // 自定义暗黑模式
 import '@/styles/element-dark.scss'
+import '@/styles/cwg_common.scss'
 // 引入阿里图标库
-import '@/assets/iconfont/iconfont.css'
+import '@/assets/iconfont/iconfont.scss'
 import '@/assets/iconfont/iconfont.js'
 // 引入国际化
 import i18n from './i18n'
 
 import Config from './config'
 import SessionStorage from './lib/session.js'
+import Pigeon from './lib/pigeon.js'
 //定义mixin
 const mixins = {
   created() {
     this.Session = SessionStorage
     this.Config = Config
+    this.$pigeon = Pigeon
   },
 }
 
@@ -41,7 +44,7 @@ app.mixin(mixins)
 app.component('SvgIcon', SvgIcon)
 app.component('PageWrapLayout', PageWrapLayout)
 
-app.use(pinia)
+app.use(vuex)
 app.use(router)
 app.use(i18n)
 app.use(ElementPlus).mount('#app')

+ 4 - 4
src/permission.ts

@@ -6,7 +6,7 @@ import { usePermissionStore } from '@/store/modules/permission'
 
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
-const whiteList = ['/login', '/auth-redirect'] // 设置白名单
+const whiteList = ['/signin', '/forget', '/auth-redirect'] // 设置白名单
 // 记录路由
 let hasRoles = true
 
@@ -23,7 +23,7 @@ router.beforeEach(async (to, from, next) => {
   const hasToken = UserStore.token
 
   if (hasToken) {
-    if (to.path === '/login') {
+    if (to.path === '/signin') {
       // 如果已登录,请重定向到主页
       next({ path: '/' })
     } else {
@@ -40,14 +40,14 @@ router.beforeEach(async (to, from, next) => {
           next() // // 如果不传参数就会重新执行路由拦截,重新进到这里
         }
       } catch (error) {
-        next(`/login?redirect=${to.path}`)
+        next(`/signin?redirect=${to.path}`)
       }
     }
   } else {
     if (whiteList.indexOf(to.path) !== -1) {
       next()
     } else {
-      next(`/login?redirect=${to.path}`)
+      next(`/signin?redirect=${to.path}`)
     }
   }
 })

+ 1 - 1
src/routers/index.ts

@@ -50,11 +50,11 @@ export const constantRoutes: Array<RouteRecordRaw & extendRoute> = [
     name: 'login',
     component: () => import('@/views/login/User.vue'),
     hidden: true,
-    redirect: '/signin',
     children: [
       {
         path: '/signin',
         name: 'SignIn',
+        meta: { title: 'login', icon: 'House' },
         component: () => import('@/views/login/index.vue'),
         hidden: true,
       },

+ 103 - 0
src/service/login.ts

@@ -0,0 +1,103 @@
+import Service from '../lib/service.js'
+import axios from 'axios'
+import Config from '../config'
+
+class LoginService extends Service {
+  constructor() {
+    super()
+    axios.defaults.baseURL = Config.Host85
+  }
+
+  //登录
+  async Login(params = {}) {
+    console.log(this)
+    const res = await this.post('/user/login', params)
+    return res
+  }
+
+  // 获取登录信息
+  async CustomLoginInfo(params = {}) {
+    const res = await this.post('/user/info', params)
+    return res
+  }
+
+  //登出
+  async Logout(params = {}) {
+    const res = await this.post('/user/logout', params)
+    return res
+  }
+
+  //注册
+  async Register(params = {}) {
+    const res = await this.post('/custom/register', params)
+    return res
+  }
+
+  //发送邮件验证
+  async Code(params = {}) {
+    const res = await this.post('/custom/register/send/code', params)
+    return res
+  }
+
+  //当前国家编码
+  async CodeById(params = {}) {
+    const res = await this.post('/country/getCodeByIp', params)
+    return res
+  }
+
+  //语言切换
+  async switchLanguage(params = {}) {
+    const res = await this.post('/user/switch/lang', params)
+    return res
+  }
+
+  //忘记密码
+  async forgetPwd(params = {}) {
+    const res = await this.post('/user/update/password/send/email', params)
+    return res
+  }
+
+  //修改密码
+  async updatePwd(params = {}) {
+    const res = await this.post('/user/update/login/password', params)
+    return res
+  }
+
+  //高风险客户内转提醒list
+  async financeTransferRiskRemindList(params = {}) {
+    const res = await this.post('/finance/transfer/risk/remind/list', params)
+    return res
+  }
+
+  //高风险客户内转提醒
+  async financeTransferRiskRemindConfirm(params = {}) {
+    const res = await this.post('/finance/transfer/risk/remind/confirm', params)
+    return res
+  }
+
+  //发送邮件验证
+  async sendCode(params = {}) {
+    const res = await this.post('/user/login/send/code', params)
+    return res
+  }
+
+  //登录验证方式
+  async loginValid(params = {}) {
+    const res = await this.post('/user/login/valid', params)
+    return res
+  }
+
+  //获取用户附加信息(角色列表)
+  async getUserAttachs(params = {}) {
+    const res = await this.post('/user/attachs', params)
+    return res
+  }
+
+  //切换登录身份
+  async switchLogin(params = {}) {
+    const res = await this.post('/user/switchLogin', params)
+    return res
+  }
+}
+
+export default new LoginService()

+ 10 - 18
src/store/index.ts

@@ -1,23 +1,15 @@
-import { defineStore, createPinia } from 'pinia'
-// 引入持久化插件
-import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
+import { createStore } from 'vuex'
+import home from './modules/home'
+import navMenu from './modules/navMenu'
 
-export const Store = defineStore({
-  // id: 必须的,在所有 Store 中唯一
-  id: 'globalState',
-  // state: 返回对象的函数
-  state: () => ({}),
-  getters: {},
+const store = createStore({
+  state: {},
+  mutations: {},
   actions: {},
-  persist: {
-    // 本地存储的名称
-    key: 'globalState',
-    //保存的位置
-    storage: window.sessionStorage, //localstorage
+  modules: {
+    home,
+    navMenu,
   },
 })
 
-const pinia = createPinia()
-//pinia使用
-pinia.use(piniaPluginPersistedstate)
-export default pinia
+export default store

+ 35 - 0
src/store/modules/home.ts

@@ -0,0 +1,35 @@
+import session from '@/lib/session'
+
+export default {
+  state: {
+    user: '',
+    isTab: '',
+    expire: false,
+  },
+  mutations: {
+    //个人信息/登录信息
+    InitInfo(state, payload) {
+      if (payload != null) {
+        session.Set('user', JSON.stringify(payload), true)
+      }
+      try {
+        const userData = session.Get('user', true)
+        state.user = userData ? JSON.parse(userData) : null
+      } catch (error) {
+        console.error('Error parsing user data in store:', error)
+        state.user = null
+      }
+    },
+
+    //tab切换
+    isActiveTab(state, payload) {
+      state.isTab = payload
+      session.Set('isTab', payload)
+    },
+
+    //session过期
+    InfoExpire(state, payload) {
+      state.expire = payload
+    },
+  },
+}

+ 39 - 0
src/store/modules/navMenu.ts

@@ -0,0 +1,39 @@
+import session from '@/lib/session'
+
+export default {
+  state: {
+    index: "0",
+    isCollapse: false,
+    menus:[]
+  },
+  mutations: {
+    // 初始化菜单
+    InitNavMenu (state, payload) {
+      if (payload != null) {
+        session.Set("menus", JSON.stringify(payload), true)
+        session.Set("isCollapse", "false", false)
+      }
+      const menus = JSON.parse(session.Get("menus", true));
+      menus.forEach(item => {
+        if(item.name == 'R-User'){
+          const visibleChildren = item.children.filter(el => el.show);
+          if (visibleChildren.length === 1 && visibleChildren[0].name === 'R-UserList') {
+            console.log(visibleChildren[0].btns['R-UserList-Search'].show)
+            if(visibleChildren[0].btns['R-UserList-Search'].show === false) {
+              item.show = false
+            }
+          }
+        }
+      });
+      state.menus = JSON.parse(session.Get("menus", true));
+      console.log(state.menus, '---')
+      state.isCollapse = session.Get("isCollapse", false) == "true" ? true: false
+    },
+
+    // 菜单切换
+    SetCollapse (state, payload) {
+      state.isCollapse = payload;
+      session.Set("isCollapse", payload)
+    }
+  }
+}

+ 0 - 54
src/store/modules/permission.ts

@@ -1,54 +0,0 @@
-import { defineStore } from 'pinia'
-import { asyncRoutes, constantRoutes, routerArray, notFoundRouter } from '@/routers/index'
-import { hasPermission, filterAsyncRoutes } from '@/utils/routers'
-import { filterKeepAlive, filterRoutes } from '@/utils/routers'
-export const usePermissionStore = defineStore({
-  // id: 必须的,在所有 Store 中唯一
-  id: 'permissionState',
-  // state: 返回对象的函数
-  state: () => ({
-    // 路由
-    routes: [],
-    // 动态路由
-    addRoutes: [],
-    // 缓存路由
-    cacheRoutes: {},
-  }),
-  getters: {
-    permission_routes: (state) => {
-      return state.routes
-    },
-    keepAliveRoutes: (state) => {
-      return filterKeepAlive(asyncRoutes)
-    },
-  },
-  // 可以同步 也可以异步
-  actions: {
-    // 生成路由
-    generateRoutes(roles) {
-      return new Promise((resolve) => {
-        // 在这判断是否有权限,哪些角色拥有哪些权限
-        let accessedRoutes
-        if (roles && roles.length && !roles.includes('admin')) {
-          accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
-        } else {
-          accessedRoutes = asyncRoutes || []
-        }
-        accessedRoutes = accessedRoutes.concat(notFoundRouter)
-        this.routes = constantRoutes.concat(accessedRoutes)
-        this.addRoutes = accessedRoutes
-        resolve(accessedRoutes)
-      })
-    },
-    // 清楚路由
-    clearRoutes() {
-      this.routes = []
-      this.addRoutes = []
-      this.cacheRoutes = []
-    },
-    getCacheRoutes() {
-      this.cacheRoutes = filterKeepAlive(asyncRoutes)
-      return this.cacheRoutes
-    },
-  },
-})

+ 0 - 79
src/store/modules/setting.ts

@@ -1,79 +0,0 @@
-import { defineStore } from 'pinia'
-import { PRIMARY_COLOR } from '../../config'
-
-export const useSettingStore = defineStore({
-  // id: 必须的,在所有 Store 中唯一
-  id: 'settingState',
-  // state: 返回对象的函数
-  state: () => ({
-    // menu 是否收缩
-    isCollapse: true,
-    //
-    withoutAnimation: false,
-    device: 'desktop',
-    // 刷新当前页
-    isReload: true,
-    // 主题设置
-    themeConfig: {
-      // 显示设置
-      showSetting: false,
-      // 菜单展示模式 默认 vertical   horizontal / vertical /columns
-      mode: 'vertical',
-      // tagsView 是否展示 默认展示
-      showTag: true,
-      // 页脚
-      footer: true,
-      // 深色模式 切换暗黑模式
-      isDark: false,
-      // 显示侧边栏Logo
-      showLogo: true,
-      // 主题颜色
-      primary: PRIMARY_COLOR,
-      // element组件大小
-      globalComSize: 'default',
-      // 是否只保持一个子菜单的展开
-      uniqueOpened: true,
-      // 固定header
-      fixedHeader: true,
-      // 灰色模式
-      gray: false,
-      // 色弱模式
-      weak: false,
-    },
-  }),
-  getters: {},
-  // 可以同步 也可以异步
-  actions: {
-    // 设置主题
-    setThemeConfig({ key, val }) {
-      this.themeConfig[key] = val
-    },
-    // 切换 Collapse
-    setCollapse(value) {
-      this.isCollapse = value
-      this.withoutAnimation = false
-    },
-    // 关闭侧边栏
-    closeSideBar({ withoutAnimation }) {
-      this.isCollapse = false
-      this.withoutAnimation = withoutAnimation
-    },
-    toggleDevice(device) {
-      this.device = device
-    },
-    // 刷新
-    setReload() {
-      this.isReload = false
-      setTimeout(() => {
-        this.isReload = true
-      }, 50)
-    },
-  },
-  // 这部分数据不需要存储
-  // persist: {
-  //     // 本地存储的名称
-  //     key: "settingState",
-  //     //保存的位置
-  //     storage: window.localStorage,//localstorage
-  // },
-})

+ 0 - 107
src/store/modules/tagsView.ts

@@ -1,107 +0,0 @@
-import { defineStore } from 'pinia'
-import router from '@/routers/index'
-
-export const useTagsViewStore = defineStore({
-  // id: 必须的,在所有 Store 中唯一
-  id: 'tagsViewState',
-  // state: 返回对象的函数
-  state: () => ({
-    activeTabsValue: '/home',
-    visitedViews: [],
-    cachedViews: [],
-  }),
-  getters: {},
-  // 可以同步 也可以异步
-  actions: {
-    setTabsMenuValue(val) {
-      this.activeTabsValue = val
-    },
-    addView(view) {
-      this.addVisitedView(view)
-    },
-    removeView(routes) {
-      return new Promise((resolve, reject) => {
-        this.visitedViews = this.visitedViews.filter((item) => !routes.includes(item.path))
-        resolve(null)
-      })
-    },
-    addVisitedView(view) {
-      this.setTabsMenuValue(view.path)
-      if (this.visitedViews.some((v) => v.path === view.path)) return
-
-      this.visitedViews.push(
-        Object.assign({}, view, {
-          title: view.meta.title || 'no-name',
-        })
-      )
-      if (view.meta.keepAlive) {
-        this.cachedViews.push(view.name)
-      }
-    },
-    delView(activeTabPath) {
-      return new Promise((resolve) => {
-        this.delVisitedView(activeTabPath)
-        this.delCachedView(activeTabPath)
-        resolve({
-          visitedViews: [...this.visitedViews],
-          cachedViews: [...this.cachedViews],
-        })
-      })
-    },
-    toLastView(activeTabPath) {
-      const index = this.visitedViews.findIndex((item) => item.path === activeTabPath)
-      const nextTab = this.visitedViews[index + 1] || this.visitedViews[index - 1]
-      if (!nextTab) return
-      router.push(nextTab.path)
-      this.addVisitedView(nextTab)
-    },
-    delVisitedView(path) {
-      return new Promise((resolve) => {
-        this.visitedViews = this.visitedViews.filter((v) => {
-          return v.path !== path || v.meta.affix
-        })
-        this.cachedViews = this.cachedViews.filter((v) => {
-          return v.path !== path || v.meta.affix
-        })
-        resolve([...this.visitedViews])
-      })
-    },
-    delCachedView(view) {
-      return new Promise((resolve) => {
-        const index = this.cachedViews.indexOf(view.name)
-        index > -1 && this.cachedViews.splice(index, 1)
-        resolve([...this.cachedViews])
-      })
-    },
-    clearVisitedView() {
-      this.delAllViews()
-    },
-    delAllViews() {
-      return new Promise((resolve) => {
-        this.visitedViews = this.visitedViews.filter((v) => v.meta.affix)
-        this.cachedViews = this.visitedViews.filter((v) => v.meta.affix)
-        resolve([...this.visitedViews])
-      })
-    },
-    delOtherViews(path) {
-      this.visitedViews = this.visitedViews.filter((item) => {
-        return item.path === path || item.meta.affix
-      })
-      this.cachedViews = this.visitedViews.filter((item) => {
-        return item.path === path || item.meta.affix
-      })
-    },
-    goHome() {
-      this.activeTabsValue = '/home'
-      router.push({ path: '/home' })
-    },
-    updateVisitedView(view) {
-      for (let v of this.visitedViews) {
-        if (v.path === view.path) {
-          v = Object.assign(v, view)
-          break
-        }
-      }
-    },
-  },
-})

+ 0 - 61
src/store/modules/user.ts

@@ -1,61 +0,0 @@
-import { defineStore } from 'pinia'
-
-export const useUserStore = defineStore({
-  // id: 必须的,在所有 Store 中唯一
-  id: 'userState',
-  // state: 返回对象的函数
-  state: () => ({
-    // 登录token
-    token: null,
-    // 登录用户信息
-    userInfo: {},
-    // 角色
-    roles: localStorage.roles ? JSON.parse(localStorage.roles) : [],
-  }),
-  getters: {},
-  // 可以同步 也可以异步
-  actions: {
-    // 登录
-    login(userInfo) {
-      const { username, password } = userInfo
-      return new Promise(async (resolve, reject) => {
-        this.token = username
-        this.userInfo = userInfo
-        await this.getRoles()
-        resolve(username)
-      })
-    },
-    // 获取用户授权角色信息,实际应用中 可以通过token通过请求接口在这里获取用户信息
-    getRoles() {
-      return new Promise((resolve, reject) => {
-        // 获取权限列表 默认就是超级管理员,因为没有进行接口请求 写死
-        this.roles = ['admin']
-        localStorage.roles = JSON.stringify(this.roles)
-        resolve(this.roles)
-      })
-    },
-    // 获取用户信息 ,如实际应用中 可以通过token通过请求接口在这里获取用户信息
-    getInfo(roles) {
-      return new Promise((resolve, reject) => {
-        this.roles = roles
-        resolve(roles)
-      })
-    },
-    // 退出
-    logout() {
-      return new Promise((resolve, reject) => {
-        this.token = null
-        this.userInfo = {}
-        this.roles = []
-        resolve(null)
-      })
-    },
-  },
-  // 进行持久化存储
-  persist: {
-    // 本地存储的名称
-    key: 'userState',
-    //保存的位置
-    storage: window.localStorage, //localstorage
-  },
-})

+ 1 - 1
src/styles/index.scss

@@ -3,6 +3,6 @@
 @import './sidebar.scss';
 @import './transition.scss';
 @import './common.scss';
-@import './cwg_common.scss';
+//@import './cwg_common.scss';
 @import './default.scss';
 @import './element.scss';

+ 9 - 8
src/views/login/User.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-row id="user">
+  <el-row id="user" justify="center">
     <div style="height: auto">
       <div class="section-common section-top">
         <div class="bar">
@@ -22,7 +22,7 @@
             <el-dropdown trigger="click" @command="chooseLang">
               <span class="menu">
                 {{ langList[language] }}
-                <i class="el-icon-arrow-down el-icon--right"></i>
+                <el-icon><ArrowDown /></el-icon>
               </span>
               <template #dropdown>
                 <el-dropdown-menu>
@@ -44,16 +44,19 @@
 </template>
 
 <script lang="ts" setup>
-  import { ref, onMounted, inject } from 'vue'
+  import { ref, onMounted, inject, getCurrentInstance } from 'vue'
   import { useStore } from 'vuex'
   import { useI18n } from 'vue-i18n'
   import axios from 'axios'
+  import { ArrowDown } from '@element-plus/icons-vue'
   // import Service from '@/service/login'
   // 引入图片
   import logo from '@/assets/image/login/admin_LOGO12.png'
   import icon_cn from '@/assets/image/login/CN.jpg'
   import icon_en from '@/assets/image/login/EN.jpg'
   import { log } from 'echarts/types/src/util/log'
+
+  const { proxy } = getCurrentInstance()
   // 注入 reload 方法
   const reload = inject('reload')
   const store = useStore()
@@ -80,24 +83,22 @@
       console.error('获取IP失败:', err)
     }
   }
-
-  const init = async (abc) => {
-    console.log(abc)
-  }
-
   const initLanguage = () => {
     const savedLang = sessionStorage.getItem('lang')
+
     if (savedLang) {
       setLanguage(savedLang)
     } else {
       // 根据浏览器语言自动检测
       const browserLang = (navigator.language || navigator.browserLanguage).toLowerCase()
+      console.log(browserLang, 'asd')
       const detectedLang = browserLang.indexOf('zh') >= 0 ? 'cn' : 'en'
       chooseLang(detectedLang)
     }
   }
 
   const setLanguage = (lang) => {
+    console.log(locale)
     locale.value = language.value = lang
     axios.defaults.headers.common['Language'] = lang
   }

+ 6 - 1
src/views/login/index.scss

@@ -49,13 +49,18 @@
     user-select: none;
     white-space: nowrap;
     &:hover {
-      // @include font_main();
+       //@include font_main();
       color: #9d9d9d;
     }
   }
   .dia-content{
     .dialogCheck_form{
+      width: 100%;
       min-height: 100px;
+      :deep(.el-form-item__content){
+        width: 100%;
+        display: block;
+      }
     }
     .getCode{
       margin-top: 0;

+ 136 - 76
src/views/login/index.vue

@@ -4,9 +4,10 @@
       <i class="el-icon-unlock"></i>
       <span v-t="'signin.title'"></span>
     </div>
-    <el-form ref="params" :model="params" :rules="rules" label-width="0" class="form">
+    <el-form ref="paramsRef" :model="params" :rules="rules" label-width="0" class="form">
       <el-form-item prop="loginName">
         <el-input
+          :prefix-icon="Message"
           v-model.trim="params.loginName"
           class="m-input"
           :placeholder="$t('signin.form.email')"
@@ -18,6 +19,7 @@
           v-model.trim="params.password"
           class="m-input"
           type="password"
+          :prefix-icon="Key"
           autocomplete="off"
           show-password
           :placeholder="$t('signin.form.password')"
@@ -25,10 +27,12 @@
         ></el-input>
       </el-form-item>
       <el-form-item class="forget">
-        <div><a v-t="'signin.forget'" href="#/forget"></a></div>
+        <a style="width: 100%" href="#/forget">{{ $t('signin.forget') }}</a>
       </el-form-item>
       <el-form-item>
-        <el-button v-t="'signin.login'" type="danger" class="s-btn" @click="loginValid"></el-button>
+        <el-button type="danger" class="s-btn" @click="loginValid">
+          {{ $t('signin.login') }}
+        </el-button>
       </el-form-item>
     </el-form>
 
@@ -37,11 +41,12 @@
       :title="$t('getCode.item1')"
       center
       :close-on-click-modal="false"
-      custom-class="dialog_header_w"
+      class="dialog_header_w"
+      v-model="dialogCheck"
     >
       <div class="dia-content">
         <el-form
-          ref="dialogCheck_form"
+          ref="dialogCheckFormRef"
           :model="dialogCheck_form"
           :rules="rules"
           label-width="0"
@@ -53,10 +58,16 @@
                 <el-input
                   v-model.trim="dialogCheck_form.emailCode"
                   class="code"
-                  prefix-icon="iconfont iconyanzhengma"
                   :placeholder="$t('getCode.item2')"
                   @blur="selectChange"
-                ></el-input>
+                >
+                  <template #prefix>
+                    <i
+                      style="font-weight: bold; font-size: 20px"
+                      class="iconfont iconyanzhengma"
+                    ></i>
+                  </template>
+                </el-input>
               </el-col>
               <el-col :span="9" :push="1" style="display: flex; justify-content: center">
                 <span class="getCode" @click="getCode(1)" v-text="getCodeString"></span>
@@ -64,41 +75,45 @@
             </el-row>
           </el-form-item>
           <el-form-item v-if="dialogCheck_type == 1" prop="gaCode">
-            <el-row>
-              <el-col :span="24">
-                <el-input
-                  v-model.trim="dialogCheck_form.gaCode"
-                  class="code"
-                  prefix-icon="iconfont iconyanzhengma"
-                  :placeholder="$t('getCode.item3')"
-                  @blur="selectChange"
-                ></el-input>
-              </el-col>
-            </el-row>
+            <el-input
+              v-model.trim="dialogCheck_form.gaCode"
+              class="code"
+              :placeholder="$t('getCode.item3')"
+              @blur="selectChange"
+            >
+              <template #prefix>
+                <i style="font-weight: bold; font-size: 20px" class="iconfont iconyanzhengma"></i>
+              </template>
+            </el-input>
           </el-form-item>
         </el-form>
-        <!--        <div slot="footer" class="dialog-footer">-->
-        <!--          <el-button v-t="'Btn.Cancel'" @click="dialogCheck = false"></el-button>-->
-        <!--          <el-button v-t="'Btn.Confirm'" type="danger" @click="login()"></el-button>-->
-        <!--        </div>-->
       </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button v-t="'Btn.Cancel'" @click="dialogCheck = false"></el-button>
+          <el-button v-t="'Btn.Confirm'" type="danger" @click="login()"></el-button>
+        </div>
+      </template>
     </el-dialog>
   </div>
 </template>
 
 <script lang="ts" setup>
-  import { ref, reactive, onMounted } from 'vue'
+  import { ref, reactive, onMounted, computed, getCurrentInstance } from 'vue'
   import { useRouter } from 'vue-router'
   import { useStore } from 'vuex'
-  // import Service from '@/service/login'
+  import Service from '@/service/login'
   import Config from '@/config/index'
   import axios from 'axios'
   import type { FormInstance, FormRules } from 'element-plus'
+  import { Message, Key } from '@element-plus/icons-vue'
+  import { useI18n } from 'vue-i18n'
 
   const { Code } = Config
   const router = useRouter()
   const store = useStore()
 
+  const { t } = useI18n()
   // 类型定义
   interface LoginParams {
     loginName: string
@@ -131,15 +146,54 @@
   const dialogCheck_type = ref(0)
 
   // 表单引用
-  const paramsFormRef = ref<FormInstance>()
+  const paramsRef = ref<FormInstance>()
   const dialogCheckFormRef = ref<FormInstance>()
 
   // 验证规则
   const rules = reactive<FormRules>({
-    loginName: [{ required: true, message: '请输入登录名', trigger: 'blur' }],
-    password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
-    emailCode: [{ required: true, message: '请输入邮箱验证码', trigger: 'blur' }],
-    gaCode: [{ required: true, message: '请输入谷歌验证码', trigger: 'blur' }],
+    loginName: [
+      {
+        required: true,
+        message: t('vaildate.input.empty'),
+        trigger: 'blur',
+      },
+    ],
+    code: [
+      {
+        validator: (rule, value, callback) => {
+          if (params.emailCode != '' && params.emailCode != null) {
+            callback()
+          } else {
+            callback(new Error(t('vaildate.code.empty')))
+          }
+        },
+        trigger: 'blur',
+      },
+    ],
+    emailCode: [
+      {
+        validator: (rule, value, callback) => {
+          if (dialogCheck_form.emailCode != '' && dialogCheck_form.emailCode != null) {
+            callback()
+          } else {
+            callback(new Error(t('vaildate.code.empty')))
+          }
+        },
+        trigger: 'blur',
+      },
+    ],
+    gaCode: [
+      {
+        validator: (rule, value, callback) => {
+          if (dialogCheck_form.gaCode != '' && dialogCheck_form.gaCode != null) {
+            callback()
+          } else {
+            callback(new Error(t('vaildate.code.empty')))
+          }
+        },
+        trigger: 'blur',
+      },
+    ],
   })
 
   // 方法
@@ -149,9 +203,9 @@
 
   // 登录验证方式
   const loginValid = async () => {
-    if (!paramsFormRef.value) return
+    if (!paramsRef.value) return
 
-    const valid = await paramsFormRef.value.validate()
+    const valid = await paramsRef.value.validate()
     if (!valid) return
 
     loading.value = true
@@ -160,20 +214,22 @@
         loginName: params.loginName,
         password: params.password,
       }
-      // const res = await Service.loginValid(data)
-      //
-      // if (res.code === Code.StatusOK) {
-      //   const validFlag = res.data
-      //   dialogCheck.value = true
-      //   dialogCheck_type.value = validFlag === 1 ? 1 : 0
+      dialogCheck.value = true
+      const res = await Service.loginValid(data)
+      console.log(res, 'res')
       //
-      //   if (validFlag !== 1) {
-      //     await getCode(1)
-      //   }
-      // } else {
-      //   // 使用你的消息提示组件
-      //   console.error(res.msg)
-      // }
+      if (res.code === Code.StatusOK) {
+        const validFlag = res.data
+        dialogCheck.value = true
+        dialogCheck_type.value = validFlag === 1 ? 1 : 0
+
+        if (validFlag !== 1) {
+          await getCode(1)
+        }
+      } else {
+        // 使用你的消息提示组件
+        console.error(res.msg)
+      }
     } catch (error) {
       console.error('登录验证失败:', error)
     } finally {
@@ -203,15 +259,15 @@
               emailCode: dialogCheck_form.emailCode,
             }
 
-      // const res = await Service.Login(data)
-      // if (res.code === Code.StatusOK) {
-      //   dialogCheck.value = false
-      //   sessionStorage.setItem('access_token', res.data)
-      //   axios.defaults.headers.common['Access-Token'] = res.data
-      //   await getLoginInfo()
-      // } else {
-      //   console.error(res.msg)
-      // }
+      const res = await Service.Login(data)
+      if (res.code === Code.StatusOK) {
+        dialogCheck.value = false
+        sessionStorage.setItem('access_token', res.data)
+        axios.defaults.headers.common['Access-Token'] = res.data
+        await getLoginInfo()
+      } else {
+        console.error(res.msg)
+      }
     } catch (error) {
       console.error('登录失败:', error)
     } finally {
@@ -222,20 +278,20 @@
   // 获取登录信息
   const getLoginInfo = async () => {
     try {
-      // const res = await Service.CustomLoginInfo()
-      // if (res.code === Code.StatusOK) {
-      //   store.commit('InitInfo', res.data)
-      //   store.commit('InfoExpire', false)
-      //   sessionStorage.setItem('info', JSON.stringify(res.data))
-      //   console.log('登录成功')
-      //
-      //   setTimeout(() => {
-      //     router.push({ path: '/' }).catch((err) => console.log(err))
-      //   }, 1000)
-      // } else {
-      //   store.commit('InfoExpire', false)
-      //   console.error('系统错误')
-      // }
+      const res = await Service.CustomLoginInfo()
+      if (res.code === Code.StatusOK) {
+        store.commit('InitInfo', res.data)
+        store.commit('InfoExpire', false)
+        sessionStorage.setItem('info', JSON.stringify(res.data))
+        console.log('登录成功')
+
+        setTimeout(() => {
+          router.push({ path: '/' }).catch((err) => console.log(err))
+        }, 1000)
+      } else {
+        store.commit('InfoExpire', false)
+        console.error('系统错误')
+      }
     } catch (error) {
       console.error('获取登录信息失败:', error)
       loading.value = false
@@ -256,8 +312,8 @@
     }
 
     if (interval.value) return // 防止重复点击
-
-    getCodeString.value = `验证码已发送,${timer.value}秒后重新获取`
+    getCodeString.value = `
+    ${t('signup.form.waitCode1')}${timer.value}${t('signup.form.waitCode2')}`
 
     await getCode1(val)
 
@@ -266,9 +322,10 @@
       sessionStorage.setItem('timer', timer.value.toString())
 
       if (timer.value > 0) {
-        getCodeString.value = `验证码已发送,${timer.value}秒后重新获取`
+        getCodeString.value = `
+    ${t('signup.form.waitCode1')}${timer.value}${t('signup.form.waitCode2')}`
       } else {
-        getCodeString.value = '获取验证码'
+        getCodeString.value = t('signup.form.getCode')
         clearInterval(interval.value!)
         interval.value = null
         timer.value = 59
@@ -300,12 +357,12 @@
   // 初始化定时器
   const initTimer = () => {
     const storedTimer = sessionStorage.getItem('timer')
-    const t = storedTimer ? parseInt(storedTimer) : 59
+    const st = storedTimer ? parseInt(storedTimer) : 59
 
-    if (t === 59) {
-      getCodeString.value = '获取验证码'
+    if (st === 59) {
+      getCodeString.value = t('signup.form.getCode')
     } else {
-      timer.value = t
+      timer.value = st
       getCode(0)
     }
   }
@@ -316,11 +373,14 @@
 </script>
 <style lang="scss" scoped>
   @import './index.scss';
+</style>
+<style lang="scss">
   #signin {
-    .el-input__inner {
+    .el-input__wrapper {
       border: none;
       border-bottom: 1px solid;
       border-radius: 0;
+      box-shadow: none;
       @include border_gray_1();
     }
     .el-form-item {

Some files were not shown because too many files changed in this diff