|
@@ -34,17 +34,20 @@ store.clearStoreData()
|
|
|
//变量
|
|
|
const loading = ref(true)
|
|
|
const isErrorShow = ref(false)
|
|
|
+const toUrl = ref('/home/index')
|
|
|
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
- // http://质检的域名/#/auth-token?token=xxx&tid=xxx&pid=xxx&cid=xxx
|
|
|
- const { token, tid, pid, cid } = getObjValue(useRoutes.query)
|
|
|
+ // http://质检的域名/#/auth-token?token=xxx&tid=xxx&pid=xxx&cid=xxx&layout=no&url=xxx
|
|
|
+ const { token, tid, pid, cid, layout, url } = getObjValue(useRoutes.query)
|
|
|
if (!isNullES(token)) {
|
|
|
isErrorShow.value = false
|
|
|
+ toUrl.value = url ?? '/home/index'
|
|
|
//缓存数据
|
|
|
store.setTokenVal(token)
|
|
|
store.setProjectId(pid)
|
|
|
store.setContractId(cid)
|
|
|
+ store.setIsLayout(layout)
|
|
|
//处理授权登录
|
|
|
setLoginByTokenData(token, tid)
|
|
|
} else {
|
|
@@ -77,7 +80,7 @@ const loginByTokenApi = async (form) => {
|
|
|
loading.value = false
|
|
|
isErrorShow.value = false
|
|
|
window?.$message?.success('授权登录成功')
|
|
|
- router.push({ path: '/home/index' })
|
|
|
+ router.push({ path: toUrl.value })
|
|
|
}, 1500)
|
|
|
} else {
|
|
|
window.$message?.error('授权登录失败')
|