{"size": 1209, "ext": "js", "max_stars_repo_path": "mvcApp.js", "max_stars_repo_name": "myachao/wframe", "max_stars_repo_stars_event_min_datetime": "2018-06-08T03:53:27.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-24T07:04:24.000Z", "max_issues_repo_path": "mvcApp.js", "max_issues_repo_name": "myachao/wframe", "max_issues_repo_issues_event_min_datetime": "2018-06-21T02:54:53.000Z", "max_issues_repo_issues_event_max_datetime": "2018-07-04T06:21:41.000Z", "max_forks_repo_path": "mvcApp.js", "max_forks_repo_name": "myachao/wframe", "max_forks_repo_forks_event_min_datetime": "2018-06-08T03:42:47.000Z", "max_forks_repo_forks_event_max_datetime": "2020-07-24T03:14:43.000Z"}
{"max_stars_count": 22, "max_issues_count": 1, "max_forks_count": 13, "avg_line_length": 26.8666666667, "max_line_length": 82, "alphanum_fraction": 0.5955334988}

var WebClient = require('_core/http/WebClient.js');
var ArrayExtensions = require('_core/extensions/ArrayExtensions.js');

var mvcApp = {
	weixin: require('_core/weixin.js'),
	ajax: {
		busyPost: function (url, data, callback, busyText, onlyCallbackOnSuccess) {
			var app = getApp();
			var client = new WebClient();
			if (app.accessToken != null) {
				client.setHeader("X-ACCESSTOKEN", app.accessToken);
			}
			client.post(app.host + url, data, callback, busyText, onlyCallbackOnSuccess);
		}
	},
	serializeToKeyValues: function (obj, prefix) {
		var me = this;
		var text = '';
		prefix = prefix == null ? "" : prefix;
		for (var p in obj) {
			if (!obj.hasOwnProperty(p)) {
				continue;
			}
			var value = obj[p];
			if (value instanceof Array) {
				for (var i = 0; i < value.length; i++) {
					text += "&" + me.serializeToKeyValues(value[i], prefix + p + "[" + i + "].");
				}
			}
			else if (typeof value === "object") {
				text += me.serializeToKeyValues(value, prefix + p + ".");
			}
			else if (typeof value !== "function") {
				text += "&" + prefix + p + "=" + value;
			}
		}
		if (text.indexOf("&") === 0) {
			text = text.substr(1);
		}
		return text;
	}
};

module.exports = mvcApp;