重构项目文件夹目录
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Purpose: request sends authenticated admin mini-program calls through the shared request wrapper.
|
||||
* Usage: keep after-sale endpoints aligned with /admin/after-sale on the backend.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
listAfterSales(params) {
|
||||
return request({
|
||||
url: '/after-sale/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
approveAfterSale(id, data) {
|
||||
return request({
|
||||
url: `/after-sale/${id}/approve`,
|
||||
method: 'PUT',
|
||||
data: data || {}
|
||||
})
|
||||
},
|
||||
|
||||
rejectAfterSale(id, data) {
|
||||
return request({
|
||||
url: `/after-sale/${id}/reject`,
|
||||
method: 'PUT',
|
||||
data: data || {}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Purpose: request sends authenticated admin mini-program calls through the shared request wrapper.
|
||||
* Usage: keep schedule endpoints aligned with /admin/artist-schedule on the backend.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
listSchedules(params) {
|
||||
return request({
|
||||
url: '/artist-schedule/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
saveSchedule(data) {
|
||||
return request({
|
||||
url: '/artist-schedule/save',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* Purpose: request supports auth.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: login supports auth.js by holding or executing the login page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
login(data) {
|
||||
return request({
|
||||
url: '/auth/login',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getLoginShops supports auth.js by holding or executing the get login shops page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getLoginShops(account) {
|
||||
return request({
|
||||
url: `/auth/login-shops/${encodeURIComponent(account)}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: switchShop supports auth.js by holding or executing the switch shop page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
switchShop(shopId) {
|
||||
return request({
|
||||
url: '/auth/switch-shop',
|
||||
method: 'POST',
|
||||
data: {
|
||||
shopId: shopId || undefined
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: refreshToken supports auth.js by holding or executing the refresh token page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
refreshToken(refreshToken) {
|
||||
return request({
|
||||
url: '/auth/refresh',
|
||||
method: 'POST',
|
||||
data: {
|
||||
refreshToken
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: logout supports auth.js by holding or executing the logout page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
logout() {
|
||||
return request({
|
||||
url: '/auth/logout',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Purpose: request sends authenticated admin mini-program calls through the shared request wrapper.
|
||||
* Usage: keep campaign endpoints aligned with /admin/campaign on the backend.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
listCampaigns(params) {
|
||||
return request({
|
||||
url: '/campaign/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
saveCampaign(data) {
|
||||
return request({
|
||||
url: '/campaign/save',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Purpose: request supports comment.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: listComments supports comment.js by holding or executing the list comments page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listComments(params) {
|
||||
return request({
|
||||
url: '/comment/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: deleteComment supports comment.js by holding or executing the delete comment page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
deleteComment(id) {
|
||||
return request({
|
||||
url: `/comment/delete/${id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* Purpose: request supports coupon.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: listCoupons supports coupon.js by holding or executing the list coupons page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listCoupons(params) {
|
||||
return request({
|
||||
url: '/coupon/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: listAllCoupons supports coupon.js by holding or executing the list all coupons page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listAllCoupons(shopId) {
|
||||
return request({
|
||||
url: '/coupon/list/all',
|
||||
params: shopId ? { shopId } : undefined
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getCouponDetail supports coupon.js by holding or executing the get coupon detail page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getCouponDetail(id) {
|
||||
return request({
|
||||
url: `/coupon/detail/${id}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: createCoupon supports coupon.js by holding or executing the create coupon page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
createCoupon(data) {
|
||||
return request({
|
||||
url: '/coupon/create',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: updateCoupon supports coupon.js by holding or executing the update coupon page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
updateCoupon(id, data) {
|
||||
return request({
|
||||
url: `/coupon/update/${id}`,
|
||||
method: 'PUT',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: deleteCoupon supports coupon.js by holding or executing the delete coupon page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
deleteCoupon(id) {
|
||||
return request({
|
||||
url: `/coupon/delete/${id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: assignCoupon supports coupon.js by holding or executing the assign coupon page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
assignCoupon(data) {
|
||||
return request({
|
||||
url: '/coupon/assign',
|
||||
method: 'POST',
|
||||
params: data,
|
||||
data: {}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: distributeCoupon supports coupon.js by holding or executing the distribute coupon page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
distributeCoupon(data) {
|
||||
return request({
|
||||
url: '/coupon/distribute',
|
||||
method: 'POST',
|
||||
params: data,
|
||||
data: {}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Purpose: request supports dashboard.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: getStats supports dashboard.js by holding or executing the get stats page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getStats() {
|
||||
return request({
|
||||
url: '/dashboard/stats'
|
||||
})
|
||||
},
|
||||
|
||||
getAnalytics() {
|
||||
return request({
|
||||
url: '/dashboard/analytics'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
/**
|
||||
* Purpose: request supports file.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
/**
|
||||
* Purpose: actionGuard supports file.js by holding or executing the action guard page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const actionGuard = require('../utils/action-guard')
|
||||
const { ADMIN_API_BASE_URL, REQUEST_TIMEOUT } = require('../utils/config')
|
||||
|
||||
/**
|
||||
* Purpose: normalizeUploadResponse supports file.js by holding or executing the normalize upload response page or API role.
|
||||
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
function normalizeUploadResponse(response) {
|
||||
if (!response) {
|
||||
throw new Error('上传失败')
|
||||
}
|
||||
|
||||
if (response.statusCode === 401) {
|
||||
throw new Error('登录已过期,请重新登录')
|
||||
}
|
||||
|
||||
if (response.statusCode >= 400) {
|
||||
throw new Error('上传失败')
|
||||
}
|
||||
|
||||
let payload = response.data
|
||||
if (typeof payload === 'string') {
|
||||
try {
|
||||
payload = JSON.parse(payload)
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
if (payload && typeof payload === 'object' && Object.prototype.hasOwnProperty.call(payload, 'code')) {
|
||||
if (payload.code === 200) {
|
||||
return payload.data
|
||||
}
|
||||
throw new Error(payload.message || '上传失败')
|
||||
}
|
||||
|
||||
return payload
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: initChunkUpload supports file.js by holding or executing the init chunk upload page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
initChunkUpload(data) {
|
||||
return request({
|
||||
url: '/object-storage-file/upload/init',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: uploadChunkFile supports file.js by holding or executing the upload chunk file page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
uploadChunkFile(options) {
|
||||
const signedHeaders = request.buildSignatureHeaders({
|
||||
url: '/object-storage-file/upload/chunk',
|
||||
method: 'POST',
|
||||
formData: {
|
||||
uploadId: String(options.uploadId),
|
||||
chunkIndex: String(options.chunkIndex),
|
||||
totalChunks: String(options.totalChunks)
|
||||
}
|
||||
})
|
||||
|
||||
return actionGuard.run(
|
||||
null,
|
||||
`POST:/object-storage-file/upload/chunk:${String(options.uploadId)}:${String(options.chunkIndex)}`,
|
||||
() => new Promise((resolve, reject) => {
|
||||
const task = wx.uploadFile({
|
||||
url: `${ADMIN_API_BASE_URL}/object-storage-file/upload/chunk`,
|
||||
filePath: options.filePath,
|
||||
name: 'chunk',
|
||||
timeout: REQUEST_TIMEOUT,
|
||||
formData: {
|
||||
uploadId: String(options.uploadId),
|
||||
chunkIndex: String(options.chunkIndex),
|
||||
totalChunks: String(options.totalChunks)
|
||||
},
|
||||
header: signedHeaders,
|
||||
success: response => {
|
||||
try {
|
||||
resolve(normalizeUploadResponse(response))
|
||||
} catch (error) {
|
||||
reject(error)
|
||||
}
|
||||
},
|
||||
fail: error => {
|
||||
reject(new Error(error.errMsg || '上传分片失败'))
|
||||
}
|
||||
})
|
||||
|
||||
if (task && typeof task.onProgressUpdate === 'function' && typeof options.onProgress === 'function') {
|
||||
task.onProgressUpdate(progress => {
|
||||
options.onProgress(progress)
|
||||
})
|
||||
}
|
||||
}),
|
||||
{
|
||||
message: '上传处理中,请勿重复操作'
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: completeChunkUpload supports file.js by holding or executing the complete chunk upload page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
completeChunkUpload(uploadId) {
|
||||
return request({
|
||||
url: '/object-storage-file/upload/complete',
|
||||
method: 'POST',
|
||||
data: {
|
||||
uploadId
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: cancelChunkUpload supports file.js by holding or executing the cancel chunk upload page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
cancelChunkUpload(uploadId) {
|
||||
return request({
|
||||
url: `/object-storage-file/upload/${uploadId}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getSignedUrl supports file.js by holding or executing the get signed url page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getSignedUrl(fileId) {
|
||||
return request({
|
||||
url: `/object-storage-file/get-signed-url/${fileId}`
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Purpose: request sends authenticated admin mini-program calls through the shared request wrapper.
|
||||
* Usage: keep inventory endpoints aligned with /admin/inventory on the backend.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
listItems(params) {
|
||||
return request({
|
||||
url: '/inventory/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
saveItem(data) {
|
||||
return request({
|
||||
url: '/inventory/save',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
adjustStock(id, data) {
|
||||
return request({
|
||||
url: `/inventory/${id}/adjust`,
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Purpose: request supports nail-artist.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: listNailArtists supports nail-artist.js by holding or executing the list nail artists page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listNailArtists() {
|
||||
return request({
|
||||
url: '/nail-artist/list'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getNailArtistInfo supports nail-artist.js by holding or executing the get nail artist info page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getNailArtistInfo(userId) {
|
||||
return request({
|
||||
url: `/nail-artist/get/${userId}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: saveNailArtistInfo supports nail-artist.js by holding or executing the save nail artist info page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
saveNailArtistInfo(data) {
|
||||
return request({
|
||||
url: '/nail-artist/save',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Purpose: request supports order.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: listOrders supports order.js by holding or executing the list orders page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listOrders(params) {
|
||||
return request({
|
||||
url: '/order/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getOrderDetail loads an authoritative admin-scoped order detail row.
|
||||
* Usage: call with the order id when opening the order detail page so direct page entry works.
|
||||
*/
|
||||
getOrderDetail(id) {
|
||||
return request({
|
||||
url: `/order/detail/${id}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: listOrderReviews supports order.js by holding or executing the list order reviews page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listOrderReviews(orderId) {
|
||||
return request({
|
||||
url: `/order/${orderId}/reviews`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getArtistChangeOptions supports order.js by holding or executing the get artist change options page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getArtistChangeOptions(orderId, orderItemId) {
|
||||
return request({
|
||||
url: `/order/${orderId}/artist-change/options`,
|
||||
params: {
|
||||
orderItemId
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: requestArtistChange supports order.js by holding or executing the request artist change page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
requestArtistChange(data) {
|
||||
return request({
|
||||
url: '/order/artist-change/request',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: listMyPendingArtistChangeRequests supports order.js by holding or executing the list my pending artist change requests page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listMyPendingArtistChangeRequests() {
|
||||
return request({
|
||||
url: '/order/artist-change/my-pending'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: updateOrderStatus supports order.js by holding or executing the update order status page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
updateOrderStatus(id, status) {
|
||||
return request({
|
||||
url: `/order/update-status/${id}`,
|
||||
method: 'PUT',
|
||||
params: {
|
||||
status
|
||||
},
|
||||
data: {}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Purpose: request sends authenticated admin mini-program calls through the shared request wrapper.
|
||||
* Usage: call manual payment operations only after UI permission checks; backend remains authoritative.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
manualConfirmOrder(orderId, remark) {
|
||||
return request({
|
||||
url: `/payment/order/${orderId}/manual-confirm`,
|
||||
method: 'POST',
|
||||
params: {
|
||||
remark
|
||||
},
|
||||
data: {}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* Purpose: request supports permission.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: getCurrentUserPermissions supports permission.js by holding or executing the get current user permissions page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getCurrentUserPermissions() {
|
||||
return request({
|
||||
url: '/permission/user/current'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getUserPermissions supports permission.js by holding or executing the get user permissions page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getUserPermissions(userId) {
|
||||
return request({
|
||||
url: `/permission/user/${userId}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getAssignablePermissionIds supports permission.js by holding or executing the get assignable permission ids page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getAssignablePermissionIds(userId) {
|
||||
return request({
|
||||
url: `/permission/assignable/${userId}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: listAllPermissions supports permission.js by holding or executing the list all permissions page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listAllPermissions() {
|
||||
return request({
|
||||
url: '/permission/list/all'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: createPermission supports permission.js by holding or executing the create permission page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
createPermission(data) {
|
||||
return request({
|
||||
url: '/permission/create',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: updatePermission supports permission.js by holding or executing the update permission page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
updatePermission(id, data) {
|
||||
return request({
|
||||
url: `/permission/update/${id}`,
|
||||
method: 'PUT',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: deletePermission supports permission.js by holding or executing the delete permission page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
deletePermission(id) {
|
||||
return request({
|
||||
url: `/permission/delete/${id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: assignUserPermissions supports permission.js by holding or executing the assign user permissions page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
assignUserPermissions(userId, permissionIds) {
|
||||
return request({
|
||||
url: `/permission/assign/${userId}`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
permissionIds
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* Purpose: request supports product.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: listProducts supports product.js by holding or executing the list products page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listProducts(params) {
|
||||
return request({
|
||||
url: '/product/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: listAllProducts supports product.js by holding or executing the list all products page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listAllProducts() {
|
||||
return request({
|
||||
url: '/product/list/all'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: createProduct supports product.js by holding or executing the create product page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
createProduct(data) {
|
||||
return request({
|
||||
url: '/product/create',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: updateProduct supports product.js by holding or executing the update product page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
updateProduct(id, data) {
|
||||
return request({
|
||||
url: `/product/update/${id}`,
|
||||
method: 'PUT',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: deleteProduct supports product.js by holding or executing the delete product page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
deleteProduct(id) {
|
||||
return request({
|
||||
url: `/product/delete/${id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Purpose: request sends signed admin mini-program requests to the backend audit API.
|
||||
* Usage: require this module from the audit page and call `listLogs` with filter params.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: listLogs loads read-only security audit log rows for authorized administrators.
|
||||
* Usage: pass account, action, result, time range, page, and size filters, then render the returned page result.
|
||||
*/
|
||||
listLogs(params) {
|
||||
return request({
|
||||
url: '/security-audit/logs',
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* Purpose: request supports shop.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: listShops supports shop.js by holding or executing the list shops page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listShops(params) {
|
||||
return request({
|
||||
url: '/shops/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: listAllShops supports shop.js by holding or executing the list all shops page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listAllShops() {
|
||||
return request({
|
||||
url: '/shops/list/all'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getShop supports shop.js by holding or executing the get shop page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getShop(id) {
|
||||
return request({
|
||||
url: `/shops/${id}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: createShop supports shop.js by holding or executing the create shop page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
createShop(data) {
|
||||
return request({
|
||||
url: '/shops/create',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: updateShop supports shop.js by holding or executing the update shop page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
updateShop(id, data) {
|
||||
return request({
|
||||
url: `/shops/update/${id}`,
|
||||
method: 'PUT',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: updateShopStatus supports shop.js by holding or executing the update shop status page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
updateShopStatus(id, status) {
|
||||
return request({
|
||||
url: `/shops/status/${id}`,
|
||||
method: 'PUT',
|
||||
data: {
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: deleteShop supports shop.js by holding or executing the delete shop page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
deleteShop(id) {
|
||||
return request({
|
||||
url: `/shops/delete/${id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Purpose: request sends signed admin mini-program calls to the backend system-message endpoints.
|
||||
* Usage: keep all system-message API wrappers in this module so pages do not build URLs by hand.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: listMessages loads admin-visible system messages including popup and business navigation metadata.
|
||||
* Usage: call it from the system-message management page during initial load or refresh.
|
||||
*/
|
||||
listMessages() {
|
||||
return request({
|
||||
url: '/system-message/admin/list'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: createMessage publishes a new system message to the selected target users.
|
||||
* Usage: pass validated form data with targetType, popupEnabled, and optional business fields.
|
||||
*/
|
||||
createMessage(data) {
|
||||
return request({
|
||||
url: '/system-message/admin/create',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: revokeMessage withdraws a previously published message when the operator has delete permission.
|
||||
* Usage: call it with the message id after an explicit confirmation dialog.
|
||||
*/
|
||||
revokeMessage(id) {
|
||||
return request({
|
||||
url: `/system-message/admin/${id}/revoke`,
|
||||
method: 'PUT',
|
||||
data: {}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getTargetOptions loads shops and users that the current operator may target.
|
||||
* Usage: call it before showing the publish form so picker data is permission-scoped.
|
||||
*/
|
||||
getTargetOptions() {
|
||||
return request({
|
||||
url: '/system-message/admin/target-options'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* Purpose: request supports tag.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: listAllTags supports tag.js by holding or executing the list all tags page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listAllTags() {
|
||||
return request({
|
||||
url: '/tag/list/all'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: listTagsByShopId supports tag.js by holding or executing the list tags by shop id page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listTagsByShopId(shopId) {
|
||||
return request({
|
||||
url: `/tag/list/by-shop/${shopId}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getTagById supports tag.js by holding or executing the get tag by id page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getTagById(id) {
|
||||
return request({
|
||||
url: `/tag/get/${id}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: createTag supports tag.js by holding or executing the create tag page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
createTag(data) {
|
||||
return request({
|
||||
url: '/tag/create',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: updateTag supports tag.js by holding or executing the update tag page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
updateTag(id, data) {
|
||||
return request({
|
||||
url: `/tag/update/${id}`,
|
||||
method: 'PUT',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: deleteTag supports tag.js by holding or executing the delete tag page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
deleteTag(id) {
|
||||
return request({
|
||||
url: `/tag/delete/${id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
/**
|
||||
* Purpose: request supports user.js by holding or executing the request page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const request = require('../utils/request')
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Purpose: listUsers supports user.js by holding or executing the list users page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listUsers(params) {
|
||||
return request({
|
||||
url: '/user/list',
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: listAllUsers supports user.js by holding or executing the list all users page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listAllUsers() {
|
||||
return request({
|
||||
url: '/user/list/all'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: listArtists supports user.js by holding or executing the list artists page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
listArtists(shopId) {
|
||||
return request({
|
||||
url: '/user/list/artists',
|
||||
params: shopId ? { shopId } : undefined
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: createUser supports user.js by holding or executing the create user page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
createUser(data) {
|
||||
return request({
|
||||
url: '/user/create',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: updateUser supports user.js by holding or executing the update user page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
updateUser(id, data) {
|
||||
return request({
|
||||
url: `/user/update/${id}`,
|
||||
method: 'PUT',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: updateUserStatus supports user.js by holding or executing the update user status page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
updateUserStatus(id, status) {
|
||||
return request({
|
||||
url: `/user/status/${id}`,
|
||||
method: 'PUT',
|
||||
data: {
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: deleteUser supports user.js by holding or executing the delete user page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
deleteUser(id) {
|
||||
return request({
|
||||
url: `/user/delete/${id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: unbindUser supports user.js by holding or executing the unbind user page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
unbindUser(id) {
|
||||
return request({
|
||||
url: `/user/unbind/${id}`,
|
||||
method: 'PUT',
|
||||
data: {}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: resetPassword supports user.js by holding or executing the reset password page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
resetPassword(id) {
|
||||
return request({
|
||||
url: `/user/reset-password/${id}`,
|
||||
method: 'POST'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getCurrentUserInfo supports user.js by holding or executing the get current user info page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getCurrentUserInfo() {
|
||||
return request({
|
||||
url: '/user/info'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getUserAsset supports user.js by holding or executing the get user asset page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getUserAsset(id) {
|
||||
return request({
|
||||
url: `/user/${id}/asset`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getUserBalanceHistory supports user.js by holding or executing the get user balance history page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
getUserBalanceHistory(id) {
|
||||
return request({
|
||||
url: `/user/${id}/balance/history`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: changeUserBalance supports user.js by holding or executing the change user balance page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
changeUserBalance(id, data) {
|
||||
return request({
|
||||
url: `/user/${id}/balance/change`,
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: overrideUserVip supports user.js by holding or executing the override user vip page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
overrideUserVip(id, data) {
|
||||
return request({
|
||||
url: `/user/${id}/vip/override`,
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: recalculateUserVip supports user.js by holding or executing the recalculate user vip page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
recalculateUserVip(id) {
|
||||
return request({
|
||||
url: `/user/${id}/vip/recalculate`,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user