杂务:整理文档并收口 YumiNail 修复
This commit is contained in:
@@ -588,7 +588,7 @@ export const adminProductApi = {
|
||||
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
||||
* @param params: { page: number; size: number; keyword?: string; shopId?: IdType } caller-supplied value for `params: { page: number; size: number; keyword?: string; shopId?: IdType }`
|
||||
*/
|
||||
listProducts: (params: { page: number; size: number; keyword?: string; shopId?: IdType }) => {
|
||||
listProducts: (params: { page: number; size: number; keyword?: string; shopId?: IdType; tagId?: IdType; minPrice?: number; maxPrice?: number; createdFrom?: string; createdTo?: string }) => {
|
||||
return adminApi.get<{ list: Product[]; total: number; page: number; size: number }>('/product/list', { params })
|
||||
},
|
||||
/**
|
||||
@@ -639,6 +639,14 @@ export interface Shop {
|
||||
coverImageUrls?: string[]
|
||||
imageFileIds?: string
|
||||
imageUrls?: string[]
|
||||
themePrimaryColor?: string
|
||||
themeSecondaryColor?: string
|
||||
themeAccentColor?: string
|
||||
themePageBgColor?: string
|
||||
themeCardBgColor?: string
|
||||
themeBackgroundImageFileId?: string
|
||||
authorizationStartDate?: string
|
||||
authorizationDays?: number
|
||||
authorizationExpireTime?: string
|
||||
authorizationExpired?: boolean
|
||||
authorizationStatusText?: string
|
||||
@@ -663,7 +671,15 @@ export interface CreateShopRequest {
|
||||
businessHours: string
|
||||
coverImageFileId?: string
|
||||
imageFileIds?: string
|
||||
themePrimaryColor?: string
|
||||
themeSecondaryColor?: string
|
||||
themeAccentColor?: string
|
||||
themePageBgColor?: string
|
||||
themeCardBgColor?: string
|
||||
themeBackgroundImageFileId?: string
|
||||
status?: number
|
||||
authorizationStartDate?: string
|
||||
authorizationDays?: number
|
||||
authorizationExpireTime?: string
|
||||
}
|
||||
|
||||
@@ -982,8 +998,24 @@ export interface OrderVO {
|
||||
artistId?: IdType
|
||||
artistName?: string
|
||||
totalAmount: number
|
||||
actualAmount?: number
|
||||
discountAmount: number
|
||||
payAmount: number
|
||||
couponName?: string
|
||||
customerName?: string
|
||||
customerPhone?: string
|
||||
customerNickname?: string
|
||||
customerPhoneMasked?: string
|
||||
items?: Array<{
|
||||
id: IdType
|
||||
productId: IdType
|
||||
productTitle?: string
|
||||
artistId?: IdType
|
||||
artistName?: string
|
||||
appointmentTime?: string
|
||||
price: number
|
||||
quantity: number
|
||||
}>
|
||||
status: number
|
||||
statusText?: string
|
||||
remark?: string
|
||||
@@ -1011,7 +1043,7 @@ export const adminOrderApi = {
|
||||
* @param status: number caller-supplied value for `status: number`
|
||||
*/
|
||||
updateOrderStatus: (id: IdType, status: number) => {
|
||||
return adminApi.put<boolean>(`/order/update-status/${id}`, { status })
|
||||
return adminApi.put<boolean>(`/order/update-status/${id}`, {}, { params: { status } })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1037,6 +1069,16 @@ export interface DashboardStats {
|
||||
totalProducts: number
|
||||
totalShops: number
|
||||
todayOrders: number
|
||||
totalOrderAmount?: number
|
||||
todayOrderAmount?: number
|
||||
weekOrderAmount?: number
|
||||
totalCustomers?: number
|
||||
totalArtists?: number
|
||||
newCustomersToday?: number
|
||||
newCustomers7Days?: number
|
||||
newOrders7Days?: number
|
||||
pendingOrders?: number
|
||||
completedOrders?: number
|
||||
hotProducts: HotProductVO[]
|
||||
recentActivities: RecentActivityVO[]
|
||||
}
|
||||
@@ -1306,6 +1348,15 @@ export const adminVipRechargePlanApi = {
|
||||
*/
|
||||
updateStatus: (id: IdType, status: number) => {
|
||||
return adminApi.put<boolean>(`/vip-recharge-plan/admin/${id}/status`, null, { params: { status } })
|
||||
},
|
||||
/**
|
||||
* `listVipLevelOptions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
||||
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
||||
* @param shopId?: IdType caller-supplied value for `shopId?: IdType`
|
||||
*/
|
||||
listVipLevelOptions: (shopId?: IdType) => {
|
||||
const params = shopId ? { shopId } : {}
|
||||
return adminApi.get<string[]>('/vip-recharge-plan/admin/vip-level-options', { params }) as unknown as Promise<string[]>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1410,6 +1461,9 @@ export const adminSystemParameterConfigApi = {
|
||||
},
|
||||
getTencentMapKey: () => {
|
||||
return adminApi.get<{ key: string }>('/system-parameter-config/admin/tencent-map') as unknown as Promise<{ key: string }>
|
||||
},
|
||||
getMapConfig: () => {
|
||||
return adminApi.get<{ provider: 'TENCENT' | 'AMAP'; tencentWebKey?: string; amapWebKey?: string; amapMiniKey?: string }>('/system-parameter-config/admin/map-config') as unknown as Promise<{ provider: 'TENCENT' | 'AMAP'; tencentWebKey?: string; amapWebKey?: string; amapMiniKey?: string }>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,10 +108,10 @@ const handleTokenExpired = (isAdmin = false) => {
|
||||
|
||||
api.interceptors.request.use(
|
||||
async config => {
|
||||
let token = localStorage.getItem('accessToken')
|
||||
if (!token) {
|
||||
token = sessionStorage.getItem('accessToken')
|
||||
}
|
||||
const isAdminRequest = config.url?.includes('/admin/') || config.url?.includes('/order/admin/')
|
||||
let token = isAdminRequest
|
||||
? (localStorage.getItem('adminAccessToken') || sessionStorage.getItem('adminAccessToken'))
|
||||
: (localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken'))
|
||||
|
||||
// 检查是否是后台管理的API请求
|
||||
if (!token && (config.url?.includes('/admin/') || config.url?.includes('/order/admin/'))) {
|
||||
@@ -192,9 +192,9 @@ api.interceptors.response.use(
|
||||
try {
|
||||
let refreshToken
|
||||
if (isAdminRequest) {
|
||||
refreshToken = localStorage.getItem('adminRefreshToken')
|
||||
refreshToken = localStorage.getItem('adminRefreshToken') || sessionStorage.getItem('adminRefreshToken')
|
||||
} else {
|
||||
refreshToken = localStorage.getItem('refreshToken')
|
||||
refreshToken = localStorage.getItem('refreshToken') || sessionStorage.getItem('refreshToken')
|
||||
}
|
||||
|
||||
if (!refreshToken) {
|
||||
|
||||
@@ -16,6 +16,8 @@ export interface ShopVO {
|
||||
navigationUrls?: Record<string, string>
|
||||
businessHours: string
|
||||
status?: number
|
||||
authorizationStartDate?: string
|
||||
authorizationDays?: number
|
||||
authorizationExpireTime?: string
|
||||
authorizationExpired?: boolean
|
||||
authorizationStatusText?: string
|
||||
@@ -23,6 +25,12 @@ export interface ShopVO {
|
||||
coverImageUrls?: string[]
|
||||
imageFileIds: string
|
||||
imageUrls?: string[]
|
||||
themePrimaryColor?: string
|
||||
themeSecondaryColor?: string
|
||||
themeAccentColor?: string
|
||||
themePageBgColor?: string
|
||||
themeCardBgColor?: string
|
||||
themeBackgroundImageFileId?: string
|
||||
createTime: string
|
||||
updateTime: string
|
||||
}
|
||||
@@ -47,7 +55,15 @@ export interface CreateShopRequest {
|
||||
address: string
|
||||
businessHours: string
|
||||
status: number
|
||||
authorizationStartDate?: string
|
||||
authorizationDays?: number
|
||||
authorizationExpireTime?: string
|
||||
themePrimaryColor?: string
|
||||
themeSecondaryColor?: string
|
||||
themeAccentColor?: string
|
||||
themePageBgColor?: string
|
||||
themeCardBgColor?: string
|
||||
themeBackgroundImageFileId?: string
|
||||
}
|
||||
|
||||
export interface UpdateShopRequest {
|
||||
@@ -58,7 +74,15 @@ export interface UpdateShopRequest {
|
||||
address?: string
|
||||
businessHours?: string
|
||||
status?: number
|
||||
authorizationStartDate?: string
|
||||
authorizationDays?: number
|
||||
authorizationExpireTime?: string
|
||||
themePrimaryColor?: string
|
||||
themeSecondaryColor?: string
|
||||
themeAccentColor?: string
|
||||
themePageBgColor?: string
|
||||
themeCardBgColor?: string
|
||||
themeBackgroundImageFileId?: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -109,6 +109,13 @@ export interface UserRelationVO {
|
||||
sourceTypeName?: string
|
||||
}
|
||||
|
||||
export interface NailArtistInfoVO {
|
||||
userId?: IdType
|
||||
userType?: number
|
||||
participateProduction?: number | boolean
|
||||
status?: number
|
||||
}
|
||||
|
||||
// 用户端常用接口约定:
|
||||
// - relation 表示当前用户的门店和直属上级归属;
|
||||
// - announcement 只用于首页滚动公告,不进入消息通知历史;
|
||||
@@ -334,6 +341,9 @@ export const userApi = {
|
||||
getMyRelation: async (): Promise<UserRelationVO> => {
|
||||
return await api.get<UserRelationVO>('/user/relation/me') as unknown as UserRelationVO
|
||||
},
|
||||
getNailArtistInfo: async (userId: IdType): Promise<NailArtistInfoVO | null> => {
|
||||
return await api.get<NailArtistInfoVO | null>(`/nail-artist/get/${userId}`) as unknown as NailArtistInfoVO | null
|
||||
},
|
||||
// 注册页输入邀请码时先解析,给用户展示“将归属到谁/哪个店铺”。
|
||||
resolveInviteCode: async (code: string): Promise<InviteCodeVO> => {
|
||||
return await api.get<InviteCodeVO>('/user/invite-code/resolve', { params: { code } }) as unknown as InviteCodeVO
|
||||
|
||||
Reference in New Issue
Block a user