🧪 test: test

This commit is contained in:
Litrix 2024-12-26 12:30:33 +08:00
parent 26f1120982
commit 505aeb76df

View File

@ -40,19 +40,19 @@ export const useUserStore = defineStore('user', () => {
!clubPermissionId || ensureArray(clubPermissionId).every((id) => clubPermissions.value.has(id));
const initializing = ref(false);
const logined = computed(() => (userInfo.value && userInfo.value.id !== -1) ?? false);
watch(
userInfo,
(info, old) => {
router.push({
path:
info && (info.id !== -1 || !old || old.id === -1)
? router.currentRoute.value.fullPath
: '/',
force: true,
});
},
{ flush: 'sync' },
);
// watch(
// userInfo,
// (info, old) => {
// router.push({
// path:
// info && (info.id !== -1 || !old || old.id === -1)
// ? router.currentRoute.value.fullPath
// : '/',
// force: true,
// });
// },
// { flush: 'sync' },
// );
const isSelf = (id: string | number) => userInfo.value?.id === Number(id);
async function updateSelfUserInfo(): Promise<boolean> {
initializing.value = true;