Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vipSupplier
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王淑敏
vipSupplier
Commits
0d2481de
Commit
0d2481de
authored
5 years ago
by
初志鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将token默认存储位置由sessionStorage移至localStorage
parent
dea6010b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
src/api/user.js
+1
-1
src/config/permission.js
+1
-1
src/config/settings.js
+1
-1
src/store/modules/user.js
+3
-3
No files found.
src/api/user.js
View file @
0d2481de
...
...
@@ -13,7 +13,7 @@ export async function login(data) {
});
}
export
function
getInfo
(
accessToken
)
{
export
function
get
User
Info
(
accessToken
)
{
return
request
({
url
:
"/userInfo"
,
method
:
"post"
,
...
...
This diff is collapsed.
Click to expand it.
src/config/permission.js
View file @
0d2481de
...
...
@@ -45,7 +45,7 @@ router.beforeResolve(async (to, from, next) => {
store
.
dispatch
(
"user/setPermissions"
,
[
"admin"
]);
permissions
=
[
"admin"
];
}
else
{
permissions
=
await
store
.
dispatch
(
"user/getInfo"
);
permissions
=
await
store
.
dispatch
(
"user/get
User
Info"
);
}
let
accessRoutes
=
[];
...
...
This diff is collapsed.
Click to expand it.
src/config/settings.js
View file @
0d2481de
...
...
@@ -47,7 +47,7 @@ module.exports = {
//token在localStorage、sessionStorage、cookie存储的key的名称
tokenTableName
:
"vue-admin-beautiful"
,
//token存储位置localStorage sessionStorage cookie
storage
:
"
session
Storage"
,
storage
:
"
local
Storage"
,
//token失效回退到登录页时是否记录本次的路由
recordRoute
:
true
,
//是否显示logo,不显示时设置false,显示时请填写remixIcon图标名称,暂时只支持设置remixIcon
...
...
This diff is collapsed.
Click to expand it.
src/store/modules/user.js
View file @
0d2481de
...
...
@@ -4,7 +4,7 @@
*/
import
Vue
from
"vue"
;
import
{
getInfo
,
login
,
logout
}
from
"@/api/user"
;
import
{
get
User
Info
,
login
,
logout
}
from
"@/api/user"
;
import
{
getAccessToken
,
removeAccessToken
,
...
...
@@ -68,8 +68,8 @@ const actions = {
);
}
},
async
getInfo
({
commit
,
state
})
{
const
{
data
}
=
await
getInfo
(
state
.
accessToken
);
async
get
User
Info
({
commit
,
state
})
{
const
{
data
}
=
await
get
User
Info
(
state
.
accessToken
);
if
(
!
data
)
{
Vue
.
prototype
.
$baseMessage
(
"验证失败,请重新登录..."
,
"error"
);
return
false
;
...
...
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