From 723ee5980f67d8e2e1ce869ab25e4d7254062181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=9E=E5=8F=AF=20=C2=B7=20YU=20KE?= <1798456934@qq.com> Date: Fri, 28 Aug 2026 15:51:20 +0800 Subject: [PATCH] docs(@vben/docs): fix setUserInfo store reference in access guide (#8313) The access control guide referenced authStore.setUserInfo, but the user store (useUserStore) is what exposes setUserInfo in the current code. Align the documented API with the implementation in packages/stores/src/modules/user.ts. Co-authored-by: EvoX --- docs/src/en/guide/in-depth/access.md | 4 ++-- docs/src/guide/in-depth/access.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/en/guide/in-depth/access.md b/docs/src/en/guide/in-depth/access.md index 72aa272d1..7eb660481 100644 --- a/docs/src/en/guide/in-depth/access.md +++ b/docs/src/en/guide/in-depth/access.md @@ -53,7 +53,7 @@ You can look under `src/store/auth` in the application to find the following cod ```ts // Set the login user information, ensuring that userInfo.roles is an array and contains permissions from the route table // For example: userInfo.roles=['super', 'admin'] -authStore.setUserInfo(userInfo); +userStore.setUserInfo(userInfo); ``` At this point, the configuration is complete. You need to ensure that the roles returned by the interface after login match the permissions in the route table; otherwise, access will not be possible. @@ -204,7 +204,7 @@ const [fetchUserInfoResult, accessCodes] = await Promise.all([ ]); userInfo = fetchUserInfoResult; -authStore.setUserInfo(userInfo); +userStore.setUserInfo(userInfo); accessStore.setAccessCodes(accessCodes); ``` diff --git a/docs/src/guide/in-depth/access.md b/docs/src/guide/in-depth/access.md index 5de49b2aa..282674c4d 100644 --- a/docs/src/guide/in-depth/access.md +++ b/docs/src/guide/in-depth/access.md @@ -53,7 +53,7 @@ export const overridesPreferences = defineOverridesPreferences({ ```ts // 设置登录用户信息,需要确保 userInfo.roles 是一个数组,且包含路由表中的权限 // 例如:userInfo.roles=['super', 'admin'] -authStore.setUserInfo(userInfo); +userStore.setUserInfo(userInfo); ``` 到这里,就已经配置完成,你需要确保登录后,接口返回的角色和路由表的权限匹配,否则无法访问。 @@ -212,7 +212,7 @@ const [fetchUserInfoResult, accessCodes] = await Promise.all([ ]); userInfo = fetchUserInfoResult; -authStore.setUserInfo(userInfo); +userStore.setUserInfo(userInfo); accessStore.setAccessCodes(accessCodes); ```