diff --git a/package.json b/package.json index b9e0626..a4bbcad 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "i18next-http-backend": "^2.5.2", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-router-dom": "^6.30.1", "react-i18next": "^14.1.2", + "react-router-dom": "^6.30.1", "react-to-pdf": "^1.0.1", "xlsx": "https://cdn.sheetjs.com/xlsx-0.18.11/xlsx-0.18.11.tgz", "zustand": "^4.5.7" diff --git a/src/stores/Auth.js b/src/stores/Auth.js index 8828884..dcd9e65 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -37,12 +37,6 @@ export const fetchPermissionListByUserId = async (userId) => { return errcode !== 0 ? {} : result } -// 取消令牌时间过期检测,待删除 -async function fetchLastRequet() { - const { errcode, result } = await fetchJSON(`${HT_HOST}/service-CooperateSOA/GetLastReqDate`) - return errcode !== 0 ? {} : result -} - const initialState = { tokenInterval: null, loginStatus: 0, @@ -175,6 +169,16 @@ const useAuthStore = create(devtools((set, get) => ({ }) }, + // 根据某项数据来判断是否有权限 + // + // INSERT INTO [dbo].[auth_resource] ([res_name] ,[res_pattern], [res_category]) + // VALUES ('审核CH直销产品', '[125, 375]', 'data') + // + // const PERM_PRODUCTS_AUDIT_CH = '[125, 375]' + isAllowed: (perm, data) => { + return true + }, + }), { name: 'authStore' })) export default useAuthStore