mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-15 14:06:45 +08:00
打印token
This commit is contained in:
@@ -121,6 +121,7 @@ service.interceptors.request.use(
|
|||||||
* 在HomeProduct页面获取代理人信息时, 客户端可能还未将token存储在本地
|
* 在HomeProduct页面获取代理人信息时, 客户端可能还未将token存储在本地
|
||||||
* 此时如果token为空, 调用客户端方法获取token并放入localstorage中
|
* 此时如果token为空, 调用客户端方法获取token并放入localstorage中
|
||||||
*/
|
*/
|
||||||
|
console.log('localstorage token: ', token)
|
||||||
if (relativePath === '/customer/agent/info' && !token) {
|
if (relativePath === '/customer/agent/info' && !token) {
|
||||||
// 设备类型
|
// 设备类型
|
||||||
const target = device()
|
const target = device()
|
||||||
@@ -128,6 +129,7 @@ service.interceptors.request.use(
|
|||||||
if (target.isAndroid || target.isIphone) {
|
if (target.isAndroid || target.isIphone) {
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
const res = await EWebBridge.webCallAppInJs('getToken')
|
const res = await EWebBridge.webCallAppInJs('getToken')
|
||||||
|
console.log('调用客户端获取token: ', res)
|
||||||
const token = JSON.parse(res).token
|
const token = JSON.parse(res).token
|
||||||
window.localStorage.setItem('token', token)
|
window.localStorage.setItem('token', token)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user