mirror of
https://github.com/YMFE/yapi.git
synced 2025-04-12 15:10:23 +08:00
fix: 修改测试返回数据mode问题
This commit is contained in:
parent
b38ea0cc31
commit
8f09803b8b
@ -44,6 +44,7 @@ class AceEditor extends React.PureComponent {
|
||||
});
|
||||
|
||||
let mode = this.props.mode || 'javascript';
|
||||
|
||||
this.editor.editor.getSession().setMode(getMode(mode));
|
||||
if (typeof this.props.callback === 'function') {
|
||||
this.props.callback(this.editor.editor);
|
||||
|
@ -861,7 +861,7 @@ export default class Run extends Component {
|
||||
readOnly={true}
|
||||
className="pretty-editor-header"
|
||||
data={this.state.test_res_header}
|
||||
mode="json"
|
||||
mode="json"
|
||||
/>
|
||||
</div>
|
||||
<div className="resizer">
|
||||
@ -878,6 +878,7 @@ export default class Run extends Component {
|
||||
className="pretty-editor-body"
|
||||
data={this.state.test_res_body}
|
||||
mode={handleContentType(this.state.test_res_header)}
|
||||
// mode="html"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,8 +12,10 @@ const isNode = typeof global == 'object' && global.global === global;
|
||||
const ContentTypeMap = {
|
||||
'application/json': 'json',
|
||||
'application/xml': 'xml',
|
||||
other: 'text',
|
||||
'application/html': 'html'
|
||||
'text/xml': 'xml',
|
||||
'application/html': 'html',
|
||||
'text/html': 'html',
|
||||
other: 'text'
|
||||
};
|
||||
|
||||
async function httpRequestByNode(options) {
|
||||
@ -344,7 +346,6 @@ function handleParams(interfaceData, handleValue, requestParams) {
|
||||
path = path.replace(`{${item.name}}`, val || `{${item.name}}`);
|
||||
});
|
||||
|
||||
|
||||
const urlObj = URL.parse(joinPath(currDomain.domain, path), true);
|
||||
const url = URL.format({
|
||||
protocol: urlObj.protocol || 'http',
|
||||
@ -404,7 +405,7 @@ function handleParams(interfaceData, handleValue, requestParams) {
|
||||
if (requestParams) {
|
||||
requestParams = Object.assign(requestParams, reqBody);
|
||||
}
|
||||
requestBody = handleJson(reqBody, (val)=>handleValue(val, currDomain.global));
|
||||
requestBody = handleJson(reqBody, val => handleValue(val, currDomain.global));
|
||||
}
|
||||
} else {
|
||||
requestBody = interfaceRunData.req_body_other;
|
||||
|
Loading…
x
Reference in New Issue
Block a user