// to.js export default function to(promise) { return promise.then(data => { return [null, data]; }) .catch(err => [err]); } /*用正则表达式实现html转码*/ function htmlEncodeByRegExp(str){ var s = ""; if(str.length == 0) return ""; s = str.replace(/&/g,"&"); s = s.replace(//g,">"); s = s.re...