xiaohaizhao 3 mēneši atpakaļ
vecāks
revīzija
1f86f91675
2 mainītis faili ar 48 papildinājumiem un 41 dzēšanām
  1. 15 8
      src/components/layout/modules/aside.vue
  2. 33 33
      src/stores/modules/auth.js

+ 15 - 8
src/components/layout/modules/aside.vue

@@ -4,8 +4,8 @@
       <img style="width:100%;" src="@/assets/logo1.png" @click="onLogoClick" />
       <menu-fold-outlined v-if="!collapsed" @click="onCollapsed" />
     </div>
-    <div class="aside-item" :class="actSystem.systemid == item.systemid ? 'onSystem' : ''" v-for="(item, index) in system"
-      :key="index" @click="onsystemClick(item)">
+    <div class="aside-item" :class="actSystem.systemid == item.systemid ? 'onSystem' : ''"
+      v-for="(item, index) in system" :key="index" @click="onsystemClick(item)">
       <div v-if="collapsed" class="menu-icon uncollapsed">
         <span class="aside-menu-icon">
           <a-tooltip placement="right">
@@ -64,12 +64,19 @@ let { system, mods, actSystem, shortcuts } = storeToRefs(store)
 
 const collapsed = ref(true)
 const onsystemClick = (item) => {
-  const targetPath = item?.modules?.[0]?.apps?.[0]?.path || ''
-  if (actSystem.value?.systemid === item.systemid && router.currentRoute.value.path === targetPath) return
-  actSystem.value = item
-  mods.value = item.modules
-  if (targetPath && router.currentRoute.value.path !== targetPath) {
-    router.push({ path: targetPath })
+  if (item.systemname == "E-订单") {
+    let isDev = /^https?:\/\/\d{1,3}(\.\d{1,3}){3}(:\d+)?/.test(window.location.href),
+      url = isDev ? 'http://61.164.207.46:8300' : 'https://crm.meida.com:16691';
+    url += `/yosweb/index.html#/connectionPage?accesstoken=${sessionStorage.getItem('token')}&accountno=${sessionStorage.getItem('accountno')}`
+    window.open(url, "_self")
+  } else {
+    const targetPath = item?.modules?.[0]?.apps?.[0]?.path || ''
+    if (actSystem.value?.systemid === item.systemid && router.currentRoute.value.path === targetPath) return
+    actSystem.value = item
+    mods.value = item.modules
+    if (targetPath && router.currentRoute.value.path !== targetPath) {
+      router.push({ path: targetPath })
+    }
   }
 }
 const onDeleteClick = async (systemappid) => {

+ 33 - 33
src/stores/modules/auth.js

@@ -6,19 +6,19 @@ import Api from '@/api/api'
 export const useAuthStore = defineStore('auth', {
   state: () => {
     return {
-      isRefresh:true,
-      accountList:[],
-      nowAccount:{},
+      isRefresh: true,
+      accountList: [],
+      nowAccount: {},
       system: [],
-      actSystem:'',
-      mods:[],
-      app:{},
-      actMod:{},
-      current:[],
-      tableConfigs:{},
-      hiddenSensitiveFields:false,
-      fieldsParam:{},
-      qrCordBaseUrl:'',//二维码基本地址
+      actSystem: '',
+      mods: [],
+      app: {},
+      actMod: {},
+      current: [],
+      tableConfigs: {},
+      hiddenSensitiveFields: false,
+      fieldsParam: {},
+      qrCordBaseUrl: '',//二维码基本地址
     }
   },
   // 开启数据缓存
@@ -27,14 +27,14 @@ export const useAuthStore = defineStore('auth', {
     strategies: [
       {
         storage: localStorage,
-        paths: ['system', 'mods','app','accountList','nowAccount','actSystem','current','tableConfigs','hiddenSensitiveFields','qrCordBaseUrl','fieldsParam']
+        paths: ['system', 'mods', 'app', 'accountList', 'nowAccount', 'actSystem', 'current', 'tableConfigs', 'hiddenSensitiveFields', 'qrCordBaseUrl', 'fieldsParam']
       }
     ]
   },
-  getters:{},
-  actions:{
-    systemAuthData () {
-      return new Promise(async (reslove,reject)=>{
+  getters: {},
+  actions: {
+    systemAuthData() {
+      return new Promise(async (reslove, reject) => {
         let data = {
           "classname": "sysmanage.develop.userauthforweb.userauth",
           "method": "query_userauth",
@@ -50,7 +50,7 @@ export const useAuthStore = defineStore('auth', {
         reslove(this.mods)
       })
     },
-    async hideKeyWords (data) {
+    async hideKeyWords(data) {
       let account = data
       const res = await Api.requested({
         "classname": "sysmanage.develop.optiontype.optiontype",
@@ -72,7 +72,7 @@ export const useAuthStore = defineStore('auth', {
       }
     },
     // 获取模块数据
-    modulesData (system) {
+    modulesData(system) {
       this.mods = system.modules
     },
     // 遍历应用
@@ -97,21 +97,21 @@ export const useAuthStore = defineStore('auth', {
       return foundApp;
     },
     // 获取应用数据
-    appData (appName) {
+    appData(appName) {
       return new Promise((resolve, reject) => {
-        this.app = this.findAppByName(this.system,appName)
+        this.app = this.findAppByName(this.system, appName)
         resolve()
       })
     },
     // 查询应用是否存在
-    hasAppData (appName) {
-      if (this.findAppByName(this.system,appName)) {
+    hasAppData(appName) {
+      if (this.findAppByName(this.system, appName)) {
         return true
       } else {
         return false
       }
     },
-    async getConfig () {
+    async getConfig() {
       const res = await Api.requested({
         "classname": "sysmanage.develop.users.users",
         "method": "queryClientConfig",
@@ -127,7 +127,7 @@ export const useAuthStore = defineStore('auth', {
     /**
      * 设置默认账号
      */
-    async defaultAccount (account,fn) {
+    async defaultAccount(account, fn) {
       switch (account.siteid) {
         case 'cucu':
           this.qrCordBaseUrl = 'https://lsa.cnyunl.com/'
@@ -142,19 +142,19 @@ export const useAuthStore = defineStore('auth', {
           break;
       }
       account ? this.nowAccount = account : this.nowAccount
-
-      sessionStorage.setItem('token',this.nowAccount.token)
+      sessionStorage.setItem('token', this.nowAccount.token)
+      sessionStorage.setItem('accountno', this.nowAccount.accountno)
 
       this.getConfig()
       this.hideKeyWords(account)
       const res = await this.systemAuthData()
       fn(res)
-      
+
     },
     /**
      * 切换站点以后刷新数据
      */
-    reloadPage (fn) {
+    reloadPage(fn) {
       this.isRefresh = false
       setTimeout(() => {
         this.isRefresh = true
@@ -164,14 +164,14 @@ export const useAuthStore = defineStore('auth', {
      * 手动缓存列表查询参数,防止丢失
      */
 
-    setQueryParams (queryParams) {
+    setQueryParams(queryParams) {
       this.fieldsParam[this.app.name] = queryParams
     },
-    getQueryParams () {
+    getQueryParams() {
       console.log(this.fieldsParam)
       return this.fieldsParam[this.app.name] || null
     },
-    
+
   }
-    
+
 })