mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-09 05:00:30 +08:00
fix: 修改用户名邮箱bug
This commit is contained in:
parent
542612f138
commit
45e2d1695d
@ -293,7 +293,13 @@ class groupController extends baseController {
|
||||
try {
|
||||
let groupInst = yapi.getInst(groupModel);
|
||||
let group = await groupInst.get(params.id);
|
||||
ctx.body = yapi.commons.resReturn(group.members);
|
||||
const members = [];
|
||||
for(let i = 0, len = group.members.length; i < len; i++) {
|
||||
let item = group.members[i];
|
||||
let member = await this.getUserdata(item.uid, item.role)
|
||||
members.push(member)
|
||||
}
|
||||
ctx.body = yapi.commons.resReturn(members);
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
||||
}
|
||||
|
@ -306,7 +306,13 @@ class projectController extends baseController {
|
||||
|
||||
try {
|
||||
let project = await this.Model.get(params.id);
|
||||
ctx.body = yapi.commons.resReturn(project.members);
|
||||
const members = [];
|
||||
for(let i = 0, len = project.members.length; i < len; i++) {
|
||||
let item = project.members[i];
|
||||
let member = await this.getUserdata(item.uid, item.role)
|
||||
members.push(member)
|
||||
}
|
||||
ctx.body = yapi.commons.resReturn(members);
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
||||
}
|
||||
|
@ -17,9 +17,7 @@ class groupModel extends baseModel {
|
||||
members: [
|
||||
{
|
||||
uid: Number,
|
||||
role: {type: String, enum:['owner', 'dev']},
|
||||
username: String,
|
||||
email: String
|
||||
role: {type: String, enum:['owner', 'dev']}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
@ -15,7 +15,7 @@ class projectModel extends baseModel {
|
||||
group_id: { type: Number, required: true },
|
||||
project_type: {type:String, required: true, enum: ['public', 'private']},
|
||||
members: [
|
||||
{uid: Number, role: {type: String, enum:['owner', 'dev']},username: String, email: String}
|
||||
{uid: Number, role: {type: String, enum:['owner', 'dev']}}
|
||||
],
|
||||
env: [
|
||||
{ name: String, domain: String }
|
||||
|
Loading…
Reference in New Issue
Block a user