소스 검색

授权登录修改

duy 3 달 전
부모
커밋
ae1162a7cf
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 7 5
      src/views/home/auth.vue

+ 7 - 5
src/views/home/auth.vue

@@ -36,7 +36,7 @@ store.clearStoreData()
 //变量
 const loading = ref(true)
 const isErrorShow = ref(false)
-const toUrl = ref('/statistics/stats')
+const toUrl = ref('')
 
 //渲染完成
 onMounted(() => {
@@ -44,7 +44,7 @@ onMounted(() => {
     const { token, tid, pid, cid, bg, layout, url } = getObjValue(useRoutes.query)
     if (!isNullES(token)) {
         isErrorShow.value = false
-        toUrl.value = url ?? '/datav'
+        toUrl.value = url 
         //缓存数据
         store.setTokenVal(token)
         store.setProjectId(pid)
@@ -85,22 +85,24 @@ const loginByTokenApi = async (form) => {
             isErrorShow.value = false
          
             window?.$message?.success('授权登录成功')
+            console.log(toUrl.value, 'toUrl.value')
             if (!website.localModel) {
             //210跳转文件收集
                 // router.push({ name: 'file' })  
             const role_id = getStoreValue('role_id')
             if (website.ex_role_id.includes(role_id)) {
+                console.log('专家跳转')
                 router.push({ name: 'transfer-initial-expert' })
             } else {
-                router.push({ path: toUrl.value })
+              
                 if (toUrl.value) {
                     router.push({ path: toUrl.value })
                 } else {
                     router.push({ name: 'statistics-stats' })
                 }
-                // router.push({ name: 'statistics-stats' })
+              
             }
-            // router.push({ path: toUrl.value })
+           
             } else {
                 // window?.$message?.success('授权登录成功')
                 //甬台温,跳转大屏