ce43abda by lihua

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

1 parent 84726a22
......@@ -35,7 +35,7 @@ export const getSystemMenu = (params, isAdmin = false) => {
}/product-menu-permission/tenant/get-product-menu?tenantGuid=${params.tenantGuid}&platformSystemGuid=455a0c2180aa4217b60e859032de0943`
: `${
import.meta.env.VITE_APP_AUTH_URL
}/product-menu-permission/staff/get-product-menu-template?platformSystemGuid=455a0c2180aa4217b60e859032de0943`,
}/product-menu-permission/staff/get-product-menu-template?platformSystemGuid=455a0c2180aa4217b60e859032de0943&funcPermissionTemplateGuid=${params.roleGuid}`,
method: "get",
});
};
......
......@@ -99,19 +99,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;
}
});
}
......
......@@ -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%;"
......
......@@ -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="">
......
......@@ -2,7 +2,9 @@
const router = useRouter();
const dataRole = ref('operation');
const dataRole = computed(() => {
return localStorage.getItem('userRole');
});
const click = (command) => {
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!