Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
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
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
bp
op-web-service
Commits
1cf4da6f
Commit
1cf4da6f
authored
Aug 11, 2021
by
liwenhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 简网刷新重定向登录+认证head样式
parent
82c4ebeb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
10 deletions
+18
-10
App.vue
src/App.vue
+5
-3
index.vue
src/components/PageHeader/index.vue
+11
-5
role-detail.vue
src/pages/Role/role-detail.vue
+1
-1
user.js
src/service/user.js
+1
-1
No files found.
src/App.vue
View file @
1cf4da6f
...
...
@@ -19,11 +19,13 @@ export default {
if
(
this
.
$store
.
state
.
permissions
&&
this
.
$store
.
state
.
userInfo
)
return
;
if
(
!
getCookie
(
'username'
))
{
this
.
$message
(
'请先登录'
);
redirectToLogin
();
re
turn
re
directToLogin
();
}
const
{
status
,
user
}
=
await
fetchCurrentUser
();
// let isDefault = window.localStorage.getItem('isDefault');
// if (isDefault == 2) return;
console
.
log
(
'status'
,
status
)
console
.
log
(
'user'
,
user
)
if
(
status
===
"success"
)
{
this
.
$store
.
commit
(
"updateUserInfo"
,
user
);
this
.
$store
.
dispatch
(
"updateUserPermission"
,
{
email
:
user
.
email
});
...
...
@@ -32,8 +34,8 @@ export default {
appId
:
"merchant-op-auditing"
,
});
}
else
{
redirectToLogin
();
}
re
turn
re
directToLogin
();
}
},
computed
:
{
...
...
src/components/PageHeader/index.vue
View file @
1cf4da6f
...
...
@@ -6,7 +6,7 @@
text-color=
"#fff"
:default-active=
"activeMenu"
active-text-color=
"#ffd04b"
mode=
"
vertic
al"
mode=
"
horizont
al"
>
<el-menu-item
v-for=
"item in menuItemsWithAuth"
...
...
@@ -16,7 +16,7 @@
{{
item
.
name
}}
</el-menu-item>
<el-menu-item
key=
"usermenu"
class=
"user-menu"
>
<user></user>
<user
@
logout=
"handleLogout"
></user>
</el-menu-item>
</el-menu>
</div>
...
...
@@ -25,7 +25,8 @@
<
script
>
import
{
HEADER_CONFIG
}
from
"@/config/pageconfig"
;
import
User
from
'./User.vue'
;
import
{
createNamespacedHelpers
}
from
'vuex'
const
{
mapActions
}
=
createNamespacedHelpers
(
'login'
)
const
{
menuItems
}
=
HEADER_CONFIG
;
export
default
{
...
...
@@ -50,7 +51,12 @@ export default {
},
beforeMount
()
{
},
methods
:
{},
methods
:
{
...
mapActions
([
'logout'
]),
handleLogout
()
{
this
.
logout
()
},
},
};
</
script
>
...
...
@@ -60,7 +66,7 @@ export default {
line-height: 60px;
width: 100%;
}
.
header-menu .
user-menu {
.user-menu {
float: right !important;
margin-right: 20px;
}
...
...
src/pages/Role/role-detail.vue
View file @
1cf4da6f
<
template
>
<RoleDetail
appId=
"merchant-op"
/>
<RoleDetail
/>
</
template
>
<
script
>
import
RoleDetail
from
"@/components/Roles/RoleDetail"
;
...
...
src/service/user.js
View file @
1cf4da6f
...
...
@@ -14,7 +14,7 @@ export async function j_login (userInfo) {
export
async
function
fetchCurrentUser
()
{
let
isDefault
=
window
.
localStorage
.
getItem
(
'isDefault'
);
let
username
=
getCookie
(
'username'
)
if
(
isDefault
==
2
)
return
{
user
:
{
email
:
username
,
status
:
'success'
}
};
if
(
isDefault
==
2
)
return
{
user
:
{
email
:
username
},
status
:
'success'
};
return
await
axios
.
get
(
"/api/v1/fetch_user"
);
}
...
...
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