Browse Source

mark

hyperf
chenlong 1 year ago
parent
commit
dd3ea22536
  1. 20
      View/Document/view.blade.php

20
View/Document/view.blade.php

@ -411,8 +411,9 @@
lineWrapping: true lineWrapping: true
}); });
this.scriptBeforeRequestEl.on('blur', function (codemirror) { this.scriptBeforeRequestEl.on('blur', (codemirror) => {
localStorage.setItem("ScBefore", codemirror.getValue()); localStorage.setItem("ScBefore", codemirror.getValue());
this.scriptBeforeRequest = codemirror.getValue();
}); });
setTimeout(() => { setTimeout(() => {
@ -430,8 +431,9 @@
styleActiveLine: true, styleActiveLine: true,
lineWrapping: true, lineWrapping: true,
}); });
this.scriptAfterRequestEl.on('blur', function (codemirror) { this.scriptAfterRequestEl.on('blur', (codemirror) => {
localStorage.setItem("ScAfter", codemirror.getValue()); localStorage.setItem("ScAfter", codemirror.getValue());
this.scriptBeforeRequest = codemirror.getValue();
}); });
setTimeout(() => { setTimeout(() => {
@ -455,22 +457,18 @@
} }
let ApiInfo = JSON.parse(JSON.stringify(this.currentApiInfo)); let ApiInfo = JSON.parse(JSON.stringify(this.currentApiInfo));
if (this.scriptBeforeRequestEl){ {
(function (){ eval(this.scriptBeforeRequest);
let script = APP.scriptBeforeRequestEl ? APP.scriptBeforeRequestEl.getValue() : this.scriptBeforeRequest;
eval(script);
})();
} }
axios(requestData).then(res => { axios(requestData).then(res => {
this.response = res.data; this.response = res.data;
this.sendIcon = 'el-icon-s-promotion'; this.sendIcon = 'el-icon-s-promotion';
this.responseJsonHandle(); this.responseJsonHandle();
(function (){ {
let response = JSON.parse(JSON.stringify(res.data)); let response = JSON.parse(JSON.stringify(res.data));
let script = APP.scriptAfterRequestEl ? APP.scriptAfterRequestEl.getValue() : this.scriptAfterRequest; eval(this.scriptAfterRequest);
eval(script); }
})();
}).catch((error) => { }).catch((error) => {
this.response = error; this.response = error;
this.sendIcon = 'el-icon-s-promotion'; this.sendIcon = 'el-icon-s-promotion';

Loading…
Cancel
Save