Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
recruiting-management
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
recruiting-management
Commits
720d4b54
Commit
720d4b54
authored
Aug 22, 2019
by
zhangderong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'deploy' of git.quantgroup.cn:ui/recruiting-management into Ztext1
Conflicts: src/service/init.service.js
parents
b3e356e9
bf39373b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
prod.config.js
src/config/prod.config.js
+0
-2
http.service.js
src/service/http.service.js
+13
-9
init.service.js
src/service/init.service.js
+6
-2
No files found.
src/config/prod.config.js
View file @
720d4b54
// todo: 测试环境部署的时候对xyqb.com进行替换,先改成这样进行测试,上线改回来
// const sapi = '//recruit.xyqb.com'
const
sapi
=
'
//api.stantoo.com
'
const
sapi
=
'
//api.stantoo.com
'
export
{
export
{
...
...
src/service/http.service.js
View file @
720d4b54
...
@@ -2,6 +2,7 @@ import axios from 'axios'
...
@@ -2,6 +2,7 @@ import axios from 'axios'
import
Promise
from
'
./promise.service.js
'
import
Promise
from
'
./promise.service.js
'
import
{
Notice
}
from
'
iview
'
import
{
Notice
}
from
'
iview
'
import
Vue
from
'
vue
'
import
Vue
from
'
vue
'
import
router
from
'
../router/index.js
'
// axios.defaults.withCredentials = true
// axios.defaults.withCredentials = true
var
instance
=
axios
.
create
({});
var
instance
=
axios
.
create
({});
instance
.
defaults
.
timeout
=
2500
;
instance
.
defaults
.
timeout
=
2500
;
...
@@ -9,7 +10,6 @@ instance.defaults.withCredentials = true;
...
@@ -9,7 +10,6 @@ instance.defaults.withCredentials = true;
instance
.
defaults
.
headers
.
post
[
'
Content-Type
'
]
=
'
application/x-www-form-urlencoded
'
;
instance
.
defaults
.
headers
.
post
[
'
Content-Type
'
]
=
'
application/x-www-form-urlencoded
'
;
instance
.
defaults
.
headers
[
'
X-Requested-With
'
]
=
'
XMLHttpRequest
'
instance
.
defaults
.
headers
[
'
X-Requested-With
'
]
=
'
XMLHttpRequest
'
instance
.
interceptors
.
request
.
use
(
function
(
config
)
{
instance
.
interceptors
.
request
.
use
(
function
(
config
)
{
// 在发送请求之前做些什么
// 在发送请求之前做些什么
if
(
!
config
.
headers
[
'
Content-Type
'
])
{
if
(
!
config
.
headers
[
'
Content-Type
'
])
{
...
@@ -24,14 +24,18 @@ instance.interceptors.response.use(function (response) {
...
@@ -24,14 +24,18 @@ instance.interceptors.response.use(function (response) {
// 在发送请求之前做些什么
// 在发送请求之前做些什么
if
(
response
.
status
>=
200
&&
response
.
status
<
300
){
if
(
response
.
status
>=
200
&&
response
.
status
<
300
){
// if (response.data.body.code == '900'){
if
(
response
.
data
.
body
.
code
==
'
900
'
){
// Notice.error('您的账号已在其他地方登录,如不是您个人操作,请及时修改密码')
Notice
.
error
({
render
:(
h
)
=>
{
return
h
(
'
div
'
,
{
style
:
{
// window.location.href = `${window.location.origin}/login`
paddingRight
:
'
10px
'
,
// }
fontSize
:
'
14px
'
,
// if (response.data.body.code == '901'){
color
:
'
#17233d
'
// Notice.error('cookie已失效,请重新登录')
}},
'
您的账号已在其他地方登录,如不是您个人操作,请及时修改密码
'
)}})
// window.location.href = `${window.location.origin}/login`
router
.
replace
({
name
:
'
login
'
})
// }
}
if
(
response
.
data
.
body
.
code
==
'
901
'
){
Notice
.
error
({
title
:
'
cookie已失效,请重新登录
'
})
router
.
replace
({
name
:
'
login
'
})
}
if
(
response
.
data
.
success
){
if
(
response
.
data
.
success
){
return
Promise
.
resolve
(
response
)
return
Promise
.
resolve
(
response
)
}
}
...
...
src/service/init.service.js
View file @
720d4b54
...
@@ -3,10 +3,14 @@ export default{
...
@@ -3,10 +3,14 @@ export default{
init
:
function
(
router
)
{
init
:
function
(
router
)
{
router
.
beforeEach
((
to
,
form
,
next
)
=>
{
router
.
beforeEach
((
to
,
form
,
next
)
=>
{
let
token
=
localstorage
.
get
(
'
token
'
)
let
token
=
localstorage
.
get
(
'
token
'
)
if
(
!
token
&&
to
.
name
!==
'
login
'
&&
to
.
name
!==
'
updatepsd
'
&&
to
.
name
!==
'
sweepCode
'
)
{
if
(
to
.
name
==
'
login
'
||
to
.
name
==
'
text
'
||
to
.
name
==
'
sweepCode
'
){
next
()
return
}
if
(
!
token
){
window
.
location
.
href
=
`
${
window
.
location
.
origin
}
/login`
window
.
location
.
href
=
`
${
window
.
location
.
origin
}
/login`
return
return
}
}
next
()
next
()
})
})
}
}
...
...
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