mirror of
https://github.com/YMFE/yapi.git
synced 2025-04-12 15:10:23 +08:00
Merge pull request #1250 from tangcent/fix#1249
fix: 修改Swagger自动同步信息时检查权限
This commit is contained in:
commit
b77438bdf6
@ -22,6 +22,11 @@ class syncController extends baseController {
|
||||
if (!projectId) {
|
||||
return (ctx.body = yapi.commons.resReturn(null, 408, '缺少项目Id'));
|
||||
}
|
||||
|
||||
if ((await this.checkAuth(projectId, 'project', 'edit')) !== true) {
|
||||
return (ctx.body = yapi.commons.resReturn(null, 405, '没有权限'));
|
||||
}
|
||||
|
||||
let result;
|
||||
if (requestBody.id) {
|
||||
result = await this.syncModel.up(requestBody);
|
||||
|
Loading…
x
Reference in New Issue
Block a user