|
|
@@ -162,45 +162,39 @@ export async function checkMenuClickPermission(path?: string): Promise<{
|
|
|
}
|
|
|
|
|
|
// 如果至少有一个为 true,需要检查权限
|
|
|
- // 构建允许访问的路径列表
|
|
|
- const allowedPaths: string[] = [];
|
|
|
- if (contractManagement) {
|
|
|
- allowedPaths.push(CONTRACT_MANAGEMENT_PATH);
|
|
|
- }
|
|
|
- if (foodBusinessLicense) {
|
|
|
- allowedPaths.push(FOOD_BUSINESS_LICENSE_PATH);
|
|
|
- }
|
|
|
- if (entertainmentBusinessLicense) {
|
|
|
- allowedPaths.push(ENTERTAINMENT_LICENSE_PATH);
|
|
|
- }
|
|
|
+ // 只有当用户尝试访问已到期的特定页面时,才阻止访问
|
|
|
let canClick = true;
|
|
|
- // 检查当前路径是否在允许访问的列表中
|
|
|
if (path) {
|
|
|
- const canClickstatus = allowedPaths.includes(path);
|
|
|
-
|
|
|
- // 如果不可点击,根据权限状态显示相应的提示信息
|
|
|
- if (!canClickstatus) {
|
|
|
- const messages: string[] = [];
|
|
|
+ // 检查当前路径是否是已到期的页面
|
|
|
+ let isBlocked = false;
|
|
|
+ const messages: string[] = [];
|
|
|
|
|
|
+ // 检查合同管理页面
|
|
|
+ if (path === CONTRACT_MANAGEMENT_PATH && contractManagement) {
|
|
|
+ isBlocked = true;
|
|
|
// 暂时关闭三个权限检查
|
|
|
- // if (contractManagement) {
|
|
|
- // messages.push("合同已到期,请上传最新合同。");
|
|
|
- // }
|
|
|
- // if (foodBusinessLicense) {
|
|
|
- // console.log(foodBusinessLicense);
|
|
|
- // messages.push("食品经营许可证已到期,请上传最新许可证。");
|
|
|
- // }
|
|
|
- // if (entertainmentBusinessLicense) {
|
|
|
- // messages.push("娱乐经营许可证已到期,请上传最新许可证。");
|
|
|
- // }
|
|
|
-
|
|
|
- if (messages.length) {
|
|
|
- ElMessage.warning({
|
|
|
- // message: messages.join('\n'),
|
|
|
- message: messages.join("<br>"),
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- });
|
|
|
- }
|
|
|
+ // messages.push("合同已到期,请上传最新合同。");
|
|
|
+ }
|
|
|
+ // 检查食品经营许可证页面
|
|
|
+ if (path === FOOD_BUSINESS_LICENSE_PATH && foodBusinessLicense) {
|
|
|
+ isBlocked = true;
|
|
|
+ // 暂时关闭三个权限检查
|
|
|
+ // messages.push("食品经营许可证已到期,请上传最新许可证。");
|
|
|
+ }
|
|
|
+ // 检查娱乐经营许可证页面
|
|
|
+ if (path === ENTERTAINMENT_LICENSE_PATH && entertainmentBusinessLicense) {
|
|
|
+ isBlocked = true;
|
|
|
+ // 暂时关闭三个权限检查
|
|
|
+ // messages.push("娱乐经营许可证已到期,请上传最新许可证。");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果被阻止,显示提示信息
|
|
|
+ if (isBlocked && messages.length) {
|
|
|
+ ElMessage.warning({
|
|
|
+ // message: messages.join('\n'),
|
|
|
+ message: messages.join("<br>"),
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ });
|
|
|
canClick = false;
|
|
|
}
|
|
|
}
|