Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
haoban-3
Commits
6715887e
Commit
6715887e
authored
May 25, 2022
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 登录页加GIC域名
parent
af0f0ac8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
13 deletions
+18
-13
api.js
src/api/api.js
+6
-4
error.js
src/common/js/error.js
+4
-6
user-info.vue
src/components/layout/components/user-info.vue
+3
-1
gic-error.vue
src/views/errorPage/gic-error.vue
+5
-2
No files found.
src/api/api.js
View file @
6715887e
...
@@ -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
);
...
...
src/common/js/error.js
View file @
6715887e
...
@@ -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
({
...
...
src/components/layout/components/user-info.vue
View file @
6715887e
...
@@ -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
));
}
}
...
...
src/views/errorPage/gic-error.vue
View file @
6715887e
...
@@ -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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment