Commit 98353abb by 无尘

fix: 修改配置参数

parent f5c1b480
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>API网关管理平台</title><link href=./static/css/app.89fbf1549a3bfefecdb3d5cea4e653b4.css rel=stylesheet></head><body style="min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script src=//web-1251519181.file.myqcloud.com/components/input.2.0.15.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.01.js></script><script type=text/javascript src=./static/js/manifest.13c52926db4c6ee04949.js></script><script type=text/javascript src=./static/js/vendor.71dc162eb690bf6a36a0.js></script><script type=text/javascript src=./static/js/app.8c17e0f45e015cda57f6.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>API网关管理平台</title><link href=./static/css/app.d3fcfeb21b3d98a0caf66a1a1e9d90c4.css rel=stylesheet></head><body style="min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script src=//web-1251519181.file.myqcloud.com/components/input.2.0.15.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.01.js></script><script type=text/javascript src=./static/js/manifest.9e3c5d7ecc6aa151a16a.js></script><script type=text/javascript src=./static/js/vendor.71dc162eb690bf6a36a0.js></script><script type=text/javascript src=./static/js/app.8c17e0f45e015cda57f6.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,a,c){for(var f,b,d,i=0,u=[];i<r.length;i++)b=r[i],t[b]&&u.push(t[b][0]),t[b]=0;for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&(e[f]=a[f]);for(n&&n(r,a,c);u.length;)u.shift()();if(c)for(i=0;i<c.length;i++)d=o(o.s=c[i]);return d};var r={},t={24:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,o.nc&&c.setAttribute("nonce",o.nc),c.src=o.p+"static/js/"+e+"."+{0:"63d3650fda518fa5d91a",1:"0ebe3ead93207dc78a78",2:"14d09b831fab0ed1464c",3:"37b099013ab5b86e6b1a",4:"83b134741cef8a1fc258",5:"61455822347fda4022ec",6:"7a4f7f41cea5405e209f",7:"b2a85a42ddd430235a63",8:"81460c8c66d06cfea732",9:"9c96ae683c51b04359d0",10:"638039a7b39908980436",11:"f27d1de28264fbbe30ff",12:"ccbc18453e41490e2dba",13:"b109164d2be44afb7733",14:"9825bb69e60b8030c230",15:"ffd723714f3c604ae809",16:"825722b083bcf8e5877e",17:"4786e13164b8fb55cf3b",18:"ebf8edd37453b58275c4",19:"237102ab58f0569908b0",20:"106676f1ed05cab7702b",21:"9811614945523e2ab002"}[e]+".js";var f=setTimeout(b,12e4);function b(){c.onerror=c.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=b,a.appendChild(c),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,a,c){for(var f,b,d,i=0,u=[];i<r.length;i++)b=r[i],t[b]&&u.push(t[b][0]),t[b]=0;for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&(e[f]=a[f]);for(n&&n(r,a,c);u.length;)u.shift()();if(c)for(i=0;i<c.length;i++)d=o(o.s=c[i]);return d};var r={},t={24:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,o.nc&&c.setAttribute("nonce",o.nc),c.src=o.p+"static/js/"+e+"."+{0:"63d3650fda518fa5d91a",1:"0ebe3ead93207dc78a78",2:"e1c029b522ac38d2910e",3:"37b099013ab5b86e6b1a",4:"83b134741cef8a1fc258",5:"61455822347fda4022ec",6:"7a4f7f41cea5405e209f",7:"b2a85a42ddd430235a63",8:"81460c8c66d06cfea732",9:"9c96ae683c51b04359d0",10:"638039a7b39908980436",11:"f27d1de28264fbbe30ff",12:"ccbc18453e41490e2dba",13:"b109164d2be44afb7733",14:"9825bb69e60b8030c230",15:"ffd723714f3c604ae809",16:"825722b083bcf8e5877e",17:"4786e13164b8fb55cf3b",18:"ebf8edd37453b58275c4",19:"237102ab58f0569908b0",20:"106676f1ed05cab7702b",21:"9811614945523e2ab002"}[e]+".js";var f=setTimeout(b,12e4);function b(){c.onerror=c.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=b,a.appendChild(c),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-08-07 18:01:05
* @LastEditors: 无尘
* @LastEditTime: 2019-10-14 17:13:46
* @LastEditTime: 2019-10-15 10:28:32
-->
<!--
<create-backend></create-backend>
......@@ -250,7 +250,7 @@ export default {
dubboInterface: that.copyObj.dubboInterface, // dubbo接口名称
dubboMethod: that.copyObj.dubboMethod, // dubbo请求方法
dubboVersion: that.copyObj.dubboVersion, // dubbo 请求版本号
proxyCode: that.copyObj.proxyCode, // 注册中心
proxyCode: '', //that.copyObj.proxyCode, // 注册中心
timeout: that.copyObj.timeout // 超时
};
});
......@@ -393,7 +393,7 @@ export default {
search: that.searchValue,
pageNum: that.currentPage,
pageSize: 100,
proxyType: that.apiInfoData.interfaceType || 'http'
proxyType: that.apiInfoData.interfaceType || '0'
};
postRequest('/gateway-manage/page-proxy', para)
.then(res => {
......@@ -482,6 +482,15 @@ export default {
that.frontBodyJsonData = JSON.parse(JSON.stringify(frontInfo.bodyJsonData));
// console.log(that.backBodyFormData, that.backBodyJsonData)
}
if (that.apiInfoData.interfaceType == 1) {
that.getEnvSetData();
}
// 判断 dubbo 导入,修改请求,修改参数
if (frontInfo.hasOwnProperty('dubboImport') && frontInfo.dubboImport == 1 ) {
that.apiInfoData.proxyCode = '';
that.apiInfoData.interfaceType = '1';
that.getEnvSetData();
}
that.$forceUpdate();
},
async handleArrObjData(item) {
......@@ -516,6 +525,8 @@ export default {
properties: {}
}
}
}
},
mounted() {
......@@ -523,7 +534,10 @@ export default {
that.getEnvSetData();
that.handleFrontData();
if (Object.keys(that.$store.state.backInfo).length) {
that.handleStoreData();
that.$nextTick(()=>{
that.handleStoreData();
})
}
}
};
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-08-07 17:17:50
* @LastEditors: 无尘
* @LastEditTime: 2019-10-14 18:15:27
* @LastEditTime: 2019-10-15 11:09:46
-->
<!--
<create-base></create-base>
......@@ -306,7 +306,7 @@ export default {
// 是否禁用,不能选择,这里暂时设置一下,后面后端配置中会去重新设置 isRootKeyFlag 这个字段值
item[childKey]['isRootKeyFlag'] = !parentKey.isRootKey || item[childKey]['isRootKey'] ? false : true;
if (item[childKey]['isRootKey']) {
parentKey.isRootKeyFlag = true;
parentKey.isRootKeyFlag = true; // 这里是必须的
}
if (item[childKey].type == 'array' && Object.keys(item[childKey].items.properties).length) {
await that.handleArrObjData(item[childKey].items.properties, item[childKey]);
......@@ -329,6 +329,11 @@ export default {
for (let key in allData.properties) {
allData.properties[key].isRootKey = allData.properties[key].isRootKey == 1 || allData.properties[key].isRootKey == true ? true : false;
allData.properties[key]['isRootKeyFlag'] = false;
// form 判断
if (allData.properties[key].frontOriginType == 'form') {
that.apiInfoData.requestType = 'POST';
that.apiInfoData.frontBodyType = 'form';
}
if (allData.properties[key].frontOriginType == type) {
that.$set(newObj.properties, allData.properties[key].currentKey, allData.properties[key]);
}
......@@ -354,6 +359,12 @@ export default {
that.headerData = await that.handleQuery(allData, 'header');
that.bodyFormData = await that.handleQuery(allData, 'form');
that.bodyJsonData = await that.handleQuery(allData, 'body');
// 设置 post 需要判断
if (allData.properties.hasOwnProperty('bodyRoot')) {
that.apiInfoData.requestType = 'POST';
that.apiInfoData.frontBodyType = 'json';
}
// console.log(that.bodyJsonData);
// 如果返回没有 bodyRoot,需要添加默认的
let bodyJsonData = {
......@@ -414,15 +425,18 @@ export default {
/**
* 处理 提交的 isRootKey
*/
async handleRootKey(item) {
async handleRootKey(item, parentItem) {
const that = this;
for (let childKey in item) {
item[childKey]['isRootKey'] = !item[childKey]['isRootKey'] || item[childKey]['isRootKey'] == '' || item[childKey]['isRootKey'] == 0 ? false : true; // 是否是后端参数字段
if (item[childKey]['isRootKey']) {
parentItem['isRootKey'] = false;
}
if (item[childKey].type == 'array' && Object.keys(item[childKey].items.properties).length) {
await that.handleRootKey(item[childKey].items.properties);
await that.handleRootKey(item[childKey].items.properties, item[childKey]);
}
if (item[childKey].type == 'object' && Object.keys(item[childKey].properties).length) {
await that.handleRootKey(item[childKey].properties);
await that.handleRootKey(item[childKey].properties, item[childKey]);
}
}
return item;
......@@ -449,24 +463,25 @@ export default {
apiBack.dubboInterface = that.dubboData.apiPackage;
apiBack.dubboMethod = that.dubboData.method;
apiBack.interfaceType = '1';
that.apiInfoData.dubboImport = '1'; // 20191015 增加dubbo导入判断字段,前端使用
that.$store.dispatch('saveBackInfo', apiBack);
}
if (that.apiInfoData.requestType == 'POST' && that.apiInfoData.frontBodyType == 'json') {
if (Object.keys(that.bodyJsonData.properties.bodyRoot.properties).length) {
that.bodyJsonData.properties.bodyRoot.required = [];
for (const key in that.bodyJsonData.properties.bodyRoot.properties) {
that.bodyJsonData.properties.bodyRoot.properties[key]['isRootKey'] = that.bodyJsonData.properties.bodyRoot.properties[key]['isRootKey'] == 0 || that.bodyJsonData.properties.bodyRoot.properties[key]['isRootKey'] == false ? false : true;
that.bodyJsonData.properties.bodyRoot.properties[key]['isRootKey'] = !that.bodyJsonData.properties.bodyRoot.properties[key]['isRootKey'] || that.bodyJsonData.properties.bodyRoot.properties[key]['isRootKey'] == 0 || that.bodyJsonData.properties.bodyRoot.properties[key]['isRootKey'] == false ? false : true;
if (that.bodyJsonData.properties.bodyRoot.properties[key].check) {
that.bodyJsonData.properties.bodyRoot.required.push(key);
}
// 如果有数组出现
if (that.bodyJsonData.properties.bodyRoot.properties[key].type == 'array' && Object.keys(that.bodyJsonData.properties.bodyRoot.properties[key].items.properties).length) {
that.bodyJsonData.properties.bodyRoot.properties[key].items.isRootKey = that.bodyJsonData.properties.bodyRoot.properties[key].items.isRootKey == false ? 0 : 1;
await that.handleRootKey(that.bodyJsonData.properties.bodyRoot.properties[key].items.properties);
await that.handleRootKey(that.bodyJsonData.properties.bodyRoot.properties[key].items.properties, that.bodyJsonData.properties.bodyRoot.properties[key]);
}
// 如果有对象出现
if (that.bodyJsonData.properties.bodyRoot.properties[key].type == 'object' && Object.keys(that.bodyJsonData.properties.bodyRoot.properties[key].properties).length) {
await that.handleRootKey(that.bodyJsonData.properties.bodyRoot.properties[key].properties);
await that.handleRootKey(that.bodyJsonData.properties.bodyRoot.properties[key].properties, that.bodyJsonData.properties.bodyRoot.properties[key]);
}
}
}
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-10-09 16:04:09
* @LastEditors: 无尘
* @LastEditTime: 2019-10-10 19:41:54
* @LastEditTime: 2019-10-15 11:00:14
-->
<!--
<import-dubbo
......@@ -25,7 +25,9 @@ import importDubbo from '@/components/createApi/import-dubbo.vue'
<el-input placeholder="请输入内容" prefix-icon="el-icon-search" v-model="apiPackageInput" @keyup.native="value => searchData(value, 'name', apiPackageInput)"> </el-input>
<ul class="el-scrollbar__view el-select-dropdown__list">
<li :class="['el-select-dropdown__item', activePack == item ? 'selected hover' : '']" v-for="(item, index) in apiPackageList" :key="index + 'api'" @click="selectApiPackage(item)">
{{ item }}
<el-tooltip class="item" effect="dark" :content="item" placement="top-start">
<span>{{ item }}</span>
</el-tooltip>
</li>
</ul>
</div>
......@@ -51,7 +53,9 @@ import importDubbo from '@/components/createApi/import-dubbo.vue'
<el-input placeholder="请输入内容" prefix-icon="el-icon-search" v-model="methodInput" @keyup.native="value => searchData(value, 'method', methodInput)"> </el-input>
<ul class="el-scrollbar__view el-select-dropdown__list">
<li :class="['el-select-dropdown__item', activeMethod == item ? 'selected hover' : '']" v-for="(item, index) in methodList" :key="index + 'method'" @click="selectMethod(item)">
{{ item }}
<el-tooltip class="item" effect="dark" :content="item" placement="top-start">
<span>{{ item }}</span>
</el-tooltip>
</li>
</ul>
</div>
......
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