Files
JayuCloud/FD-WeChat-Fronted/admin/api/permission.js
T

97 lines
3.5 KiB
JavaScript
Raw Normal View History

2026-05-23 18:45:41 +08:00
/**
* 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 = {
2026-05-23 18:45:41 +08:00
/**
* 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'
})
},
2026-05-23 18:45:41 +08:00
/**
* 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}`
})
},
2026-05-23 18:45:41 +08:00
/**
* 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}`
})
},
2026-05-23 18:45:41 +08:00
/**
* 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'
})
},
2026-05-23 18:45:41 +08:00
/**
* 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
})
},
2026-05-23 18:45:41 +08:00
/**
* 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
})
},
2026-05-23 18:45:41 +08:00
/**
* 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'
})
},
2026-05-23 18:45:41 +08:00
/**
* 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
}
})
}
}