fix: improve auth store with user state and role validation

This commit is contained in:
zetaloop
2026-02-20 20:40:25 +08:00
parent 9267df9ea1
commit 6008aa9b04
4 changed files with 38 additions and 17 deletions
+9 -9
View File
@@ -39,7 +39,7 @@ export const mockUsers: User[] = [
},
{
id: "u3",
username: "wang-ge01",
username: "wangzai77",
nickname: "王哥",
avatar: "/avatars/u3.jpg",
role: "owner",
@@ -135,7 +135,7 @@ export const mockServices: PlayerService[] = [
description: "每日委托、树脂、活动本都能清。做完发截图,不乱动你号。",
price: 19,
unit: "次",
availability: ["工作日 21:00-24:00", "周末白天可"],
availability: ["工作日 21:00-24:00", "周末白天可加急"],
},
]
@@ -278,7 +278,7 @@ export const mockOrders: Order[] = [
shopName: "王者电竞工作室",
service: mockServices[1],
status: "completed",
totalPrice: 58,
totalPrice: 54,
note: "补两星就收工",
createdAt: "2025-02-08T21:10:00",
acceptedAt: "2025-02-08T21:15:00",
@@ -295,7 +295,7 @@ export const mockOrders: Order[] = [
shopName: "王者电竞工作室",
service: mockServices[4],
status: "completed",
totalPrice: 34,
totalPrice: 38,
note: "帮我清两天日常",
createdAt: "2025-02-06T19:40:00",
acceptedAt: "2025-02-06T19:45:00",
@@ -310,7 +310,7 @@ export const mockOrders: Order[] = [
playerName: "阿辰",
service: mockServices[2],
status: "completed",
totalPrice: 58,
totalPrice: 57,
createdAt: "2025-02-03T23:10:00",
acceptedAt: "2025-02-03T23:12:00",
closedAt: "2025-02-04T00:05:00",
@@ -695,28 +695,28 @@ export const mockTransactions: WalletTransaction[] = [
{
id: "t7",
type: "payment",
amount: -58,
amount: -54,
description: "支付订单 ord5",
createdAt: "2025-02-08T21:10:00",
},
{
id: "t8",
type: "payment",
amount: -34,
amount: -38,
description: "支付订单 ord6",
createdAt: "2025-02-06T19:40:00",
},
{
id: "t9",
type: "payment",
amount: -58,
amount: -57,
description: "支付订单 ord7",
createdAt: "2025-02-03T23:10:00",
},
]
export const currentUser = mockUsers[0]
export const walletBalance = 179
export const walletBalance = 180
export const mockFavorites: Favorite[] = [
{