加入脏数据检查机制

This commit is contained in:
CPPAlien 2018-07-26 15:44:56 +08:00
parent 8747d18904
commit eb59d29a44
3 changed files with 1695 additions and 1 deletions

1692
lib/underscore.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,10 @@
function isValidUrl(url) { function isValidUrl(url) {
return /(ht|f)tp(s?):\/\/([^ \\/]*\.)+[^ \\/]*(:[0-9]+)?\/?/.test(url); return /(ht|f)tp(s?):\/\/([^ \\/]*\.)+[^ \\/]*(:[0-9]+)?\/?/.test(url);
} }
module.exports = { module.exports = {
isValidUrl, isValidUrl,
...require('./underscore'),
}; };

View File

@ -52,7 +52,7 @@ Component({
}, },
isNeedRefresh(newVal, oldVal) { isNeedRefresh(newVal, oldVal) {
if (!newVal) { if (!newVal || this.isEmpty(newVal) || util.isEqual(newVal, oldVal)) {
return false; return false;
} }
return true; return true;