Commit 7308a157 by 无尘

fix: 修改配置

parent 8a44edfe
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>API网关管理平台</title><link href=./static/css/app.44f787ae8267768efac75395f49048c4.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 type=text/javascript src=./static/js/manifest.a97a671a0bd49ff1e018.js></script><script type=text/javascript src=./static/js/vendor.bb8c036d7dd62f4cb37a.js></script><script type=text/javascript src=./static/js/app.f1acc3ac0ff23ced6285.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.5d429efe07e669c38e96e91aabd61e33.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 type=text/javascript src=./static/js/manifest.1bad64526a7edeaffa2c.js></script><script type=text/javascript src=./static/js/vendor.bb8c036d7dd62f4cb37a.js></script><script type=text/javascript src=./static/js/app.6fffa4d913c25914075b.js></script></body></html>
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,o,c){for(var f,d,i,u=0,b=[];u<r.length;u++)d=r[u],t[d]&&b.push(t[d][0]),t[d]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(n&&n(r,o,c);b.length;)b.shift()();if(c)for(u=0;u<c.length;u++)i=a(a.s=c[u]);return i};var r={},t={21:0};function a(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,a),t.l=!0,t.exports}a.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,a){n=t[e]=[r,a]});n[2]=r;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,a.nc&&c.setAttribute("nonce",a.nc),c.src=a.p+"static/js/"+e+"."+{0:"d2aeaa955782b02febee",1:"0ebe3ead93207dc78a78",2:"3fb6634d557a9813d379",3:"8e100d29247c28c8b5c4",4:"e147fece7b5af9883b95",5:"8dade12caa32853912f4",6:"7e47fc9750107d0d7600",7:"6c3d409359dc37c88d9a",8:"6f4aba6d804414b554f1",9:"1a44376fa612d3e18d19",10:"638039a7b39908980436",11:"65b3d46525bbb966f996",12:"cb37adc4b9f63c81ace0",13:"3f70345d9260ae04ca59",14:"9825bb69e60b8030c230",15:"2d238e050fe99b74287d",16:"71781076180fa67766a9",17:"3d53e5aa355f2b62e040",18:"da9b2eee0a0620668dc6"}[e]+".js";var f=setTimeout(d,12e4);function d(){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=d,o.appendChild(c),r},a.m=e,a.c=r,a.d=function(e,n,r){a.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="./",a.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,o,c){for(var f,d,i,u=0,b=[];u<r.length;u++)d=r[u],t[d]&&b.push(t[d][0]),t[d]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(n&&n(r,o,c);b.length;)b.shift()();if(c)for(u=0;u<c.length;u++)i=a(a.s=c[u]);return i};var r={},t={21:0};function a(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,a),t.l=!0,t.exports}a.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,a){n=t[e]=[r,a]});n[2]=r;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,a.nc&&c.setAttribute("nonce",a.nc),c.src=a.p+"static/js/"+e+"."+{0:"d2aeaa955782b02febee",1:"0ebe3ead93207dc78a78",2:"2363fee75c7a17191177",3:"8e100d29247c28c8b5c4",4:"e147fece7b5af9883b95",5:"8dade12caa32853912f4",6:"7e47fc9750107d0d7600",7:"6c3d409359dc37c88d9a",8:"6f4aba6d804414b554f1",9:"1a44376fa612d3e18d19",10:"638039a7b39908980436",11:"65b3d46525bbb966f996",12:"cb37adc4b9f63c81ace0",13:"3f70345d9260ae04ca59",14:"9825bb69e60b8030c230",15:"2d238e050fe99b74287d",16:"71781076180fa67766a9",17:"3d53e5aa355f2b62e040",18:"da9b2eee0a0620668dc6"}[e]+".js";var f=setTimeout(d,12e4);function d(){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=d,o.appendChild(c),r},a.m=e,a.c=r,a.d=function(e,n,r){a.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="./",a.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -110,6 +110,7 @@ export default {
isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值
isRootKey: 0, //是否是后端参数字段
isRootKeyFlag: false, // 是否是后端参数字段 check
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
......@@ -154,6 +155,7 @@ export default {
isBackendField: 0, //是否后端字段
defaultVal: '', //默认值
isRootKey: 0, //是否是后端参数字段
isRootKeyFlag: false, // 是否是后端参数字段 check
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
......
......@@ -13,7 +13,7 @@ import backTableRight from '@/components/createApi/back-table-right.vue';
<div v-if="itemValue.type == 'object' || itemValue.type == 'array'" class="cell"><i class="el-icon-minus"></i></div>
</td>
<td rowspan="1" colspan="1" class="el-table_1_column_1">
<div class="cell"><el-checkbox v-model="itemValue.isRootKey" :disabled="itemData.isRootKey" @change="changeCheck(itemValue, itemName)"></el-checkbox></div>
<div class="cell"><el-checkbox v-model="itemValue.isRootKey" :disabled="itemData.isRootKeyFlag" @change="changeCheck(itemValue, itemName)"></el-checkbox></div>
</td>
<td v-if="interfaceType == '0'" rowspan="1" colspan="1" class="el-table_1_column_1">
<div class="cell">
......@@ -92,34 +92,40 @@ export default {
* 改变checkbox
*/
async changeCheck(obj, key) {
console.log(obj, key);
const that = this;
if (obj.type == 'object' && Object.keys(obj.properties).length) {
obj.isRootKeyFlag = false;
for (let k in obj.properties) {
obj.properties[k].isRootKey = true;
if (obj.properties[k].type == 'object' && Object.keys(obj[k].properties).length) {
await that.checkArrObjData(obj[k].properties);
obj.properties[k].isRootKeyFlag = true;
that.$set(obj.properties[k], 'isRootKeyFlag', true);
if (obj.properties[k].type == 'object' && Object.keys(obj.properties[k].properties).length) {
await that.checkArrObjData(obj.properties[k].properties);
}
}
}
if (obj.type == 'array' && Object.keys(obj.items.properties).length) {
for (let k in obj.items.properties) {
obj.items.properties[k].isRootKey = true;
if (obj.properties[k].type == 'array' && Object.keys(obj[k].items.properties).length) {
await that.checkArrObjData(obj[k].items.properties);
obj.isRootKeyFlag = false;
for (let key in obj.items.properties) {
obj.items.properties[key].isRootKeyFlag = true;
if (obj.properties[key].type == 'array' && Object.keys(obj.items.properties[key].properties).length) {
await that.checkArrObjData(obj.items.properties[key].properties);
}
}
}
that.$forceUpdate();
},
async checkArrObjData(item) {
const that = this;
for (let k in item) {
item[k].isRootKey = true;
item[k].isRootKeyFlag = true;
if (item[k].type == 'object' && Object.keys(item[k].properties).length) {
item[k].isRootKey = true;
item[k].isRootKeyFlag = true;
await that.checkArrObjData(item[k].properties);
}
if (item[k].type == 'array' && Object.keys(item[k].items.properties).length) {
item[k].isRootKey = true;
item[k].isRootKeyFlag = true;
await that.checkArrObjData(item[k].items.properties);
}
}
......
......@@ -133,6 +133,7 @@ export default {
isBackendField: 0, //是否后端字段
defaultVal: '', //默认值
isRootKey: 0, //是否是后端参数字段
isRootKeyFlag: false, // 是否是后端参数字段 check
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
......@@ -163,6 +164,7 @@ export default {
isBackendField: 0, // 是否后端字段
defaultVal: '', // 默认值
isRootKey: 0, // 是否是后端参数字段
isRootKeyFlag: false, // 是否是后端参数字段 check
rootKey: '', // 后端参数字段
objectClass: '', // 如果是object 并且是dubbo
description: '描述',
......@@ -185,6 +187,7 @@ export default {
isBackendField: 0, // 是否后端字段
defaultVal: '', // 默认值
isRootKey: 0, // 是否是后端参数字段
isRootKeyFlag: false, // 是否是后端参数字段 check
rootKey: '', // 后端参数字段
objectClass: '', // 如果是object 并且是dubbo
description: '描述',
......
......@@ -367,11 +367,11 @@ export default {
async handleFrontData() {
const that = this;
let frontInfo = JSON.parse(JSON.stringify(that.$store.state.frontInfo));
// console.log('header 数据:', frontInfo);
console.log('header 数据:', frontInfo);
// header 数据
if (Object.keys(frontInfo.headerData).length) {
for (let key in frontInfo.headerData.properties) {
frontInfo.headerData.properties[key]['isRootKey'] = true; // 是否是后端参数字段
frontInfo.headerData.properties[key]['isRootKey'] = frontInfo.headerData.properties[key]['isRootKey'] !== '' ? frontInfo.headerData.properties[key]['isRootKey'] :true; // 是否是后端参数字段
frontInfo.headerData.properties[key]['rootKey'] = frontInfo.headerData.properties[key]['rootKey'] ? frontInfo.headerData.properties[key]['rootKey'] : key; // 后端参数字段
frontInfo.headerData.properties[key]['backendOriginType'] = frontInfo.headerData.properties[key]['backendOriginType'];
frontInfo.headerData.properties[key]['isBackendField'] = 1; // 是否后端字段
......@@ -384,7 +384,7 @@ export default {
// query 数据
if (Object.keys(frontInfo.queryData).length) {
for (let key in frontInfo.queryData.properties) {
frontInfo.queryData.properties[key]['isRootKey'] = true; // 是否是后端参数字段
frontInfo.queryData.properties[key]['isRootKey'] = frontInfo.queryData.properties[key]['isRootKey'] !== '' ? frontInfo.queryData.properties[key]['isRootKey'] : true; // 是否是后端参数字段
frontInfo.queryData.properties[key]['rootKey'] = frontInfo.queryData.properties[key]['rootKey'] ? frontInfo.queryData.properties[key]['rootKey'] : key; // 后端参数字段
frontInfo.queryData.properties[key]['backendOriginType'] = frontInfo.queryData.properties[key]['backendOriginType'];
frontInfo.queryData.properties[key]['isBackendField'] = 1; // 是否后端字段
......@@ -397,7 +397,7 @@ export default {
// body form 数据
if (Object.keys(frontInfo.bodyFormData).length) {
for (let key in frontInfo.bodyFormData.properties) {
frontInfo.bodyFormData.properties[key]['isRootKey'] = true; // 是否是后端参数字段
frontInfo.bodyFormData.properties[key]['isRootKey'] = frontInfo.bodyFormData.properties[key]['isRootKey'] !== '' ? frontInfo.bodyFormData.properties[key]['isRootKey'] : true; // 是否是后端参数字段
frontInfo.bodyFormData.properties[key]['rootKey'] = frontInfo.bodyFormData.properties[key]['rootKey'] ? frontInfo.bodyFormData.properties[key]['rootKey'] : key; // 后端参数字段
frontInfo.bodyFormData.properties[key]['backendOriginType'] = frontInfo.bodyFormData.properties[key]['backendOriginType'];
frontInfo.bodyFormData.properties[key]['isBackendField'] = 1; // 是否后端字段
......@@ -410,7 +410,7 @@ export default {
// body json 数据
if (Object.keys(frontInfo.bodyJsonData).length) {
for (let key in frontInfo.bodyJsonData.properties) {
frontInfo.bodyJsonData.properties[key]['isRootKey'] = true; // 是否是后端参数字段
frontInfo.bodyJsonData.properties[key]['isRootKey'] = frontInfo.bodyJsonData.properties[key]['isRootKey'] !== ''? frontInfo.bodyJsonData.properties[key]['isRootKey'] : true; // 是否是后端参数字段
frontInfo.bodyJsonData.properties[key]['rootKey'] = frontInfo.bodyJsonData.properties[key]['rootKey'] ? frontInfo.bodyJsonData.properties[key]['rootKey'] : key; // 后端参数字段
frontInfo.bodyJsonData.properties[key]['backendOriginType'] = frontInfo.bodyJsonData.properties[key]['backendOriginType'];
frontInfo.bodyJsonData.properties[key]['isBackendField'] = 1; // 是否后端字段
......@@ -434,15 +434,16 @@ export default {
async handleArrObjData(item) {
const that = this;
for (let childKey in item) {
item[childKey]['isRootKey'] = false; // 是否是后端参数字段
item[childKey]['isRootKey'] = item[childKey]['isRootKey'] !== ''? item[childKey]['isRootKey'] : true; // 是否是后端参数字段
item[childKey]['isRootKeyFlag'] = true; // 是否是后端参数字段
item[childKey]['rootKey'] = item[childKey]['rootKey'] ? item[childKey]['rootKey'] : childKey;
item[childKey]['isBackendField'] = 1; // 是否后端字段
if(item[childKey].type == 'array' && Object.keys(item[childKey].items.properties).length){
item[childKey]['isRootKey'] = true;
item[childKey]['isRootKeyFlag'] = true;
await that.handleArrObjData(item[childKey].items.properties);
}
if(item[childKey].type == 'object' && Object.keys(item[childKey].properties).length) {
item[childKey]['isRootKey'] = true;
item[childKey]['isRootKeyFlag'] = true;
await that.handleArrObjData(item[childKey].properties);
}
}
......
......@@ -164,9 +164,9 @@ export default {
type: 'object',
level: 1,
properties: {
root: {
bodyRoot: {
level: 2,
currentKey: 'root',
currentKey: 'bodyRoot',
frontOriginType: 'body', //来源类型 query,body,header
backendOriginType: 'body',
type: 'object',
......@@ -252,11 +252,11 @@ export default {
}
if (that.apiInfoData.requestType == 'POST' && that.apiInfoData.frontBodyType == 'json') {
if (Object.keys(that.bodyJsonData.properties.root.properties).length) {
that.bodyJsonData.properties.root.required = [];
for (const key in that.bodyJsonData.properties.root.properties) {
if (that.bodyJsonData.properties.root.properties[key].check) {
that.bodyJsonData.properties.root.required.push(key);
if (Object.keys(that.bodyJsonData.properties.bodyRoot.properties).length) {
that.bodyJsonData.properties.bodyRoot.required = [];
for (const key in that.bodyJsonData.properties.bodyRoot.properties) {
if (that.bodyJsonData.properties.bodyRoot.properties[key].check) {
that.bodyJsonData.properties.bodyRoot.required.push(key);
}
}
}
......@@ -308,9 +308,9 @@ export default {
type: 'object',
level: 1,
properties: {
root: {
bodyRoot: {
level: 2,
currentKey: 'root',
currentKey: 'bodyRoot',
frontOriginType: 'body', //来源类型 query,body,header
backendOriginType: 'body',
type: 'object',
......@@ -331,9 +331,9 @@ export default {
type: 'object',
level: 1,
properties: {
form: {
bodyForm: {
level: 2,
currentKey: 'form',
currentKey: 'bodyForm',
frontOriginType: 'body', //来源类型 query,body,header
backendOriginType: 'body',
type: 'string',
......
......@@ -239,11 +239,11 @@ export default {
let front = JSON.parse(JSON.stringify(that.$store.state.frontInfo));
obj.properties = Object.assign(front.queryData.properties, front.headerData.properties);
if (front.requestType == 'POST' && front.frontBodyType == 'json') {
if (Object.keys(front.bodyJsonData.properties.root.properties).length) {
front.bodyJsonData.properties.root.required = [];
for (const key in front.bodyJsonData.properties.root.properties) {
if (front.bodyJsonData.properties.root.properties[key].check) {
front.bodyJsonData.properties.root.required.push(key);
if (Object.keys(front.bodyJsonData.properties.bodyRoot.properties).length) {
front.bodyJsonData.properties.bodyRoot.required = [];
for (const key in front.bodyJsonData.properties.bodyRoot.properties) {
if (front.bodyJsonData.properties.bodyRoot.properties[key].check) {
front.bodyJsonData.properties.bodyRoot.required.push(key);
}
}
}
......@@ -280,11 +280,11 @@ export default {
let front = JSON.parse(JSON.stringify(that.$store.state.frontInfo));
obj.properties = Object.assign(back.backQueryData.properties, back.backHeaderData.properties, back.constData.properties);
if (front.requestType == 'POST' && front.frontBodyType == 'json') {
if (Object.keys(back.backBodyJsonData.properties.root.properties).length) {
back.backBodyJsonData.properties.root.required = [];
for (const key in back.backBodyJsonData.properties.root.properties) {
if (back.backBodyJsonData.properties.root.properties[key].check) {
back.backBodyJsonData.properties.root.required.push(key);
if (Object.keys(back.backBodyJsonData.properties.bodyRoot.properties).length) {
back.backBodyJsonData.properties.bodyRoot.required = [];
for (const key in back.backBodyJsonData.properties.bodyRoot.properties) {
if (back.backBodyJsonData.properties.bodyRoot.properties[key].check) {
back.backBodyJsonData.properties.bodyRoot.required.push(key);
}
}
}
......
......@@ -118,6 +118,7 @@ export default {
isBackendField: 0, //是否后端字段
defaultVal: '', //默认值
isRootKey: 0, //是否是后端参数字段
isRootKeyFlag: false, // 是否是后端参数字段 check
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
......@@ -158,6 +159,7 @@ export default {
isBackendField: 0, //是否后端字段
defaultVal: 'val', //默认值
isRootKey: 0, //是否是后端参数字段
isRootKeyFlag: false, // 是否是后端参数字段 check
rootKey: '', //后端参数字段
objectClass: '', //如果是object 并且是dubbo
description: '描述',
......
......@@ -30,6 +30,9 @@ const dateFormat = function(timeSpan, format) {
* @param timestamp
*/
const formatTimeStamp = function(data) {
if (!data) {
return;
}
let date = new Date(data);
let month = date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
......@@ -45,6 +48,9 @@ const formatTimeStamp = function(data) {
* @param timestamp
*/
const timeStampToYmd = function(data) {
if (!data) {
return;
}
let date = new Date(data);
let month = date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
......@@ -57,6 +63,9 @@ const timeStampToYmd = function(data) {
* @param timestamp
*/
const timeStampToHms = function(data) {
if (!data) {
return;
}
let date = new Date(data);
let hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
let minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
......
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