|
|
@@ -601,6 +601,8 @@ import {
|
|
|
registerCheck
|
|
|
} from "@/api/modules/newLoginApi";
|
|
|
import { localGet, localRemove, localSet } from "@/utils";
|
|
|
+import * as path from "node:path";
|
|
|
+import { checkMenuClickPermission } from "@/utils/permission";
|
|
|
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
@@ -904,10 +906,18 @@ const handleLogin = async () => {
|
|
|
// 4.等待路由完全初始化后再跳转
|
|
|
// 使用 nextTick 确保路由已完全添加
|
|
|
await nextTick();
|
|
|
-
|
|
|
- // 5.跳转到首页,使用 replace 避免历史记录问题
|
|
|
- await router.replace(HOME_URL);
|
|
|
-
|
|
|
+ const { contractManagement, foodBusinessLicense } = await checkMenuClickPermission();
|
|
|
+ // 可以使用所有三个值
|
|
|
+ if ((contractManagement && foodBusinessLicense) || contractManagement) {
|
|
|
+ // 合同管理权限
|
|
|
+ router.replace("/licenseManagement/contractManagement");
|
|
|
+ } else if (foodBusinessLicense) {
|
|
|
+ // 食品经营许可证权限
|
|
|
+ router.replace("/licenseManagement/foodBusinessLicense");
|
|
|
+ } else {
|
|
|
+ // 5.跳转到首页,使用 replace 避免历史记录问题
|
|
|
+ await router.replace(HOME_URL);
|
|
|
+ }
|
|
|
ElNotification({
|
|
|
title: "登录成功",
|
|
|
type: "success",
|