Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
罗鑫霖
/
vion-tools
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ee70e377
authored
May 11, 2022
by
李君
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
配置调整
1 parent
2f3aea0e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
public/config.js
src/Request/PublicAxiosInstance.js
vue.config.js
public/config.js
View file @
ee70e37
window
.
_serverHost
=
[
'localhost'
,
'192.168.1.1
68
'
].
includes
(
window
.
location
.
hostname
)
?
'36.112.68.214:9999'
:
window
.
location
.
host
window
.
_serverHost
=
[
'localhost'
,
'192.168.1.1
74
'
].
includes
(
window
.
location
.
hostname
)
?
'36.112.68.214:9999'
:
window
.
location
.
host
window
.
_baseUrl
=
[
'localhost'
,
'192.168.1.1
68
'
].
includes
(
window
.
location
.
hostname
)
?
'http://36.112.68.214:9999/btool/'
:
`https://
${
window
.
_serverHost
}
/btool/`
window
.
_baseUrl
=
[
'localhost'
,
'192.168.1.1
74
'
].
includes
(
window
.
location
.
hostname
)
?
'http://36.112.68.214:9999/btool/'
:
`https://
${
window
.
_serverHost
}
/btool/`
window
.
_baseImgUrl
=
[
'localhost'
,
'192.168.1.1
68
'
].
includes
(
window
.
location
.
hostname
)
?
'http://36.112.68.214:9999/images/'
:
`
${
window
.
location
.
origin
}
/images/`
window
.
_baseImgUrl
=
[
'localhost'
,
'192.168.1.1
74
'
].
includes
(
window
.
location
.
hostname
)
?
'http://36.112.68.214:9999/images/'
:
`
${
window
.
location
.
origin
}
/images/`
window
.
_socketUrl
=
[
'localhost'
,
'192.168.1.1
68
'
].
includes
(
window
.
location
.
hostname
)
?
`wss://
${
window
.
_serverHost
}
/`
:
`wss://
${
window
.
_serverHost
}
/`
window
.
_socketUrl
=
[
'localhost'
,
'192.168.1.1
74
'
].
includes
(
window
.
location
.
hostname
)
?
`wss://
${
window
.
_serverHost
}
/`
:
`wss://
${
window
.
_serverHost
}
/`
const
log
=
console
.
log
.
bind
(
console
)
const
log
=
console
.
log
.
bind
(
console
)
src/Request/PublicAxiosInstance.js
View file @
ee70e37
...
@@ -13,6 +13,8 @@ const axiosInstance = axios.create(
...
@@ -13,6 +13,8 @@ const axiosInstance = axios.create(
// 请求拦截器
// 请求拦截器
axiosInstance
.
interceptors
.
request
.
use
(
axiosInstance
.
interceptors
.
request
.
use
(
config
=>
{
config
=>
{
// Cookies.set('atoken','90eeca8f-7d7e-4dfa-8d7b-468e033dd048')
config
.
headers
.
Authorization
=
Cookies
.
get
(
'atoken'
)
config
.
headers
.
Authorization
=
Cookies
.
get
(
'atoken'
)
return
config
return
config
...
@@ -28,7 +30,10 @@ axiosInstance.interceptors.response.use(
...
@@ -28,7 +30,10 @@ axiosInstance.interceptors.response.use(
message
:
`登录过期,请重新登录`
,
message
:
`登录过期,请重新登录`
,
type
:
'warning'
type
:
'warning'
})
})
// location.href=window.location.origin
// setTimeout(()=>{
// let url = ['localhost', '192.168.1.174'].includes(window.location.hostname) ? 'http://36.112.68.214:33333/' : window.location.origin
// window.location.href=url;
// },300)
return
return
}
}
return
responseData
return
responseData
...
...
vue.config.js
View file @
ee70e37
...
@@ -57,9 +57,9 @@ module.exports = {
...
@@ -57,9 +57,9 @@ module.exports = {
// 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
// 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
devServer
:
{
devServer
:
{
proxy
:
{
proxy
:
{
'/
malls
'
:
{
'/'
:
{
target
:
'http
s://store.keliuyun.com/report/malls
'
,
target
:
'http
://36.112.68.214:9999/btool/
'
,
//
changeOrigin: true
changeOrigin
:
true
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment