Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
imac-vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
jinhui.wang
2022-01-07 11:20:22 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f57bcbbb6862ac10ff1556c28844537649a60b4b
f57bcbbb
1 parent
382feaca
弹框修正
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
src/utils/request.js
src/utils/request.js
View file @
f57bcbb
import
axios
from
'axios'
import
{
Message
}
from
'element-ui'
import
{
Message
,
MessageBox
}
from
'element-ui'
import
store
from
'@/store'
import
{
getToken
}
from
'@/utils/auth'
import
errorCode
from
'@/utils/errorCode'
...
...
@@ -11,8 +11,8 @@ const service = axios.create({
//baseURL: process.env.VUE_APP_BASE_API,
//baseURL: 'http://192.168.1.45:8080',
// baseURL: `http://47.103.140.98:9002`,
//
baseURL: 'https://imacuat.zmd.apac.fedex.com/IMAC2',
baseURL
:
'http://192.168.1.134:18080'
,
baseURL
:
'https://imacuat.zmd.apac.fedex.com/IMAC2'
,
//
baseURL: 'http://192.168.1.134:18080',
// 超时
timeout
:
30000
...
...
@@ -30,7 +30,7 @@ service.interceptors.request.use(config => {
for
(
const
propName
of
Object
.
keys
(
config
.
params
))
{
const
value
=
config
.
params
[
propName
];
var
part
=
encodeURIComponent
(
propName
)
+
"="
;
if
(
value
!==
null
&&
typeof
(
value
)
!==
"undefined"
)
{
if
(
value
!==
null
&&
typeof
(
value
)
!==
"undefined"
)
{
if
(
typeof
value
===
'object'
)
{
for
(
const
key
of
Object
.
keys
(
value
))
{
let
params
=
propName
+
'['
+
key
+
']'
;
...
...
@@ -59,11 +59,12 @@ service.interceptors.response.use(res => {
// 获取错误信息
const
msg
=
errorCode
[
code
]
||
res
.
data
.
msg
||
errorCode
[
'default'
]
if
(
code
===
301
)
{
this
.
$alert
(
'登录状态已过期,您可以继续留在该页面,或者重新登录'
,
'系统提示'
,
{
MessageBox
.
confirm
(
'登录状态已过期,您可以继续留在该页面,或者重新登录'
,
'系统提示'
,
{
confirmButtonText
:
'重新登录'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}).
then
(()
=>
{
type
:
'warning'
}
).
then
(()
=>
{
store
.
dispatch
(
'FedLogOut'
).
then
(()
=>
{
location
.
href
=
'/index'
;
})
...
...
Please
register
or
login
to post a comment