From 520d1ffcf954238cc8d43695764c308e743e3549 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 5 Sep 2023 17:11:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/role.ts | 18 +++++------ src/views/system/role/auth-user.vue | 32 +++++++++---------- .../role/components/auth-user-select.vue | 32 +++++++------------ src/views/system/role/index.vue | 30 ++++++++--------- 4 files changed, 51 insertions(+), 61 deletions(-) diff --git a/src/api/system/role.ts b/src/api/system/role.ts index 2f426836..1940511f 100644 --- a/src/api/system/role.ts +++ b/src/api/system/role.ts @@ -21,7 +21,7 @@ export function exportRole(query: Record) { */ export function listRole(query: Record) { return request({ - url: '/system/role/list', + url: '/roleManage/v1/roles', method: 'get', params: query, }); @@ -34,7 +34,7 @@ export function listRole(query: Record) { */ export function getRole(roleId: string | number) { return request({ - url: `/system/role/${roleId}`, + url: `/roleManage/v1/role/${roleId}`, method: 'get', }); } @@ -46,7 +46,7 @@ export function getRole(roleId: string | number) { */ export function addRole(data: Record) { return request({ - url: '/system/role', + url: '/roleManage/v1/role', method: 'post', data: data, }); @@ -59,7 +59,7 @@ export function addRole(data: Record) { */ export function updateRole(data: Record) { return request({ - url: '/system/role', + url: '/roleManage/v1/role', method: 'put', data: data, }); @@ -72,7 +72,7 @@ export function updateRole(data: Record) { */ export function delRole(roleId: string | number) { return request({ - url: `/system/role/${roleId}`, + url: `/roleManage/v1/role/${roleId}`, method: 'delete', }); } @@ -85,7 +85,7 @@ export function delRole(roleId: string | number) { */ export function changeRoleStatus(roleId: string, status: string | number) { return request({ - url: '/system/role/changeStatus', + url: '/roleManage/v1/role/changeStatus', method: 'put', data: { roleId, @@ -101,7 +101,7 @@ export function changeRoleStatus(roleId: string, status: string | number) { */ export function dataScope(data: Record) { return request({ - url: '/system/role/dataScope', + url: '/roleManage/v1/role/dataScope', method: 'put', data: data, }); @@ -114,7 +114,7 @@ export function dataScope(data: Record) { */ export function authUserAllocatedList(query: Record) { return request({ - url: '/system/role/authUser/allocatedList', + url: '/roleManage/v1/role/authUser/allocatedList', method: 'get', params: query, }); @@ -127,7 +127,7 @@ export function authUserAllocatedList(query: Record) { */ export function authUserChecked(data: Record) { return request({ - url: '/system/role/authUser/checked', + url: '/roleManage/v1/role/authUser/checked', method: 'put', data: data, }); diff --git a/src/views/system/role/auth-user.vue b/src/views/system/role/auth-user.vue index 722872f0..6a77585a 100644 --- a/src/views/system/role/auth-user.vue +++ b/src/views/system/role/auth-user.vue @@ -90,22 +90,22 @@ let tableState: TabeStateType = reactive({ let tableColumns: ColumnsType = [ { title: '用户编号', - dataIndex: 'userId', + dataIndex: 'id', align: 'center', }, { title: '登录账号', - dataIndex: 'userName', + dataIndex: 'accountId', align: 'center', }, { - title: '用户昵称', - dataIndex: 'nickName', + title: '用户名', + dataIndex: 'name', align: 'center', }, { title: '手机号码', - dataIndex: 'phonenumber', + dataIndex: 'phone', align: 'center', }, { @@ -124,13 +124,13 @@ let tableColumns: ColumnsType = [ dataIndex: 'createTime', align: 'center', customRender(opt) { - if (+opt.value <= 0) return ''; - return parseDateToStr(+opt.value); + if (!opt.value) return ''; + return parseDateToStr(opt.value); }, }, { title: '操作', - key: 'userId', + key: 'id', align: 'center', }, ]; @@ -215,7 +215,7 @@ function fnModalOk(userIds: string[] | number[]) { roleId: roleId, }).then(res => { hide(); - if (res.code === 200) { + if (res.code === 1) { modalState.visibleBySelectUser = false; message.success({ content: `授权用户添加成功`, @@ -247,7 +247,7 @@ function fnRecordDelete(userId: string | number) { authUserChecked({ checked: false, userIds: userId, roleId: roleId }).then( res => { hide(); - if (res.code === 200) { + if (res.code === 1) { message.success({ content: `取消授权成功`, duration: 3, @@ -280,7 +280,7 @@ function fnGetList() { if (tableState.loading) return; tableState.loading = true; authUserAllocatedList(toRaw(queryParams)).then(res => { - if (res.code === 200 && Array.isArray(res.rows)) { + if (res.code === 1 && Array.isArray(res.rows)) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; @@ -333,7 +333,7 @@ onMounted(() => { > - + { { -