From ca4b902a6cff89b6c600f623d38f59bfd477753d Mon Sep 17 00:00:00 2001 From: Espoir-L <413308430@qq.com> Date: Thu, 15 Nov 2018 13:18:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E5=B9=BF=E5=91=8A=E5=90=88?= =?UTF-8?q?=E5=B9=B6-bugfix=20#314?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mip-custom/data.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mip-custom/data.js b/src/mip-custom/data.js index 351a2ec8b..75d7fd927 100644 --- a/src/mip-custom/data.js +++ b/src/mip-custom/data.js @@ -89,6 +89,8 @@ define(function (require) { if (config.paths) { for (var key in config.paths) { if (config.paths.hasOwnProperty(key)) { + // 防止config中带的地址有多余的domain域名前缀 + config.paths[key] = config.paths[key].replace(config.domain, ''); config.paths[key] = config.domain + config.paths[key]; } } From 8c2141157355331367f5545416a774a8a97411fb Mon Sep 17 00:00:00 2001 From: Espoir-L <413308430@qq.com> Date: Thu, 15 Nov 2018 13:31:39 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=E5=B9=BF=E5=91=8A=E5=90=88?= =?UTF-8?q?=E5=B9=B6-bugfix=20#314?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mip-custom/data.js | 13 ++++++------- src/mip-custom/mip-custom.js | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mip-custom/data.js b/src/mip-custom/data.js index 75d7fd927..0fac86110 100644 --- a/src/mip-custom/data.js +++ b/src/mip-custom/data.js @@ -86,17 +86,16 @@ define(function (require) { } function addPaths(config) { - if (config.paths) { - for (var key in config.paths) { - if (config.paths.hasOwnProperty(key)) { - // 防止config中带的地址有多余的domain域名前缀 - config.paths[key] = config.paths[key].replace(config.domain, ''); - config.paths[key] = config.domain + config.paths[key]; + var customConfig = JSON.parse(JSON.stringify(config)) + if (customConfig.paths) { + for (var key in customConfig.paths) { + if (customConfig.paths.hasOwnProperty(key)) { + customConfig.paths[key] = customConfig.domain + customConfig.paths[key]; } } } - return config; + return customConfig; } /** diff --git a/src/mip-custom/mip-custom.js b/src/mip-custom/mip-custom.js index fe2c7d2ed..2ab114965 100644 --- a/src/mip-custom/mip-custom.js +++ b/src/mip-custom/mip-custom.js @@ -402,6 +402,7 @@ define(function () { */ customElement.prototype.fetchData = function (url, callback, element) { var me = this; + url = 'http://localhost:8080/mock/novelMock?' if (!url) { return; } From 436a012ac1f8af44a4826918efb0b3815c204ecb Mon Sep 17 00:00:00 2001 From: Espoir-L <413308430@qq.com> Date: Thu, 15 Nov 2018 13:32:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E5=B9=BF=E5=91=8A=E5=90=88?= =?UTF-8?q?=E5=B9=B6-bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mip-custom/data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mip-custom/data.js b/src/mip-custom/data.js index 0fac86110..fa0bda2cc 100644 --- a/src/mip-custom/data.js +++ b/src/mip-custom/data.js @@ -86,7 +86,7 @@ define(function (require) { } function addPaths(config) { - var customConfig = JSON.parse(JSON.stringify(config)) + var customConfig = JSON.parse(JSON.stringify(config)); if (customConfig.paths) { for (var key in customConfig.paths) { if (customConfig.paths.hasOwnProperty(key)) { From 87540ffc902ffe61e67d760680774f11b7501e1a Mon Sep 17 00:00:00 2001 From: Espoir-L <413308430@qq.com> Date: Thu, 15 Nov 2018 13:33:13 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=E5=B9=BF=E5=91=8A=E5=90=88?= =?UTF-8?q?=E5=B9=B6-bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mip-custom/mip-custom.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mip-custom/mip-custom.js b/src/mip-custom/mip-custom.js index 2ab114965..fe2c7d2ed 100644 --- a/src/mip-custom/mip-custom.js +++ b/src/mip-custom/mip-custom.js @@ -402,7 +402,6 @@ define(function () { */ customElement.prototype.fetchData = function (url, callback, element) { var me = this; - url = 'http://localhost:8080/mock/novelMock?' if (!url) { return; }