fix list style

This commit is contained in:
Timi
2026-08-07 17:06:03 +08:00
parent 28b789eb86
commit 82e717e3c6
13 changed files with 130 additions and 120 deletions
+12 -2
View File
@@ -3,6 +3,7 @@ import { permissionCodes } from "@/utils/permission";
import { type Page, useUserStore } from "timi-web";
export const currentStoreIdStorageKey = "gao-customer-h5:current-store-id";
export const loginStoreIdStorageKey = "gao-customer-h5:login-store-id";
type LoginUserWithStore = {
storeId?: string;
@@ -19,20 +20,29 @@ type LoginUserWithStore = {
export function getCurrentStoreId(): string {
const userStore = useUserStore();
const loginStoreId = readLoginStoreId();
if (userStore.hasPermissions(permissionCodes.store.read)) {
return readStoredCurrentStoreId() || getLoginUserStoreId();
return readStoredCurrentStoreId() || loginStoreId || getLoginUserStoreId();
}
return getLoginUserStoreId();
return loginStoreId || getLoginUserStoreId();
}
export function setCurrentStoreId(storeId: string): void {
localStorage.setItem(currentStoreIdStorageKey, storeId);
}
export function setLoginStoreId(storeId: string): void {
localStorage.setItem(loginStoreIdStorageKey, storeId);
}
export function readStoredCurrentStoreId(): string {
return localStorage.getItem(currentStoreIdStorageKey) || "";
}
export function readLoginStoreId(): string {
return localStorage.getItem(loginStoreIdStorageKey) || "";
}
export function withCurrentStoreId<T extends { storeId?: string }>(data: T): T {
return {
...data,