|
@@ -1,10 +1,23 @@
|
|
|
<script setup>
|
|
|
-import {apiSystemSet} from '@/api/system'
|
|
|
+import {apiSystemSet,apiSystemCommon} from '@/api/system'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
const route=useRoute()
|
|
|
const router=useRouter()
|
|
|
|
|
|
+// 获取有菜单跳转
|
|
|
+async function handleNavigation(){
|
|
|
+ const res=await apiSystemCommon.menuList()
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ const arr=res.Data.List||[]
|
|
|
+ if(arr.length===0){
|
|
|
+ MessagePlugin.waring('无任何菜单权限,请联系管理员')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const path=arr[0].Child[0].path
|
|
|
+ router.replace(path)
|
|
|
+}
|
|
|
+
|
|
|
function init(){
|
|
|
const code=route.query.code
|
|
|
if(!code) return
|
|
@@ -14,7 +27,7 @@ function init(){
|
|
|
if(res.Ret===200){
|
|
|
sessionStorage.setItem('token',res.Data.Authorization)
|
|
|
sessionStorage.setItem('userInfo',JSON.stringify(res.Data))
|
|
|
- router.replace('/etaChart/index')
|
|
|
+ handleNavigation()
|
|
|
}
|
|
|
})
|
|
|
}
|