Commit 49c60049 by 孙亚楠

dd

parent 39f294d4
......@@ -72,23 +72,28 @@ class AuthService extends ServiceBase {
}
async tree(params) {
var all = await this.dao.all(params.saas_id, "id, orgname, path, pid");
var pmap = {};
for (var item of all) {
item.label = item.name;
var list = pmap[item.pid];
if (!list) {
list = [];
try {
var all = await this.dao.all(params.saas_id, "id,name,path,pid");
var pmap = {};
for (var item of all) {
item.label = item.name;
var list = pmap[item.pid];
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) {
......
......@@ -208,7 +208,7 @@ class UserService extends ServiceBase {
isMain: obj.isMain || 0,
}
if (user.uctype === 1) {
if (Number(this.trim(user.uctype)) === 1) {
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