单点修改1
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { Message, MessageBox } from 'element-ui'
|
import { Message, MessageBox } from 'element-ui'
|
||||||
|
import router from '../router'
|
||||||
import store from '../store'
|
import store from '../store'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: process.env.BASE_API, // api 的 base_url
|
baseURL: process.env.BASE_API, // api 的 base_url
|
||||||
timeout: 20000 // 请求超时时间
|
timeout: 200000 // 请求超时时间
|
||||||
})
|
})
|
||||||
|
|
||||||
// request拦截器
|
// request拦截器
|
||||||
@@ -41,7 +42,13 @@ service.interceptors.response.use(
|
|||||||
// sessionStorage.clear()
|
// sessionStorage.clear()
|
||||||
// localStorage.clear()
|
// localStorage.clear()
|
||||||
localStorage.removeItem('AJReportToken')
|
localStorage.removeItem('AJReportToken')
|
||||||
window.location.href = "/";
|
router.push({
|
||||||
|
path: '/login',
|
||||||
|
query: {
|
||||||
|
redirect: location.hash.substring(1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// window.location.href = "/index?redirect=" + location.hash.substring(1);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
else if (res.code !== '200') {
|
else if (res.code !== '200') {
|
||||||
|
|||||||
@@ -144,27 +144,23 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.handleLoginFocus();
|
this.handleLoginFocus();
|
||||||
//获取url传参 ticket url
|
//获取url传参 ticket url
|
||||||
const ticket = this.$route.query.ticket;
|
const ticket = this.$route.query.ticket;
|
||||||
debugger
|
let token = getToken();
|
||||||
let token = getToken();
|
if (ticket == undefined && token == null) {
|
||||||
console.log(ticket);
|
//跳转统一身份认证
|
||||||
console.log(token);
|
var isTs = true;
|
||||||
if (ticket == undefined && token == null) {
|
if (isTs) {
|
||||||
//跳转统一身份认证
|
console.log(this.redirect );
|
||||||
var isTs = true;
|
window.location.href = 'http://192.168.1.241/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2F192.168.1.241%3A8080%2F%23'+this.redirect;
|
||||||
if (isTs) {
|
// window.location.href = 'http://localhost:8099/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2Flocalhost%3A9528%2F%23'+this.redirect;
|
||||||
debugger
|
|
||||||
|
|
||||||
window.location.href = 'http://192.168.1.241/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2F192.168.1.241%3A8080%2F%23%2Flogin';
|
}
|
||||||
//window.location.href = 'http://127.0.0.1/login?redirect=/lig/oauth2/oauth2/application&appid=330b4ecb60c9a6802b957fe1e5a5ecd3&url=http%3A%2F%2F127.0.0.1%3A9528%2F%23%2Flogin';
|
} else if (ticket != undefined && token == null) {
|
||||||
|
//请求登录
|
||||||
|
this.logincasapi();
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (ticket != undefined && token == null) {
|
|
||||||
//请求登录
|
|
||||||
this.logincasapi();
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user