|
@@ -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;
|
|
|
});
|