Commit 5d0cc991 by yancanhua

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

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