🐛 fixed the third-party login bug

This commit is contained in:
landaiqing
2024-08-30 21:52:48 +08:00
parent d91e683e87
commit 2c6ad81720
11 changed files with 254 additions and 72 deletions

View File

@@ -1,11 +1,13 @@
import {useAuthStore} from '@/store/modules/userStore.ts';
import {useThemeStore} from "@/store/modules/themeStore.ts";
import {langStore} from "@/store/modules/langStore.ts";
import {useClientStore} from "@/store/modules/clientStore.ts";
export default function useStore() {
return {
user: useAuthStore(),
theme: useThemeStore(),
lang: langStore(),
client: useClientStore(),
};
}

View File

@@ -0,0 +1,31 @@
import {defineStore} from 'pinia';
import {ref} from "vue";
export const useClientStore = defineStore(
'clientId',
() => {
const clientId = ref<string>();
function setClientId(id: string) {
clientId.value = id;
}
function getClientId() {
return clientId.value;
}
return {
clientId,
setClientId,
getClientId
};
},
{
// 开启数据持久化
persist: {
key: 'clientId',
storage: localStorage,
paths: ["clientId"],
}
}
);