mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-07 17:53:42 +08:00
fix(ui): ts类型
This commit is contained in:
@@ -48,8 +48,8 @@ function useAsyncTable<T extends Record<string, unknown>>(
|
||||
page: paginationState.current,
|
||||
pageSize: paginationState.pageSize,
|
||||
});
|
||||
tableState.data = data?.items;
|
||||
paginationState.total = data.total;
|
||||
tableState.data = (data as any)?.items;
|
||||
paginationState.total = (data as any)?.total;
|
||||
} finally {
|
||||
tableState.loading = false
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@ import router from '@/router'
|
||||
|
||||
export const useAuthStore = defineStore({
|
||||
id: __AUTH_KEY,
|
||||
state: () => ({ token: null }),
|
||||
state: () => ({ token: null } as { token: string | null }),
|
||||
actions: {
|
||||
init() {
|
||||
this.$state.token = localStorage.getItem(__AUTH_KEY);
|
||||
},
|
||||
async login(params) {
|
||||
async login(params: any) {
|
||||
try {
|
||||
const { data } = await userLogin(params)
|
||||
if (data) {
|
||||
@@ -29,7 +29,7 @@ export const useAuthStore = defineStore({
|
||||
await userLogout()
|
||||
if (this.$state.token) {
|
||||
localStorage.removeItem(__AUTH_KEY)
|
||||
this.$restate.token = null
|
||||
this.$reset()
|
||||
}
|
||||
Message.success('退出成功');
|
||||
router.push({ name: 'Login' })
|
||||
|
||||
Reference in New Issue
Block a user