fc5c20ad by lihua

根据角色获取菜单接口联调

1 parent 104e9a2d
...@@ -35,7 +35,7 @@ export const getSystemMenu = (params, isAdmin = false) => { ...@@ -35,7 +35,7 @@ export const getSystemMenu = (params, isAdmin = false) => {
35 }/product-menu-permission/tenant/get-product-menu?tenantGuid=${params.tenantGuid}&platformSystemGuid=28c1bc94919d410a85d6d4ce6cbb702f` 35 }/product-menu-permission/tenant/get-product-menu?tenantGuid=${params.tenantGuid}&platformSystemGuid=28c1bc94919d410a85d6d4ce6cbb702f`
36 : `${ 36 : `${
37 import.meta.env.VITE_APP_AUTH_URL 37 import.meta.env.VITE_APP_AUTH_URL
38 }/product-menu-permission/staff/get-product-menu-template?platformSystemGuid=28c1bc94919d410a85d6d4ce6cbb702f`, 38 }/product-menu-permission/staff/get-product-menu-template?platformSystemGuid=28c1bc94919d410a85d6d4ce6cbb702f&funcPermissionTemplateGuid=${params.roleGuid}`,
39 method: "get", 39 method: "get",
40 }); 40 });
41 }; 41 };
......
...@@ -103,19 +103,20 @@ const useUserStore = defineStore( ...@@ -103,19 +103,20 @@ const useUserStore = defineStore(
103 let data = localStorage.getItem('userData'); 103 let data = localStorage.getItem('userData');
104 let userData = data && JSON.parse(data); 104 let userData = data && JSON.parse(data);
105 return getSystemMenu( 105 return getSystemMenu(
106 { tenantGuid: localStorage.getItem('currentTenantGuid') }, 106 { tenantGuid: localStorage.getItem('currentTenantGuid'),
107 userData?.isAdmin == "Y" && 107 roleGuid: role == 'use' ? '33cc6290689249a28004b591a2daac25' : (role == 'provider' ? '0ad4985055fa4007aca9e2782ccd23d2' : '')
108 (!userData?.superTubeFlag || 108 }, false
109 userData?.superTubeFlag == "Y") 109 // role != 'operation' ? false : (userData?.isAdmin == "Y" && (!userData?.superTubeFlag || userData?.superTubeFlag == "Y"))
110 ).then((info: any) => { 110 ).then((info: any) => {
111 //解决页面调用流程接口传递staffGuid,为空的问题 111 //解决页面调用流程接口传递staffGuid,为空的问题
112 if (info.code == "00000") { 112 if (info.code == "00000") {
113 localStorage.setItem("userInfoData", JSON.stringify(info.data)); 113 localStorage.setItem("userInfoData", JSON.stringify(info.data));
114 userInfoData.value = info.data; 114 userInfoData.value = info.data;
115 // window.location.href = location.origin + info.data[0].menuList[0].path 115 // window.location.href = location.origin + info.data[0].menuList[0].path
116 return true; 116 return info.data || [];
117 } else { 117 } else {
118 ElMessage.error(info.msg); 118 ElMessage.error(info.msg);
119 return false;
119 } 120 }
120 }); 121 });
121 } 122 }
......
...@@ -22,7 +22,7 @@ const dialogVisible = computed(() => { ...@@ -22,7 +22,7 @@ const dialogVisible = computed(() => {
22 const loading = ref(false); 22 const loading = ref(false);
23 23
24 /** 记录用户选择的角色 */ 24 /** 记录用户选择的角色 */
25 const selectRole = ref('use'); 25 const selectRole = ref('use'); //TODO,在专区需要默认值是平台运营方。
26 26
27 onBeforeRouteLeave(() => { 27 onBeforeRouteLeave(() => {
28 }) 28 })
...@@ -35,22 +35,39 @@ function goBack() { ...@@ -35,22 +35,39 @@ function goBack() {
35 } 35 }
36 36
37 const beforeLogin = () => { 37 const beforeLogin = () => {
38 loading.value = true;
38 if (userStore.getTokenPromise) { 39 if (userStore.getTokenPromise) {
39 userStore.getTokenPromise.then(() => { 40 userStore.getTokenPromise.then(() => {
40 userStore.getUserSystemMenuByRole(selectRole.value).then((res) => { 41 userStore.getUserSystemMenuByRole(selectRole.value).then((res) => {
41 if (res === true) { 42 loading.value = false;
42 userStore.isGetCurrUserInfo = false; 43 if (res && res !== false) {
44 if (res?.length === 0) {
45 ElMessage.warning('该系统用户暂无可用的菜单,请先配置');
46 return;
43 } 47 }
48 localStorage.setItem('userRole', selectRole.value);
49 userStore.isGetCurrUserInfo = false;
44 router.push('/') 50 router.push('/')
51 }
45 }) 52 })
53 }).catch(() => {
54 loading.value = false;
46 }); 55 });
47 } else { 56 } else {
48 userStore.getUserSystemMenuByRole(selectRole.value).then((res) => { 57 userStore.getUserSystemMenuByRole(selectRole.value).then((res) => {
49 if (res === true) { 58 loading.value = false;
50 userStore.isGetCurrUserInfo = false; 59 if (res && res !== false) {
60 if (res?.length === 0) {
61 ElMessage.warning('该系统用户暂无可用的菜单,请先配置');
62 return;
51 } 63 }
64 localStorage.setItem('userRole', selectRole.value);
65 userStore.isGetCurrUserInfo = false;
52 router.push('/') 66 router.push('/')
53 }) 67 }
68 }).catch(() => {
69 loading.value = false;
70 });
54 } 71 }
55 } 72 }
56 73
...@@ -74,10 +91,11 @@ const beforeLogin = () => { ...@@ -74,10 +91,11 @@ const beforeLogin = () => {
74 <div class="img-provider"></div> 91 <div class="img-provider"></div>
75 <div class="title">数据提供方</div> 92 <div class="title">数据提供方</div>
76 </div> 93 </div>
77 <div class="per" :class="selectRole == 'operation' ? 'selected' : ''" @click="selectRole = 'operation'"> 94 <!-- 只有专区才有 -->
95 <!-- <div class="per" :class="selectRole == 'operation' ? 'selected' : ''" @click="selectRole = 'operation'">
78 <div class="img-operation"></div> 96 <div class="img-operation"></div>
79 <div class="title">平台运营方</div> 97 <div class="title">平台运营方</div>
80 </div> 98 </div> -->
81 </div> 99 </div>
82 <div class="login-footer"> 100 <div class="login-footer">
83 <el-button :loading="loading" ref="loginButton" type="primary" size="large" style="width: 100%;" 101 <el-button :loading="loading" ref="loginButton" type="primary" size="large" style="width: 100%;"
......
...@@ -220,14 +220,16 @@ const addExtend = () => { ...@@ -220,14 +220,16 @@ const addExtend = () => {
220 220
221 /** ----------------- 数据产品表格相关信息 ----------------------------- */ 221 /** ----------------- 数据产品表格相关信息 ----------------------------- */
222 const productTableRef = ref(); 222 const productTableRef = ref();
223 const productData: any = ref([]); 223 const productData: any = ref([{ dataProductId: '' }]);
224 224
225 const productList: any = ref([]); 225 const productList: any = ref([]);
226 226
227 /** 基本信息的入参定义表格配置 */ 227 /** 基本信息的入参定义表格配置 */
228 const productTableInfo = ref({ 228 const productTableInfo = ref({
229 id: "input-product-table", 229 id: "input-product-table",
230 height: '214px', 230 height: '75px',
231 minHeight: '60px',
232 minPanelHeight: '60px',
231 fields: [ 233 fields: [
232 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, 234 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
233 { label: "数据产品", field: "dataProductId", width: 180, required: true, columClass: 'edit-colum', type: 'edit' }, 235 { label: "数据产品", field: "dataProductId", width: 180, required: true, columClass: 'edit-colum', type: 'edit' },
...@@ -795,11 +797,10 @@ onActivated(() => { ...@@ -795,11 +797,10 @@ onActivated(() => {
795 </ContentWrap> 797 </ContentWrap>
796 <ContentWrap id="product-info" title="合约标的" expandSwicth style="margin-top: 15px" :isExpand="expandInfo" 798 <ContentWrap id="product-info" title="合约标的" expandSwicth style="margin-top: 15px" :isExpand="expandInfo"
797 @expand="(v) => (expandInfo = v)" description=""> 799 @expand="(v) => (expandInfo = v)" description="">
798 <Table ref="productTableRef" :tableInfo="productTableInfo" class="fiveRow-table" 800 <Table ref="productTableRef" :tableInfo="productTableInfo" @table-select-change="hanldeTableSelectChange" />
799 @table-select-change="hanldeTableSelectChange" /> 801 <!-- <div class="row-add-btn">
800 <div class="row-add-btn">
801 <el-button link @click="addProduct" :icon="CirclePlus" v-preReClick>添加产品</el-button> 802 <el-button link @click="addProduct" :icon="CirclePlus" v-preReClick>添加产品</el-button>
802 </div> 803 </div> -->
803 </ContentWrap> 804 </ContentWrap>
804 <ContentWrap id="policy-info" title="合约策略" expandSwicth style="margin-top: 15px" :isExpand="expandPolicy" 805 <ContentWrap id="policy-info" title="合约策略" expandSwicth style="margin-top: 15px" :isExpand="expandPolicy"
805 @expand="(v) => (expandPolicy = v)" description=""> 806 @expand="(v) => (expandPolicy = v)" description="">
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
2 2
3 const router = useRouter(); 3 const router = useRouter();
4 4
5 const dataRole = ref('operation'); 5 const dataRole = computed(() => {
6 return localStorage.getItem('userRole');
7 });
6 8
7 const click = (command) => { 9 const click = (command) => {
8 let url = '' 10 let url = ''
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!