mirror of
https://github.com/YMFE/yapi.git
synced 2025-04-06 15:00:26 +08:00
Merge pull request #1358 from kangofchen/master
当传入数据格式的 method 不规范时,容易导致获取对象为空,出现异常导致动态页面无法打开
This commit is contained in:
commit
c1a33a67da
@ -158,7 +158,7 @@ class TimeTree extends Component {
|
||||
<Option title={item.title} value={item._id + ''} path={item.path} key={item._id}>
|
||||
{item.title}{' '}
|
||||
<Tag
|
||||
style={{ color: methodColor.color, backgroundColor: methodColor.bac, border: 'unset' }}
|
||||
style={{ color: methodColor ? methodColor.color : '#cfefdf', backgroundColor: methodColor ? methodColor.bac : '#00a854', border: 'unset' }}
|
||||
>
|
||||
{item.method}
|
||||
</Tag>
|
||||
|
@ -190,6 +190,7 @@ const compareVersions = require('compare-versions');
|
||||
required: param.required ? '1' : '0'
|
||||
};
|
||||
|
||||
if (param.in) {
|
||||
switch (param.in) {
|
||||
case 'path':
|
||||
api.req_params.push(defaultParam);
|
||||
@ -208,6 +209,9 @@ const compareVersions = require('compare-versions');
|
||||
api.req_headers.push(defaultParam);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
api.req_query.push(defaultParam);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user