Commit 5d0cc991 by yancanhua

fix: 企业微信授权登录测试环境自测问题修改

1 parent 41014c0b
......@@ -38,7 +38,7 @@ router.beforeEach((to, from, next) => {
console.log(recode)
setTimeout(() => {
store.dispatch('login')
}, 1200)
}, 660)
})
if (to.matched.some(recode => recode.meta.noAuth)) {
console.log('noAuth')
......
......@@ -47,16 +47,16 @@ const actions = {
const pathKeywords = ['/department', '/personage', '/company'];
const isTargetPath = pathKeywords.some(keyword => currentPath.includes(keyword));
if (isTargetPath) {
state.showWindow = false
try {
let { corpId, agentId } = getParams();
const wwCode = getParams('code');
let { loginUrl } = window.$fetchConfig;
let userInfo = util.getLocalStorage('ww_userInfo');
let userInfo = window.sessionStorage.getItem('ww_userInfo') || '';
if(userInfo) return state.showWindow = true;
if (wwCode) {
ssoApi.login({ code: wwCode, corpId, getUserInfoFlag: false }).then(res => {
const { code, data, message } = res;
state.showWindow = false
if (code == 0) {
state.showWindow = true;
if (data.loginList && data.loginList.length) {
......@@ -64,8 +64,8 @@ const actions = {
if (item.loginList && item.loginList.length) {
let [userInfo] = item.loginList,
{ phone } = userInfo
if (phone) util.setLocalStorage('ww_params_phone', phone)
util.setLocalStorage('ww_userInfo', userInfo)
if (phone) window.sessionStorage.setItem('ww_params_phone', JSON.stringify(phone))
window.sessionStorage.setItem('ww_userInfo', JSON.stringify(userInfo))
} else throw ''
} else throw ''
} else throw message
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!