首页白屏问题处理: 添加token处理 --提交人:阳华祥

This commit is contained in:
yang.huaxiang
2021-03-17 12:07:52 +08:00
parent 56835ea9b3
commit 6cd669cbd9
2 changed files with 6 additions and 0 deletions

View File

@@ -162,6 +162,7 @@ service.interceptors.request.use(
// token 不存在初始化处理 // token 不存在初始化处理
let token = CacheUtils.getLocItem('token') let token = CacheUtils.getLocItem('token')
if (!token) { if (!token) {
console.log('token====>>', token)
// 设备类型 // 设备类型
const target = BusinessCommon.device() const target = BusinessCommon.device()
// 安卓or苹果(非浏览器) // 安卓or苹果(非浏览器)

View File

@@ -135,6 +135,7 @@ import { getAgentInfo } from '@/api/ebiz/my/my'
import { getCongratulationList } from '@/api/ebiz/congratulation/congratulation.js' import { getCongratulationList } from '@/api/ebiz/congratulation/congratulation.js'
import dateUtil from '@/assets/js/utils/date-utils.js' import dateUtil from '@/assets/js/utils/date-utils.js'
import { orgShortNames } from '@/assets/js/utils/orgShortName' import { orgShortNames } from '@/assets/js/utils/orgShortName'
import CacheUtils from '@/assets/js/utils/cacheUtils'
export default { export default {
components: { components: {
[Loading.name]: Loading [Loading.name]: Loading
@@ -163,6 +164,10 @@ export default {
} }
}, },
async created() { async created() {
let arr = window.location.href.split('?token=')
if (arr.length > 1) {
CacheUtils.setLocItem('token', arr[1])
}
await this.getAgentInfo() await this.getAgentInfo()
if (this.isGoodStart) { if (this.isGoodStart) {
await this.getTableData() await this.getTableData()