101 lines
1.9 KiB
TypeScript
101 lines
1.9 KiB
TypeScript
import request from '@/utils/request'
|
||
|
||
const v = '1.0'
|
||
|
||
/** 分页查询店铺 */
|
||
export function shopsList(data?: {
|
||
page?: number
|
||
pageSize?: number
|
||
where?: Record<string, unknown>
|
||
}) {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'shops.list',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data: data || {}
|
||
})
|
||
}
|
||
|
||
/** 新增店铺 */
|
||
export function shopsAdd(data: {
|
||
platform_code: string
|
||
custom_name: string
|
||
}) {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'shops.add',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data
|
||
})
|
||
}
|
||
|
||
/** 软删除店铺 */
|
||
export function shopsDel(data: { id: number }) {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'shops.del',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data
|
||
})
|
||
}
|
||
|
||
/** 编辑店铺(仅允许修改 platform_code / custom_name) */
|
||
export function shopsEdit(data: {
|
||
id: number
|
||
platform_code?: string
|
||
custom_name?: string
|
||
}) {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'shops.edit',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data
|
||
})
|
||
}
|
||
|
||
/** shops.GetAuthorizeSessionKey 响应 */
|
||
export interface ShopAuthorizeSessionKeyResponse {
|
||
flag: string
|
||
code: number
|
||
message: string
|
||
data: {
|
||
message: string
|
||
}
|
||
}
|
||
|
||
/** 按店铺所属平台生成授权会话(视频号平台不传 callbackurl,另传 appId/toUserName;京东平台另传 VenderID) */
|
||
export function shopGetAuthorizeSessionKey(data: {
|
||
id: number
|
||
callbackurl?: string
|
||
appId?: string
|
||
toUserName?: string
|
||
VenderID?: string
|
||
}): Promise<ShopAuthorizeSessionKeyResponse> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'shops.GetAuthorizeSessionKey',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data
|
||
})
|
||
}
|