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'))