fix: 补 .gitattributes(CRLF for .bat) + README 端口 19540 + 提交 console 锁文件
This commit is contained in:
1 parent
c121111f51
commit
b80c64a115
39 files changed
+4217
-345
No files matched your search
@@ -16,8 +16,13 @@ export const useAuthStore = defineStore('admin-auth', () => {
|
||||
/** 会话只在应用启动时探测一次;否则登录后布局重新挂载会把刚登录的用户清掉。 */
|
||||
const initialized = ref(false)
|
||||
|
||||
const isGuest = computed(() => user.value === null)
|
||||
const readOnly = computed(() => user.value === null)
|
||||
/**
|
||||
* 未登录时 /auth/me 返回 200 + guest DTO 而不是 401,
|
||||
* 所以「访客」必须按角色判定:只看 user === null 会把访客当成已登录,
|
||||
* 只读横幅与 useBaseData.canWrite 的写保护都会失效。
|
||||
*/
|
||||
const isGuest = computed(() => user.value === null || user.value.role === 'guest')
|
||||
const readOnly = computed(() => isGuest.value)
|
||||
const displayName = computed(() => user.value?.displayName ?? '访客')
|
||||
const roleLabel = computed(() => (isGuest.value ? '只读访客' : (user.value?.role ?? '用户')))
|
||||
|
||||
|
||||
Reference in new issue
Block a user