🐛 fixed the third-party login bug
This commit is contained in:
@@ -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(),
|
||||
};
|
||||
}
|
||||
|
31
src/store/modules/clientStore.ts
Normal file
31
src/store/modules/clientStore.ts
Normal 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"],
|
||||
}
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user