fix: 添加better auth 接口配置
This commit is contained in:
17
lib/storage.ts
Normal file
17
lib/storage.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
declare const window: any;
|
||||
export const storage = {
|
||||
async getItem(key: string): Promise<string | null> {
|
||||
if (typeof window === "undefined") return null;
|
||||
return window.localStorage.getItem(key);
|
||||
},
|
||||
|
||||
async setItem(key: string, value: string): Promise<void> {
|
||||
if (typeof window === "undefined") return;
|
||||
window.localStorage.setItem(key, value);
|
||||
},
|
||||
|
||||
async removeItem(key: string): Promise<void> {
|
||||
if (typeof window === "undefined") return;
|
||||
window.localStorage.removeItem(key);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user