Unverified Commit d4304ba4 authored by CHEN/GUANG WU's avatar CHEN/GUANG WU Committed by GitHub

Merge pull request #2 from YMFE/master

update
parents 172d69dd d6e82622
......@@ -240,6 +240,9 @@ const compareVersions = require('compare-versions');
break;
case 'formData':
defaultParam.type = param.type === 'file' ? 'file' : 'text';
if (param.example) {
defaultParam.example = param.example;
}
api.req_body_form.push(defaultParam);
break;
case 'header':
......
......@@ -411,6 +411,10 @@ class userController extends baseController {
let userInst = yapi.getInst(userModel);
let id = ctx.request.query.id;
if (this.getRole() !== 'admin' && id != this.getUid()) {
return (ctx.body = yapi.commons.resReturn(null, 401, '没有权限'));
}
if (!id) {
return (ctx.body = yapi.commons.resReturn(null, 400, 'uid不能为空'));
}
......
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