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
0fe23e05
Commit
0fe23e05
authored
Aug 22, 2019
by
FE-安焕焕
👣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改文件上传和登录失效问题
parent
24d57ab9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
update.vue
src/page/login/update.vue
+1
-1
upload.vue
src/page/upload/upload.vue
+17
-5
ajax.js
src/service/ajax.js
+2
-3
http.service.js
src/service/http.service.js
+1
-1
No files found.
src/page/login/update.vue
View file @
0fe23e05
...
@@ -134,9 +134,9 @@ export default {
...
@@ -134,9 +134,9 @@ export default {
}
}
updatePsd
(
params
).
then
(
res
=>
{
updatePsd
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
success
==
true
){
if
(
res
.
data
.
success
==
true
){
console
.
log
(
1234444
)
this
.
ISIDMIN
=
res
.
data
.
body
this
.
ISIDMIN
=
res
.
data
.
body
localStorage
.
setItem
(
'
isADMIN
'
,
JSON
.
stringify
(
this
.
ISIDMIN
))
localStorage
.
setItem
(
'
isADMIN
'
,
JSON
.
stringify
(
this
.
ISIDMIN
))
localStorage
.
setItem
(
'
token
'
,
res
.
data
.
body
.
token
)
this
.
$router
.
replace
({
name
:
'
allResume
'
})
this
.
$router
.
replace
({
name
:
'
allResume
'
})
}
}
if
(
res
.
data
.
body
.
code
=
'
101
'
){
if
(
res
.
data
.
body
.
code
=
'
101
'
){
...
...
src/page/upload/upload.vue
View file @
0fe23e05
...
@@ -246,7 +246,7 @@ import ajax from '../../service/ajax'
...
@@ -246,7 +246,7 @@ import ajax from '../../service/ajax'
type
:
file
.
type
,
type
:
file
.
type
,
size
:
file
.
size
,
size
:
file
.
size
,
title
:
null
,
title
:
null
,
status
:
"
normal
"
status
:
"
active
"
}
}
this
.
dataList
.
push
(
temp
)
this
.
dataList
.
push
(
temp
)
this
.
fileName
+=
files
[
key
].
name
+
'
;
'
this
.
fileName
+=
files
[
key
].
name
+
'
;
'
...
@@ -262,7 +262,7 @@ import ajax from '../../service/ajax'
...
@@ -262,7 +262,7 @@ import ajax from '../../service/ajax'
this
.
$Notice
.
error
({
this
.
$Notice
.
error
({
title
:
'
提示
'
,
title
:
'
提示
'
,
desc
:
'
请您选择文件在上传
'
,
desc
:
'
请您选择文件在上传
'
,
duration
:
'
2
'
duration
:
2
});
});
return
return
}
}
...
@@ -270,7 +270,7 @@ import ajax from '../../service/ajax'
...
@@ -270,7 +270,7 @@ import ajax from '../../service/ajax'
this
.
$Notice
.
error
({
this
.
$Notice
.
error
({
title
:
'
提示
'
,
title
:
'
提示
'
,
desc
:
'
批量上传文件不能大于20份
'
,
desc
:
'
批量上传文件不能大于20份
'
,
duration
:
'
2
'
duration
:
2
});
});
this
.
$refs
.
input
.
value
=
''
this
.
$refs
.
input
.
value
=
''
this
.
fileName
=
''
this
.
fileName
=
''
...
@@ -281,7 +281,7 @@ import ajax from '../../service/ajax'
...
@@ -281,7 +281,7 @@ import ajax from '../../service/ajax'
this
.
$Notice
.
error
({
this
.
$Notice
.
error
({
title
:
'
提示
'
,
title
:
'
提示
'
,
desc
:
'
单份文件不能大于2MB
'
,
desc
:
'
单份文件不能大于2MB
'
,
duration
:
'
2
'
duration
:
2
});
});
this
.
$refs
.
input
.
value
=
''
this
.
$refs
.
input
.
value
=
''
this
.
fileName
=
''
this
.
fileName
=
''
...
@@ -317,9 +317,21 @@ import ajax from '../../service/ajax'
...
@@ -317,9 +317,21 @@ import ajax from '../../service/ajax'
})
})
},
},
handleSuccess
(
res
,
files
)
{
handleSuccess
(
res
,
files
)
{
let
data
=
res
.
body
let
data
=
res
.
body
for
(
let
key
in
data
){
for
(
let
key
in
data
){
let
code
=
data
[
key
].
code
let
code
=
data
[
key
].
code
if
(
code
==
'
900
'
)
{
this
.
$Notice
.
error
({
render
:(
h
)
=>
{
return
h
(
'
div
'
,
{
style
:
{
paddingRight
:
'
10px
'
,
fontSize
:
'
14px
'
,
color
:
'
#17233d
'
}},
'
您的账号已在其他地方登录,如不是您个人操作,请及时修改密码
'
)}})
this
.
$router
.
replace
({
name
:
'
login
'
})
}
if
(
code
==
'
902
'
)
{
Notice
.
error
({
title
:
'
cookie已失效,请重新登录
'
})
this
.
$router
.
replace
({
name
:
'
login
'
})
}
this
.
Code
=
data
[
key
].
code
this
.
Code
=
data
[
key
].
code
this
.
Massage
=
data
[
key
].
message
this
.
Massage
=
data
[
key
].
message
this
.
dataList
.
map
(
item
=>
{
this
.
dataList
.
map
(
item
=>
{
...
...
src/service/ajax.js
View file @
0fe23e05
...
@@ -63,8 +63,7 @@ export default function upload(option) {
...
@@ -63,8 +63,7 @@ export default function upload(option) {
};
};
xhr
.
open
(
'
post
'
,
action
,
true
);
xhr
.
open
(
'
post
'
,
action
,
true
);
if
(
'
withCredentials
'
in
xhr
)
{
if
(
option
.
withCredentials
&&
'
withCredentials
'
in
xhr
)
{
xhr
.
withCredentials
=
true
;
xhr
.
withCredentials
=
true
;
}
}
...
@@ -73,7 +72,7 @@ export default function upload(option) {
...
@@ -73,7 +72,7 @@ export default function upload(option) {
if
(
headers
[
'
X-Requested-With
'
]
!==
null
)
{
if
(
headers
[
'
X-Requested-With
'
]
!==
null
)
{
xhr
.
setRequestHeader
(
'
X-Requested-With
'
,
'
XMLHttpRequest
'
);
xhr
.
setRequestHeader
(
'
X-Requested-With
'
,
'
XMLHttpRequest
'
);
}
}
for
(
let
item
in
headers
)
{
for
(
let
item
in
headers
)
{
if
(
headers
.
hasOwnProperty
(
item
)
&&
headers
[
item
]
!==
null
)
{
if
(
headers
.
hasOwnProperty
(
item
)
&&
headers
[
item
]
!==
null
)
{
xhr
.
setRequestHeader
(
item
,
headers
[
item
]);
xhr
.
setRequestHeader
(
item
,
headers
[
item
]);
...
...
src/service/http.service.js
View file @
0fe23e05
...
@@ -32,7 +32,7 @@ instance.interceptors.response.use(function (response) {
...
@@ -32,7 +32,7 @@ instance.interceptors.response.use(function (response) {
}},
'
您的账号已在其他地方登录,如不是您个人操作,请及时修改密码
'
)}})
}},
'
您的账号已在其他地方登录,如不是您个人操作,请及时修改密码
'
)}})
router
.
replace
({
name
:
'
login
'
})
router
.
replace
({
name
:
'
login
'
})
}
}
if
(
response
.
data
.
body
.
code
==
'
90
1
'
){
if
(
response
.
data
.
body
.
code
==
'
90
2
'
){
Notice
.
error
({
title
:
'
cookie已失效,请重新登录
'
})
Notice
.
error
({
title
:
'
cookie已失效,请重新登录
'
})
router
.
replace
({
name
:
'
login
'
})
router
.
replace
({
name
:
'
login
'
})
}
}
...
...
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