feat: 给用户管理添加按钮级权限管理
This commit is contained in:
@@ -166,7 +166,7 @@ export const useRole = (treeRef: Ref) => {
|
||||
page: pagination.currentPage,
|
||||
pageSize: val
|
||||
});
|
||||
if (res.code === 200) {
|
||||
if (res.success) {
|
||||
const data = res.data;
|
||||
dataList.value = data.result;
|
||||
pagination.total = data.total;
|
||||
@@ -179,7 +179,7 @@ export const useRole = (treeRef: Ref) => {
|
||||
page: val,
|
||||
pageSize: pagination.pageSize
|
||||
});
|
||||
if (res.code === 200) {
|
||||
if (res.success) {
|
||||
const data = res.data;
|
||||
dataList.value = data.result;
|
||||
pagination.total = data.total;
|
||||
@@ -189,7 +189,7 @@ export const useRole = (treeRef: Ref) => {
|
||||
|
||||
const handleDelete = async (row: RoleInfo) => {
|
||||
const res = await deleteRoleAPI(row.id);
|
||||
if (res.code === 200) {
|
||||
if (res.success) {
|
||||
message(`您删除了角色名称为${row.name}的这条数据`, { type: "success" });
|
||||
onSearch();
|
||||
} else {
|
||||
@@ -242,7 +242,7 @@ export const useRole = (treeRef: Ref) => {
|
||||
if (title === "新增") {
|
||||
// 实际开发先调用新增接口,再进行下面操作
|
||||
const res = await postAddRoleAPI(curData);
|
||||
if (res.code === 200) {
|
||||
if (res.success) {
|
||||
chores();
|
||||
} else {
|
||||
message(`添加失败!`, {
|
||||
@@ -253,7 +253,7 @@ export const useRole = (treeRef: Ref) => {
|
||||
} else {
|
||||
// 实际开发先调用修改接口,再进行下面操作
|
||||
const res = await putUpdateRoleAPI(curData, row.id);
|
||||
if (res.code === 200) {
|
||||
if (res.success) {
|
||||
chores();
|
||||
} else {
|
||||
message(`修改失败!`, {
|
||||
@@ -310,7 +310,7 @@ export const useRole = (treeRef: Ref) => {
|
||||
const res = await putUpdateRolePermissionsAPI(id, {
|
||||
permission_ids: permissions
|
||||
});
|
||||
if (res.code === 200) {
|
||||
if (res.success) {
|
||||
message(`角色名称为${name}的权限修改成功~`, {
|
||||
type: "success"
|
||||
});
|
||||
@@ -334,7 +334,7 @@ export const useRole = (treeRef: Ref) => {
|
||||
/**获取部门列表 */
|
||||
const getDepartments = async () => {
|
||||
const res = await getDepartmentListAPI({ page: 1, pageSize: 9999 });
|
||||
if (res.code === 200) {
|
||||
if (res.success) {
|
||||
departments.value = formatHigherOptions(res.data.result);
|
||||
} else {
|
||||
departments.value = [];
|
||||
|
||||
Reference in New Issue
Block a user