Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
fc5c20ad
authored
2025-11-26 17:40:13 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
根据角色获取菜单接口联调
1 parent
104e9a2d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
21 deletions
src/api/modules/queryService.ts
src/store/modules/user.ts
src/views/[...all].vue
src/views/data_smart_contract/smartContractCreate.vue
src/views/homeIndex.vue
src/api/modules/queryService.ts
View file @
fc5c20a
...
...
@@ -35,7 +35,7 @@ export const getSystemMenu = (params, isAdmin = false) => {
}
/product-menu-permission/
tenant
/
get
-
product
-
menu
?
tenantGuid
=
$
{
params
.
tenantGuid
}
&
platformSystemGuid
=
28
c1bc94919d410a85d6d4ce6cbb702f
`
: `
$
{
import
.
meta
.
env
.
VITE_APP_AUTH_URL
}
/product-menu-permission/
staff
/
get
-
product
-
menu
-
template
?
platformSystemGuid
=
28
c1bc94919d410a85d6d4ce6cbb702f
`,
}
/product-menu-permission/
staff
/
get
-
product
-
menu
-
template
?
platformSystemGuid
=
28
c1bc94919d410a85d6d4ce6cbb702f
&
funcPermissionTemplateGuid
=
$
{
params
.
roleGuid
}
`,
method: "get",
});
};
...
...
src/store/modules/user.ts
View file @
fc5c20a
...
...
@@ -103,19 +103,20 @@ const useUserStore = defineStore(
let
data
=
localStorage
.
getItem
(
'userData'
);
let
userData
=
data
&&
JSON
.
parse
(
data
);
return
getSystemMenu
(
{
tenantGuid
:
localStorage
.
getItem
(
'currentTenantGuid'
)
}
,
userData
?.
isAdmin
==
"Y"
&&
(
!
userData
?.
superTubeFlag
||
userData
?.
superTubeFlag
==
"Y"
)
{
tenantGuid
:
localStorage
.
getItem
(
'currentTenantGuid'
),
roleGuid
:
role
==
'use'
?
'33cc6290689249a28004b591a2daac25'
:
(
role
==
'provider'
?
'0ad4985055fa4007aca9e2782ccd23d2'
:
''
)
},
false
// role != 'operation' ? false : (userData?.isAdmin == "Y" && (!userData?.superTubeFlag || userData?.superTubeFlag == "Y")
)
).
then
((
info
:
any
)
=>
{
//解决页面调用流程接口传递staffGuid,为空的问题
if
(
info
.
code
==
"00000"
)
{
localStorage
.
setItem
(
"userInfoData"
,
JSON
.
stringify
(
info
.
data
));
userInfoData
.
value
=
info
.
data
;
// window.location.href = location.origin + info.data[0].menuList[0].path
return
true
;
return
info
.
data
||
[]
;
}
else
{
ElMessage
.
error
(
info
.
msg
);
return
false
;
}
});
}
...
...
src/views/[...all].vue
View file @
fc5c20a
...
...
@@ -22,7 +22,7 @@ const dialogVisible = computed(() => {
const
loading
=
ref
(
false
);
/** 记录用户选择的角色 */
const
selectRole
=
ref
(
'use'
);
const
selectRole
=
ref
(
'use'
);
//TODO,在专区需要默认值是平台运营方。
onBeforeRouteLeave
(()
=>
{
})
...
...
@@ -35,22 +35,39 @@ function goBack() {
}
const
beforeLogin
=
()
=>
{
loading
.
value
=
true
;
if
(
userStore
.
getTokenPromise
)
{
userStore
.
getTokenPromise
.
then
(()
=>
{
userStore
.
getUserSystemMenuByRole
(
selectRole
.
value
).
then
((
res
)
=>
{
if
(
res
===
true
)
{
userStore
.
isGetCurrUserInfo
=
false
;
loading
.
value
=
false
;
if
(
res
&&
res
!==
false
)
{
if
(
res
?.
length
===
0
)
{
ElMessage
.
warning
(
'该系统用户暂无可用的菜单,请先配置'
);
return
;
}
localStorage
.
setItem
(
'userRole'
,
selectRole
.
value
);
userStore
.
isGetCurrUserInfo
=
false
;
router
.
push
(
'/'
)
}
})
}).
catch
(()
=>
{
loading
.
value
=
false
;
});
}
else
{
userStore
.
getUserSystemMenuByRole
(
selectRole
.
value
).
then
((
res
)
=>
{
if
(
res
===
true
)
{
userStore
.
isGetCurrUserInfo
=
false
;
loading
.
value
=
false
;
if
(
res
&&
res
!==
false
)
{
if
(
res
?.
length
===
0
)
{
ElMessage
.
warning
(
'该系统用户暂无可用的菜单,请先配置'
);
return
;
}
localStorage
.
setItem
(
'userRole'
,
selectRole
.
value
);
userStore
.
isGetCurrUserInfo
=
false
;
router
.
push
(
'/'
)
})
}
}).
catch
(()
=>
{
loading
.
value
=
false
;
});
}
}
...
...
@@ -74,10 +91,11 @@ const beforeLogin = () => {
<div
class=
"img-provider"
></div>
<div
class=
"title"
>
数据提供方
</div>
</div>
<div
class=
"per"
:class=
"selectRole == 'operation' ? 'selected' : ''"
@
click=
"selectRole = 'operation'"
>
<!-- 只有专区才有 -->
<!--
<div
class=
"per"
:class=
"selectRole == 'operation' ? 'selected' : ''"
@
click=
"selectRole = 'operation'"
>
<div
class=
"img-operation"
></div>
<div
class=
"title"
>
平台运营方
</div>
</div>
</div>
-->
</div>
<div
class=
"login-footer"
>
<el-button
:loading=
"loading"
ref=
"loginButton"
type=
"primary"
size=
"large"
style=
"width: 100%;"
...
...
src/views/data_smart_contract/smartContractCreate.vue
View file @
fc5c20a
...
...
@@ -220,14 +220,16 @@ const addExtend = () => {
/** ----------------- 数据产品表格相关信息 ----------------------------- */
const
productTableRef
=
ref
();
const
productData
:
any
=
ref
([]);
const
productData
:
any
=
ref
([
{
dataProductId
:
''
}
]);
const
productList
:
any
=
ref
([]);
/** 基本信息的入参定义表格配置 */
const
productTableInfo
=
ref
({
id
:
"input-product-table"
,
height
:
'214px'
,
height
:
'75px'
,
minHeight
:
'60px'
,
minPanelHeight
:
'60px'
,
fields
:
[
{
label
:
"序号"
,
type
:
"index"
,
width
:
TableColumnWidth
.
INDEX
,
align
:
"center"
},
{
label
:
"数据产品"
,
field
:
"dataProductId"
,
width
:
180
,
required
:
true
,
columClass
:
'edit-colum'
,
type
:
'edit'
},
...
...
@@ -795,11 +797,10 @@ onActivated(() => {
</ContentWrap>
<ContentWrap
id=
"product-info"
title=
"合约标的"
expandSwicth
style=
"margin-top: 15px"
:isExpand=
"expandInfo"
@
expand=
"(v) => (expandInfo = v)"
description=
""
>
<Table
ref=
"productTableRef"
:tableInfo=
"productTableInfo"
class=
"fiveRow-table"
@
table-select-change=
"hanldeTableSelectChange"
/>
<div
class=
"row-add-btn"
>
<Table
ref=
"productTableRef"
:tableInfo=
"productTableInfo"
@
table-select-change=
"hanldeTableSelectChange"
/>
<!--
<div
class=
"row-add-btn"
>
<el-button
link
@
click=
"addProduct"
:icon=
"CirclePlus"
v-preReClick
>
添加产品
</el-button>
</div>
</div>
-->
</ContentWrap>
<ContentWrap
id=
"policy-info"
title=
"合约策略"
expandSwicth
style=
"margin-top: 15px"
:isExpand=
"expandPolicy"
@
expand=
"(v) => (expandPolicy = v)"
description=
""
>
...
...
src/views/homeIndex.vue
View file @
fc5c20a
...
...
@@ -2,7 +2,9 @@
const
router
=
useRouter
();
const
dataRole
=
ref
(
'operation'
);
const
dataRole
=
computed
(()
=>
{
return
localStorage
.
getItem
(
'userRole'
);
});
const
click
=
(
command
)
=>
{
let
url
=
''
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment