From 6b909af0765b45f95ba012e2bbbc107bb51ebaa9 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 1 Aug 2025 16:23:33 +0800 Subject: [PATCH] =?UTF-8?q?v1.9=20=E4=BC=98=E5=8C=96=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/staff/staffDetailApi.js | 11 ++--------- src/views/staff/staffDetailList.vue | 17 +++++++++-------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/api/staff/staffDetailApi.js b/src/api/staff/staffDetailApi.js index 97f8b79c7..34e25c57b 100644 --- a/src/api/staff/staffDetailApi.js +++ b/src/api/staff/staffDetailApi.js @@ -9,11 +9,7 @@ export function getStaffDetail(params) { params }).then(response => { const res = response.data - if (res.code === 0) { resolve(res) - } else { - reject(new Error(res.msg || '获取员工详情失败')) - } }).catch(error => { reject(error) }) @@ -49,11 +45,8 @@ export function getStaffRoles(params) { params }).then(response => { const res = response.data - if (res.code === 0) { resolve(res) - } else { - reject(new Error(res.msg || '获取员工角色失败')) - } + }).catch(error => { reject(error) }) @@ -64,7 +57,7 @@ export function getStaffRoles(params) { export function getStaffPrivileges(params) { return new Promise((resolve, reject) => { request({ - url: '/privilege.queryStaffPrivileges', + url: '/query.user.privilege', method: 'get', params }).then(response => { diff --git a/src/views/staff/staffDetailList.vue b/src/views/staff/staffDetailList.vue index adf2bc2d3..ff6055e64 100644 --- a/src/views/staff/staffDetailList.vue +++ b/src/views/staff/staffDetailList.vue @@ -77,12 +77,13 @@ {{ $t('staffDetailInfo.relatedRoleCommunity') }}
-
- {{ item.roleName }} ( +
+
{{ item.roleName }}
( {{ item1.communityName }} {{ index1 === item.roleCommunityDtoList.length - 1 ? " " : " 、 " }} ) +
@@ -152,9 +153,9 @@ export default { staffId: this.staffDetailInfo.staffId } const res = await getStaffDetail(params) - if (res.code === 0 && res.data.length > 0) { - Object.assign(this.staffDetailInfo, res.data[0]) - this.staffDetailInfo.photo = res.data[0].faceUrl + if ( res.staffs.length > 0) { + Object.assign(this.staffDetailInfo, res.staffs[0]) + this.staffDetailInfo.photo = res.staffs[0].faceUrl } } catch (error) { this.$message.error(this.$t('staffDetailInfo.fetchError')) @@ -183,7 +184,7 @@ export default { staffId: this.staffDetailInfo.staffId } const res = await getStaffRoles(params) - if (res.code === 0) { + if (res.code == 0) { this.staffDetailInfo.roles = res.data } } catch (error) { @@ -196,8 +197,8 @@ export default { staffId: this.staffDetailInfo.staffId } const res = await getStaffPrivileges(params) - if (res.data && res.data.length > 0) { - this.privilegeTreeData = this.buildTreeData(res.data) + if (res.datas && res.datas.length > 0) { + this.privilegeTreeData = this.buildTreeData(res.datas) } } catch (error) { this.$message.error(this.$t('staffDetailInfo.fetchPrivilegeError'))