打印token

This commit is contained in:
mengxiaolong
2020-11-25 16:13:02 +08:00
parent 66b1b9685a
commit fe34d439ed

View File

@@ -121,6 +121,7 @@ service.interceptors.request.use(
* 在HomeProduct页面获取代理人信息时, 客户端可能还未将token存储在本地
* 此时如果token为空, 调用客户端方法获取token并放入localstorage中
*/
console.log('localstorage token: ', token)
if (relativePath === '/customer/agent/info' && !token) {
// 设备类型
const target = device()
@@ -128,6 +129,7 @@ service.interceptors.request.use(
if (target.isAndroid || target.isIphone) {
// eslint-disable-next-line no-undef
const res = await EWebBridge.webCallAppInJs('getToken')
console.log('调用客户端获取token: ', res)
const token = JSON.parse(res).token
window.localStorage.setItem('token', token)
}