Commit 49c60049 by 孙亚楠

dd

parent 39f294d4
...@@ -72,23 +72,28 @@ class AuthService extends ServiceBase { ...@@ -72,23 +72,28 @@ class AuthService extends ServiceBase {
} }
async tree(params) { async tree(params) {
var all = await this.dao.all(params.saas_id, "id, orgname, path, pid"); try {
var all = await this.dao.all(params.saas_id, "id,name,path,pid");
var pmap = {};
for (var item of all) { var pmap = {};
item.label = item.name; for (var item of all) {
var list = pmap[item.pid]; item.label = item.name;
if (!list) { var list = pmap[item.pid];
list = []; if (!list) {
list = [];
}
list.push(item);
pmap[item.pid] = list;
} }
list.push(item);
pmap[item.pid] = list; for(var item of all) {
item.children = pmap[item.id] || [];
}
return system.getResultSuccess(pmap[0]);
} catch (error) {
return system.getResult(error);
} }
for(var item of all) {
item.children = pmap[item.id] || [];
}
return system.getResultSuccess(pmap[0][0]);
} }
async byRoleIds(params) { async byRoleIds(params) {
......
...@@ -208,7 +208,7 @@ class UserService extends ServiceBase { ...@@ -208,7 +208,7 @@ class UserService extends ServiceBase {
isMain: obj.isMain || 0, isMain: obj.isMain || 0,
} }
if (user.uctype === 1) { if (Number(this.trim(user.uctype)) === 1) {
user.orgpath = isMain ? org.path : org.path + "/" + id; user.orgpath = isMain ? org.path : org.path + "/" + id;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment