Commit e8276a01 by yancanhua

fix: 企业微信登录自测问题调整

1 parent efbd4c66
<template>
<div id="app">
<template v-show="showWindow">
<div v-show="isShowWindow">
<transition name="fade">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
......@@ -9,10 +9,10 @@
<transition name="fade">
<router-view v-if="!$route.meta.keepAlive"></router-view>
</transition>
</template>
<template v-show="!showWindow">
<div style="text-align: center;font-size: 14px;height: 48px;line-height: 48px;">{{windowTitle}}</div>
</template>
</div>
<div v-show="!isShowWindow">
<div style="text-align: center;font-size: 14px;height: 48px;line-height: 48px;">{{ windowTitle }}</div>
</div>
</div>
</template>
<script>
......@@ -20,7 +20,7 @@ export default {
name: 'App',
data() {
return {
showWindow: false,
isShowWindow: false,
windowTitle: ''
}
},
......@@ -28,7 +28,7 @@ export default {
watchFlag: {
immediate: true,
handler(newval) {
this.showWindow = newval
this.isShowWindow = newval
}
}
},
......
......@@ -58,14 +58,14 @@ const actions = {
if (userInfo.timestamp && (Date.now() - userInfo.timestamp) > (1000 * 60 * 1440)) {
console.log('用户登录过期');
} else {
console.log('用户登录未过期');
console.log('用户已经登录');
return state.showWindow = true;
}
}
if (wwCode) {
ssoApi.login({ code: wwCode, corpId, getUserInfoFlag: false }).then(res => {
const { code, data, message } = res;
if (code == 0) {
if (code == "0") {
state.showWindow = true;
if (data.loginList && data.loginList.length) {
let [item] = data.loginList
......@@ -78,14 +78,12 @@ const actions = {
util.setLocalStorage('ww_userInfo', userInfo);
} else throw ''
} else throw ''
} else throw message
} else {
Notify({ message: message })
state.showWindow = false
}
})
} else {
//添加提醒
// Notify({
// message: '正在登录授权中...',
// duration: 1200
// })
window.location.href = `${loginUrl}?redirect_uri=${encodeURIComponent(window.location.href)}&corpId=${corpId}&agentId=${agentId}&backLoginCode=BACKCODE`
}
} catch (error) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!