|
@ -134,27 +134,29 @@ export function findOneUserFormat(data) {
|
|
|
params: data
|
|
|
})
|
|
|
.then(res=>{
|
|
|
// "saasAdmin": "管理员"; regionAdmin" "区域管理员" ; communityAdmin "社区管理员" ; " "replenisher": "补货员"
|
|
|
var temArr = ['saasAdmin', 'regionAdmin', 'communityAdmin', 'replenisher']
|
|
|
var roleList = _.map(res.obj.role, v=>{
|
|
|
return {
|
|
|
id: v.id,
|
|
|
code: v.code,
|
|
|
name: v.name
|
|
|
if(res && res.obj){
|
|
|
// "saasAdmin": "管理员"; regionAdmin" "区域管理员" ; communityAdmin "社区管理员" ; " "replenisher": "补货员"
|
|
|
var temArr = ['saasAdmin', 'regionAdmin', 'communityAdmin', 'replenisher']
|
|
|
var roleList = _.map(res.obj.role, v=>{
|
|
|
return {
|
|
|
id: v.id,
|
|
|
code: v.code,
|
|
|
name: v.name
|
|
|
}
|
|
|
})
|
|
|
roleList = _.sortBy(roleList, v=>{
|
|
|
return temArr.indexOf(v.code)
|
|
|
})
|
|
|
|
|
|
var curRole = roleList[0]
|
|
|
var userInfo = {
|
|
|
roleList,
|
|
|
curRoleId: curRole.id,
|
|
|
curRoleCode: curRole.code,
|
|
|
curRoleName: curRole.name
|
|
|
}
|
|
|
})
|
|
|
roleList = _.sortBy(roleList, v=>{
|
|
|
return temArr.indexOf(v.code)
|
|
|
})
|
|
|
|
|
|
var curRole = roleList[0]
|
|
|
var userInfo = {
|
|
|
roleList,
|
|
|
curRoleId: curRole.id,
|
|
|
curRoleCode: curRole.code,
|
|
|
curRoleName: curRole.name
|
|
|
resolve(userInfo)
|
|
|
}
|
|
|
resolve(userInfo)
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
reject(err)
|