Commit 6715887e by caoyanzhi

update: 登录页加GIC域名

parent af0f0ac8
...@@ -19,6 +19,8 @@ Vue.axios.defaults.headers.common['platform'] = 'haoban'; ...@@ -19,6 +19,8 @@ Vue.axios.defaults.headers.common['platform'] = 'haoban';
Vue.axios.defaults.timeout = 500000; Vue.axios.defaults.timeout = 500000;
let local = window.location.origin; let local = window.location.origin;
const userInfos = JSON.parse(sessionStorage.getItem('userInfos') || '{}');
const gicHost = typeof userInfos.gicHost == 'string' ? userInfos.gicHost.replace(/\/$/, '') : '';
// let local = process.env.NODE_ENV == 'development' ? 'https://www.gicdev.com' : ''; // let local = process.env.NODE_ENV == 'development' ? 'https://www.gicdev.com' : '';
...@@ -66,11 +68,11 @@ Vue.axios.interceptors.response.use( ...@@ -66,11 +68,11 @@ Vue.axios.interceptors.response.use(
if (window.location.href.indexOf('gic-error') != -1) { if (window.location.href.indexOf('gic-error') != -1) {
return false; return false;
} }
window.location.href = local + '/gic-web/#/login?ishb=1'; window.location.href = gicHost + '/gic-web/#/login?ishb=1';
} }
if (data.data.errorCode == 10 || data.data.errorCode == 7) { if (data.data.errorCode == 10 || data.data.errorCode == 7) {
window.location.href = local + '/haoban-3/#/index'; window.location.href = gicHost + '/haoban-3/#/index';
} }
return data; return data;
} }
...@@ -78,11 +80,11 @@ Vue.axios.interceptors.response.use( ...@@ -78,11 +80,11 @@ Vue.axios.interceptors.response.use(
}, },
err => { err => {
if (err.response.status == 502) { if (err.response.status == 502) {
window.location.href = local + '/gic-web/#/login?ishb=1'; window.location.href = gicHost + '/gic-web/#/login?ishb=1';
Message.error({ message: '服务异常⊙﹏⊙∥' }); Message.error({ message: '服务异常⊙﹏⊙∥' });
} }
if (err.response.status != 403) { if (err.response.status != 403) {
window.location.href = local + '/gic-web/#/login?ishb=1'; window.location.href = gicHost + '/gic-web/#/login?ishb=1';
Message.error({ message: '登录失效!' }); Message.error({ message: '登录失效!' });
} }
return Promise.resolve(err); return Promise.resolve(err);
......
...@@ -8,21 +8,19 @@ ...@@ -8,21 +8,19 @@
*/ */
/* 后台返回消息提示 */ /* 后台返回消息提示 */
import { Message } from 'element-ui'; import { Message } from 'element-ui';
const userInfos = JSON.parse(sessionStorage.getItem('userInfos') || '{}');
const gicHost = typeof userInfos.gicHost == 'string' ? userInfos.gicHost.replace(/\/$/, '') : '';
// 后台返回异常提示 // 后台返回异常提示
export default { export default {
errorMsg: function(response) { errorMsg: function(response) {
let local = window.location.origin;
/* if (local.indexOf('localhost') != -1) {
local = 'http://www.gicdev.com';
} */
if (response.errorCode != 1) { if (response.errorCode != 1) {
if (response.errorCode == 4) { if (response.errorCode == 4) {
window.location.href = local + '/gic-web/#/login?ishb=1'; window.location.href = gicHost + '/gic-web/#/login?ishb=1';
return false; return false;
} }
if (response.errorCode == 10) { if (response.errorCode == 10) {
window.location.href = local + '/haoban-3/#/index'; window.location.href = gicHost + '/haoban-3/#/index';
return false; return false;
} }
Message.error({ Message.error({
......
...@@ -58,7 +58,9 @@ export default { ...@@ -58,7 +58,9 @@ export default {
return; return;
} }
this.$message.success('退出成功'); this.$message.success('退出成功');
window.location.href = location.origin + '/gic-web/#/login?ishb=1'; const userInfos = JSON.parse(sessionStorage.getItem('userInfos') || '{}');
const gicHost = typeof userInfos.gicHost == 'string' ? userInfos.gicHost.replace(/\/$/, '') : '';
window.location.href = gicHost + '/gic-web/#/login?ishb=1';
}) })
.finally(() => this.$emit('showLoading', false)); .finally(() => this.$emit('showLoading', false));
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="bullshit"> <div class="bullshit">
<!-- <div class="bullshit__oops">404</div> --> <!-- <div class="bullshit__oops">404</div> -->
<div class="bullshit__headline">{{ message }}</div> <div class="bullshit__headline">{{ message }}</div>
<a href="/gic-web/#/login?ishb=1" class="bullshit__return-home" rel="noopener noreferrer">返回好办登录页</a> <a :href="gicHost + '/gic-web/#/login?ishb=1'" class="bullshit__return-home" rel="noopener noreferrer">返回好办登录页</a>
</div> </div>
</div> </div>
</div> </div>
...@@ -29,7 +29,8 @@ export default { ...@@ -29,7 +29,8 @@ export default {
inject: ['layoutVm'], inject: ['layoutVm'],
data() { data() {
return { return {
img_404 img_404,
gicHost: ''
}; };
}, },
computed: { computed: {
...@@ -43,6 +44,8 @@ export default { ...@@ -43,6 +44,8 @@ export default {
/* eslint-disable */ /* eslint-disable */
mounted() { mounted() {
this.layoutVm.$emit('command', 'hideAside'); this.layoutVm.$emit('command', 'hideAside');
const userInfos = JSON.parse(sessionStorage.getItem('userInfos') || '{}');
this.gicHost = typeof userInfos.gicHost == 'string' ? userInfos.gicHost.replace(/\/$/, '') : '';
} }
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment