|
530 | 530 | isExportRemote: false, |
531 | 531 | isRegister: false, |
532 | 532 | isMLEnabled: false, |
| 533 | + isDelegateEnabled: false, |
533 | 534 | isLocalShow: false, |
534 | 535 | exTxt: { |
535 | 536 | name: 'APIJSON测试', |
|
926 | 927 | App.isRandomShow = show |
927 | 928 | App.saveCache('', 'isRandomShow', show) |
928 | 929 | break |
| 930 | + case 9: |
| 931 | + App.isDelegateEnabled = show |
| 932 | + App.saveCache('', 'isDelegateEnabled', show) |
| 933 | + break |
929 | 934 | } |
930 | 935 | } |
931 | 936 | else if (index == 3) { |
|
944 | 949 | App.isRandomShow = show |
945 | 950 | App.saveCache('', 'isRandomShow', show) |
946 | 951 | } |
| 952 | + else if (index == 9) { |
| 953 | + App.isDelegateEnabled = show |
| 954 | + App.saveCache('', 'isDelegateEnabled', show) |
| 955 | + } |
947 | 956 | }, |
948 | 957 |
|
949 | 958 | // 显示删除弹窗 |
|
2255 | 2264 | // axios.defaults.withcredentials = true |
2256 | 2265 | axios({ |
2257 | 2266 | method: (type == REQUEST_TYPE_PARAM ? 'get' : 'post'), |
2258 | | - url: StringUtil.noBlank(url), |
| 2267 | + url: (isAdminOperation == false && this.isDelegateEnabled ? (this.server + '/delegate?$_delegate_url=') : '' ) + StringUtil.noBlank(url), |
2259 | 2268 | params: (type == REQUEST_TYPE_JSON ? null : req), |
2260 | 2269 | data: (type == REQUEST_TYPE_JSON ? req : null), |
2261 | 2270 | headers: header, |
|
2868 | 2877 | }, |
2869 | 2878 |
|
2870 | 2879 | enableML: function (enable) { |
2871 | | - App.isMLEnabled = enable |
2872 | | - App.testProcess = enable ? '机器学习:已开启' : '机器学习:已关闭' |
2873 | | - App.saveCache(App.server, 'isMLEnabled', enable) |
2874 | | - App.remotes = null |
2875 | | - App.showTestCase(true, false) |
| 2880 | + this.isMLEnabled = enable |
| 2881 | + this.testProcess = enable ? '机器学习:已开启' : '机器学习:已关闭' |
| 2882 | + this.saveCache(App.server, 'isMLEnabled', enable) |
| 2883 | + this.remotes = null |
| 2884 | + this.showTestCase(true, false) |
2876 | 2885 | }, |
2877 | 2886 |
|
2878 | 2887 | /**随机测试,动态替换键值对 |
|
3569 | 3578 |
|
3570 | 3579 | this.locals = this.getCache('', 'locals') || [] |
3571 | 3580 |
|
3572 | | - this.isHeaderShow = (this.getCache('', 'isHeaderShow')) || false |
3573 | | - this.isRandomShow = (this.getCache('', 'isRandomShow')) || false |
| 3581 | + this.isDelegateEnabled = this.getCache('', 'isDelegateEnabled') || this.isDelegateEnabled |
| 3582 | + this.isHeaderShow = this.getCache('', 'isHeaderShow') || this.isHeaderShow |
| 3583 | + this.isRandomShow = this.getCache('', 'isRandomShow') || this.isRandomShow |
3574 | 3584 | } catch (e) { |
3575 | 3585 | console.log('created try { ' + |
3576 | 3586 | '\nvar url = this.getCache(, url) ...' + |
|
3590 | 3600 |
|
3591 | 3601 | try { //可能URL_BASE是const类型,不允许改,这里是初始化,不能出错 |
3592 | 3602 | this.User = this.getCache(this.server, 'User') || {} |
3593 | | - this.isMLEnabled = this.getCache(this.server, 'isMLEnabled') |
| 3603 | + this.isMLEnabled = this.getCache(this.server, 'isMLEnabled') || this.isMLEnabled |
3594 | 3604 | this.testProcess = this.isMLEnabled ? '机器学习:已开启' : '机器学习:已关闭' |
3595 | 3605 | } catch (e) { |
3596 | 3606 | console.log('created try { ' + |
|
0 commit comments