Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
HireTest
VueElementTemplate
Commits
39d4a04e
Commit
39d4a04e
authored
8 years ago
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change token key-name
parent
b3579ded
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
user.js
src/store/modules/user.js
+5
-5
No files found.
src/store/modules/user.js
View file @
39d4a04e
...
@@ -9,7 +9,7 @@ const user = {
...
@@ -9,7 +9,7 @@ const user = {
code
:
''
,
code
:
''
,
uid
:
undefined
,
uid
:
undefined
,
auth_type
:
''
,
auth_type
:
''
,
token
:
Cookies
.
get
(
'
X-Ivanka
-Token'
),
token
:
Cookies
.
get
(
'
Admin
-Token'
),
name
:
''
,
name
:
''
,
avatar
:
''
,
avatar
:
''
,
introduction
:
''
,
introduction
:
''
,
...
@@ -68,7 +68,7 @@ const user = {
...
@@ -68,7 +68,7 @@ const user = {
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
loginByEmail
(
email
,
userInfo
.
password
).
then
(
response
=>
{
loginByEmail
(
email
,
userInfo
.
password
).
then
(
response
=>
{
const
data
=
response
.
data
;
const
data
=
response
.
data
;
Cookies
.
set
(
'
X-Ivanka
-Token'
,
response
.
data
.
token
);
Cookies
.
set
(
'
Admin
-Token'
,
response
.
data
.
token
);
commit
(
'SET_TOKEN'
,
data
.
token
);
commit
(
'SET_TOKEN'
,
data
.
token
);
commit
(
'SET_EMAIL'
,
email
);
commit
(
'SET_EMAIL'
,
email
);
resolve
();
resolve
();
...
@@ -102,7 +102,7 @@ const user = {
...
@@ -102,7 +102,7 @@ const user = {
commit
(
'SET_CODE'
,
code
);
commit
(
'SET_CODE'
,
code
);
loginByThirdparty
(
state
.
status
,
state
.
email
,
state
.
code
,
state
.
auth_type
).
then
(
response
=>
{
loginByThirdparty
(
state
.
status
,
state
.
email
,
state
.
code
,
state
.
auth_type
).
then
(
response
=>
{
commit
(
'SET_TOKEN'
,
response
.
data
.
token
);
commit
(
'SET_TOKEN'
,
response
.
data
.
token
);
Cookies
.
set
(
'
X-Ivanka
-Token'
,
response
.
data
.
token
);
Cookies
.
set
(
'
Admin
-Token'
,
response
.
data
.
token
);
resolve
();
resolve
();
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
reject
(
error
);
reject
(
error
);
...
@@ -117,7 +117,7 @@ const user = {
...
@@ -117,7 +117,7 @@ const user = {
logout
(
state
.
token
).
then
(()
=>
{
logout
(
state
.
token
).
then
(()
=>
{
commit
(
'SET_TOKEN'
,
''
);
commit
(
'SET_TOKEN'
,
''
);
commit
(
'SET_ROLES'
,
[]);
commit
(
'SET_ROLES'
,
[]);
Cookies
.
remove
(
'
X-Ivanka
-Token'
);
Cookies
.
remove
(
'
Admin
-Token'
);
resolve
();
resolve
();
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
reject
(
error
);
reject
(
error
);
...
@@ -129,7 +129,7 @@ const user = {
...
@@ -129,7 +129,7 @@ const user = {
FedLogOut
({
commit
})
{
FedLogOut
({
commit
})
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
commit
(
'SET_TOKEN'
,
''
);
commit
(
'SET_TOKEN'
,
''
);
Cookies
.
remove
(
'
X-Ivanka
-Token'
);
Cookies
.
remove
(
'
Admin
-Token'
);
resolve
();
resolve
();
});
});
}
}
...
...
This diff is collapsed.
Click to expand it.
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