Files
JayuCloud/WeChatProgram/admin/api/user.js

177 lines
5.8 KiB
JavaScript

/**
* 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'
})
}
}