Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mocp-uniapp
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pangchong
mocp-uniapp
Commits
28d02d1c
Commit
28d02d1c
authored
Dec 27, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 权限相关开发收尾
parent
ed698dee
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
1 deletions
+11
-1
src/mocp/constants/menu.js
+2
-1
src/mocp/store/user.js
+4
-0
src/mocp/utils/permission.js
+3
-0
src/pages/modules/mocp/login/index.vue
+1
-0
src/pages/modules/mocp/panel/components/panel-menu.vue
+1
-0
No files found.
src/mocp/constants/menu.js
View file @
28d02d1c
...
...
@@ -40,7 +40,8 @@ export const menuList = ref([
group
:
'生产保障'
,
default
:
true
,
count
:
0
,
url
:
'/panel/supported-task/list'
url
:
'/panel/supported-task/list'
,
apiPath
:
'/workbench'
},
{
id
:
'sfd'
,
...
...
src/mocp/store/user.js
View file @
28d02d1c
...
...
@@ -17,7 +17,11 @@ const useUserStore = defineStore('mocpUser', {
getters
:
{
//获取操作权限相关
getApiPaths
(
state
)
{
if
(
state
.
seatPermission
.
includes
(
'all'
))
{
return
[
'all'
]
}
else
{
return
state
.
seatPermission
.
map
((
item
)
=>
item
.
apiPath
)
}
},
//获取数据权限相关
getCommonConfigData
(
state
)
{
...
...
src/mocp/utils/permission.js
View file @
28d02d1c
...
...
@@ -9,6 +9,9 @@ import useUserStore from 'mocp/store/user'
export
const
checkPermi
=
(
value
)
=>
{
const
userStore
=
useUserStore
()
if
(
value
)
{
if
(
userStore
.
getApiPaths
.
includes
(
'all'
))
{
return
true
}
if
(
Array
.
isArray
(
value
))
{
return
value
.
some
((
val
)
=>
userStore
.
getApiPaths
.
includes
(
val
))
}
else
{
...
...
src/pages/modules/mocp/login/index.vue
View file @
28d02d1c
...
...
@@ -75,6 +75,7 @@ const handleLogin = async () => {
})
loading
.
value
=
true
await
login
()
//加入席位权限
await
getUserSeatList
()
if
(
userStore
.
seatId
)
{
await
Promise
.
all
([
getSeatPermission
(),
getConfigData
()])
...
...
src/pages/modules/mocp/panel/components/panel-menu.vue
View file @
28d02d1c
...
...
@@ -28,6 +28,7 @@
</view>
</view>
</scroll-view>
<global-empty
v-if=
"!userStore.getHomeMenuList.length"
></global-empty>
</view>
</
template
>
...
...
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