Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 广告合并-bugfix #314 #1287

Merged
merged 4 commits into from
Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/mip-custom/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,16 @@ define(function (require) {
}

function addPaths(config) {
if (config.paths) {
for (var key in config.paths) {
if (config.paths.hasOwnProperty(key)) {
config.paths[key] = config.domain + config.paths[key];
var customConfig = JSON.parse(JSON.stringify(config));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是啥操作?为什么需要stringify然后在parse?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

深克隆这个对象,并且赋给新的一个变量

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;
}

/**
Expand Down