单点登录bug修复
This commit is contained in:
parent
25b6d1196b
commit
dfa6c6a67b
|
@ -28,10 +28,10 @@
|
|||
<!-- 站点配置 -->
|
||||
<script>
|
||||
window.SITE_CONFIG = {};
|
||||
// window.SITE_CONFIG['backUrl'] = 'http://15.72.183.90:8001';
|
||||
// window.SITE_CONFIG['previewUrl'] = 'http://15.72.183.90:7008/';
|
||||
// window.SITE_CONFIG['frontUrl'] = 'http://15.72.183.90:7008/document/#/devModelFile/';
|
||||
// window.SITE_CONFIG['apiURL'] = 'http://15.72.183.90:8000/renren-admin';
|
||||
window.SITE_CONFIG['backUrl'] = 'http://15.72.183.90:8001';
|
||||
window.SITE_CONFIG['previewUrl'] = 'http://15.72.183.90:7008/';
|
||||
window.SITE_CONFIG['frontUrl'] = 'http://15.72.183.90:7008/document/#/devModelFile/';
|
||||
window.SITE_CONFIG['apiURL'] = 'http://15.72.183.90:8000/renren-admin';
|
||||
window.SITE_CONFIG['POI_URL'] = 'http://15.72.178.129:8090/iserver/services/addressmatch-qingdaoPOI181015/restjsr/v1/address';
|
||||
// 包头
|
||||
// window.SITE_CONFIG['backUrl'] = 'http://10.110.205.1:8001';
|
||||
|
@ -45,10 +45,10 @@
|
|||
// window.SITE_CONFIG['frontUrl'] = 'http://10.134.135.9:9796/document/#/devModelFile/';
|
||||
// window.SITE_CONFIG['apiURL'] = 'http://10.134.135.9:8888/renren-admin';
|
||||
// 开发
|
||||
window.SITE_CONFIG['backUrl'] = 'http://15.2.21.238:9797';
|
||||
window.SITE_CONFIG['previewUrl'] = 'http://15.2.21.238:9796/';
|
||||
window.SITE_CONFIG['frontUrl'] = 'http://15.2.21.238:9796/document/#/devModelFile/';
|
||||
window.SITE_CONFIG['apiURL'] = 'http://15.2.21.238:8888/renren-admin';
|
||||
// window.SITE_CONFIG['backUrl'] = 'http://15.2.21.238:9797';
|
||||
// window.SITE_CONFIG['previewUrl'] = 'http://15.2.21.238:9796/';
|
||||
// window.SITE_CONFIG['frontUrl'] = 'http://15.2.21.238:9796/document/#/devModelFile/';
|
||||
// window.SITE_CONFIG['apiURL'] = 'http://15.2.21.238:8888/renren-admin';
|
||||
// window.SITE_CONFIG['POI_URL'] = 'http://15.72.178.129:8090/iserver/services/addressmatch-qingdaoPOI181015/restjsr/v1/address';
|
||||
// 穿透版本
|
||||
// window.SITE_CONFIG['backUrl'] = 'http://124.222.94.39:9797';
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2020-07-07 16:03:23
|
||||
* @LastEditors: hisense.wuhongjian
|
||||
* @LastEditTime: 2022-07-05 20:08:53
|
||||
* @LastEditTime: 2022-07-07 17:30:10
|
||||
* @Description: 数据资源参数配置
|
||||
*/
|
||||
//const newLocation = 'qingdao'
|
||||
const newLocation = 'qingdao'
|
||||
// const newLocation = 'baotou'
|
||||
const newLocation = 'xihaian'
|
||||
// const newLocation = 'xihaian'
|
||||
|
||||
// 数据资源数据
|
||||
const whoShow = {}
|
||||
|
|
|
@ -113,31 +113,21 @@ const actions = {
|
|||
* @param {*} { commit, dispatch, state }
|
||||
* @returns
|
||||
*/
|
||||
async getUserInfo({ commit }) {
|
||||
const { data } = await getUserInfo()
|
||||
if (!data) {
|
||||
message.error(`验证失败,请重新登录...`)
|
||||
return false
|
||||
}
|
||||
// debugger
|
||||
commit('setUsername', data.data.username)
|
||||
commit('setRole', data.data.roleIdList.length)
|
||||
commit('setUserId', data.data.id)
|
||||
// TODO 获取用户信息,后续执行部分操作
|
||||
// let { username, avatar, roles, ability } = data
|
||||
// if (username && roles && Array.isArray(roles)) {
|
||||
// dispatch('acl/setRole', roles, {
|
||||
// root: true,
|
||||
// })
|
||||
// if (ability && ability.length > 0)
|
||||
// dispatch('acl/setAbility', ability, {
|
||||
// root: true,
|
||||
// })
|
||||
// commit('setUsername', username)
|
||||
// commit('setAvatar', avatar)
|
||||
// } else {
|
||||
// message.error('用户信息接口异常')
|
||||
// }
|
||||
getUserInfo({ commit }) {
|
||||
return new Promise((resolve, reject)=>{
|
||||
getUserInfo().then( (res) =>{
|
||||
console.log('res', res)
|
||||
const data = res.data
|
||||
if (!data) {
|
||||
message.error(`验证失败,请重新登录...`)
|
||||
reject()
|
||||
}
|
||||
commit('setUsername', data.data.username)
|
||||
commit('setRole', data.data.roleIdList.length)
|
||||
commit('setUserId', data.data.id)
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -114,10 +114,14 @@ instance.interceptors.response.use(
|
|||
location.reload()
|
||||
}, 1000)
|
||||
}
|
||||
debugger;
|
||||
response['Access-Control-Expose-Headers'] = 'redirect'
|
||||
const { code, message } = response.data
|
||||
if (response.headers.token) {
|
||||
setAccessToken(response.headers.token)
|
||||
debugger
|
||||
// setAccessToken(response.headers.token)
|
||||
// store.dispatch('user/getUserInfo')
|
||||
} else {
|
||||
if (response.headers.redirect) {
|
||||
// window.location.href = response.headers.redirect
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2022-04-01 17:23:11
|
||||
* @LastEditors: hisense.liangjunhua
|
||||
* @LastEditTime: 2022-06-29 09:54:19
|
||||
* @LastEditors: hisense.wuhongjian
|
||||
* @LastEditTime: 2022-07-07 18:15:38
|
||||
* @Description: 告诉大家这是什么
|
||||
*/
|
||||
/**
|
||||
|
@ -20,6 +20,7 @@ import {
|
|||
} from '@/config'
|
||||
import { setAccessToken, getAccessToken } from '@/utils/accessToken'
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
// 初始化拦截
|
||||
// debugger
|
||||
// const SSOTOKEN = to.query.SSOToken
|
||||
// if (SSOTOKEN) {
|
||||
|
@ -29,11 +30,14 @@ router.beforeEach(async (to, from, next) => {
|
|||
// console.log('token', token)
|
||||
let hasToken = token || store.getters['user/accessToken']
|
||||
// debugger
|
||||
// 未开启登录拦截状态
|
||||
if (!loginInterception) hasToken = true
|
||||
// console.log('hasToken存在巨大问题', hasToken)
|
||||
debugger
|
||||
if (hasToken) {
|
||||
setAccessToken(hasToken)
|
||||
setAccessToken(token)
|
||||
await store.dispatch('user/getUserInfo')
|
||||
debugger
|
||||
next()
|
||||
} else {
|
||||
let accessRoutes = []
|
||||
|
@ -44,11 +48,17 @@ router.beforeEach(async (to, from, next) => {
|
|||
if (routesWhiteList.indexOf(to.path) !== -1) {
|
||||
next()
|
||||
} else {
|
||||
await store.dispatch('user/getUserInfo')
|
||||
store.dispatch('user/getUserInfo').then((res)=>{
|
||||
debugger
|
||||
next()
|
||||
})
|
||||
// if (recordRoute)
|
||||
// next({ path: '/login', query: { redirect: to.path }, replace: true })
|
||||
// else next({ path: '/login', replace: true })
|
||||
next()
|
||||
// debugger
|
||||
// setTimeout(()=>{
|
||||
// next()
|
||||
// }, 500)
|
||||
// window.open('http://www.baidu.com', '_self')
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<span
|
||||
v-for="itemContent in item.content"
|
||||
:key="itemContent"
|
||||
@click="tabClick(index, itemContent, itemContent)"
|
||||
@click="tabClick(index, item.title)"
|
||||
:class="
|
||||
clickList[index].content.indexOf(itemContent.labelName) != -1 ||
|
||||
clickList[index].content.indexOf(itemContent) != -1
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
} else {
|
||||
let type = paramsGetResources.type
|
||||
if (type == '基础设施') {
|
||||
selectInfrastructureList().then((res) => {
|
||||
selectInfrastructureList().then((res) => {
|
||||
console.log('基础设施==========>', res.data.data)
|
||||
for (const key in res.data.data) {
|
||||
jcList.value.push({
|
||||
|
|
Loading…
Reference in New Issue