sunxiao 3 месяцев назад
Родитель
Сommit
8622f49635

+ 2 - 1
src/layout/components/HeaderGroup/index.vue

@@ -50,7 +50,8 @@ const logout = () => {
     cancelButtonText: '取消',
     type: 'warning'
   }).then(async () => {
-    if (voiceStore.isAuthPane) {
+
+    if ( voiceStore.isAuthPane ) {
       await voiceStore.unInit();
     }
     userStore.logOut().then(() => {

+ 1 - 1
src/layout/components/TelNoticeBox/index.vue

@@ -167,7 +167,7 @@ const onDialogOpen = async () => {
                 <el-scrollbar style="height: 100%;">
                   <ul class="info-list space-y-[8px]">
                     <li class="px-[14px] py-[14px] rounded-[8px] bg-white space-y-[4px]" v-for="item in callRecords" :key="item.id">
-                      <p class="text-[#000] text-[14px] font-bold leading-[20px]">2024-08-26 12:12:22</p>
+                      <p class="text-[#000] text-[14px] font-bold leading-[20px]">{{ item.createTime }}</p>
                       <ul class="text-[#4E5969] text-[12px] leading-[18px] space-y-[4px]">
                         <li class="flex">
                           <span class="w-[100px]">通话状态:</span> 

+ 1 - 1
src/permission.js

@@ -7,7 +7,7 @@ import { isHttp } from '@/utils/validate'
 import { isRelogin } from '@/utils/request'
 import useUserStore from '@/store/modules/user'
 import useSettingsStore from '@/store/modules/settings'
-import usePermissionStore from '@/store/modules/permission'
+import usePermissionStore from '@/store/modules/permission' 
 
 NProgress.configure({ showSpinner: false });
 

+ 3 - 1
src/store/modules/voice.js

@@ -135,7 +135,9 @@ const useVoiceStore = defineStore('voice', () => {
 
   // 卸载实例
   const unInit = async () => {
-    return await HS_CTI.unInit();
+    if ( HS_CTI ) {
+      return await HS_CTI.unInit();
+    }
   }
 
   // 下面开始事件监听

+ 26 - 2
src/views/login.vue

@@ -61,6 +61,7 @@ import { getCodeImg } from "@/api/login";
 import Cookies from "js-cookie";
 import { encrypt, decrypt } from "@/utils/jsencrypt";
 import useUserStore from '@/store/modules/user'
+import usePermissionStore from '@/store/modules/permission' 
 
 const userStore = useUserStore()
 const route = useRoute();
@@ -119,8 +120,31 @@ function handleLogin() {
       }
       return acc;
     }, {});
-    // redirect.value
-    router.push({ path: "/voice/workbench", query: otherQueryParams });
+
+    usePermissionStore().generateRoutes().then(accessRoutes => {
+      if ( accessRoutes.length ) {
+        let isOff = false;
+        accessRoutes.forEach(({ children }) => {
+          children?.forEach(item => {
+            if ( item.path === 'voice/workbench' ) {
+              isOff = true;
+            }
+          })
+        });
+
+        if ( isOff ) {
+          router.push({ path: "/voice/workbench", query: otherQueryParams });
+        } else {
+          const path = accessRoutes[0]?.children[0]?.path;
+          router.push({ path });
+        }
+      } 
+
+      console.log( "accessRoutes", accessRoutes );
+
+    })
+    
+    // router.push({ path: "/voice/workbench", query: otherQueryParams });
   }).catch(() => {
     loading.value = false;
   });