|
@@ -904,7 +904,7 @@ function initData(vueOptions, context) {
|
|
try {
|
|
try {
|
|
data = data.call(context); // 支持 Vue.prototype 上挂的数据
|
|
data = data.call(context); // 支持 Vue.prototype 上挂的数据
|
|
} catch (e) {
|
|
} catch (e) {
|
|
- if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
|
|
|
|
|
|
+ if (Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
|
|
console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
|
|
console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1937,7 +1937,7 @@ function normalizeComponent (
|
|
|
|
|
|
/***/ 11:
|
|
/***/ 11:
|
|
/*!***************************************************!*\
|
|
/*!***************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/store/index.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/store/index.js ***!
|
|
\***************************************************/
|
|
\***************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -3933,7 +3933,7 @@ var index = {
|
|
|
|
|
|
/***/ 16:
|
|
/***/ 16:
|
|
/*!******************************************************!*\
|
|
/*!******************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/common/request.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/common/request.js ***!
|
|
\******************************************************/
|
|
\******************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -4233,7 +4233,7 @@ var uploadFiles = function uploadFiles(url, files, data, showloading) {
|
|
|
|
|
|
/***/ 17:
|
|
/***/ 17:
|
|
/*!**************************************************!*\
|
|
/*!**************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/common/env.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/common/env.js ***!
|
|
\**************************************************/
|
|
\**************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -4247,7 +4247,7 @@ exports.envHost = envHost;var imgHost = 'https://zhengda.oss-cn-chengdu.aliyuncs
|
|
|
|
|
|
/***/ 18:
|
|
/***/ 18:
|
|
/*!***************************************************!*\
|
|
/*!***************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/common/user.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/common/user.js ***!
|
|
\***************************************************/
|
|
\***************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -4382,20 +4382,40 @@ function checkLogin() {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function islogin(res) {
|
|
|
|
+ if (res.status == 401) {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: "提示",
|
|
|
|
+ content: "暂未登录,请登录",
|
|
|
|
+ showCancel: false,
|
|
|
|
+ confirmText: "去登录",
|
|
|
|
+ success: function success(re) {
|
|
|
|
+ if (re.confirm) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: "/pages/login/login" });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } });
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
module.exports = {
|
|
loginByWeixin: loginByWeixin,
|
|
loginByWeixin: loginByWeixin,
|
|
loginByWeixinCode: loginByWeixinCode,
|
|
loginByWeixinCode: loginByWeixinCode,
|
|
- checkLogin: checkLogin };
|
|
|
|
|
|
+ checkLogin: checkLogin,
|
|
|
|
+ islogin: islogin };
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
/***/ 19:
|
|
/***/ 19:
|
|
/*!***************************************************!*\
|
|
/*!***************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/common/util.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/common/util.js ***!
|
|
\***************************************************/
|
|
\***************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -5345,11 +5365,13 @@ Dep.SharedObject.targetStack = [];
|
|
function pushTarget (target) {
|
|
function pushTarget (target) {
|
|
Dep.SharedObject.targetStack.push(target);
|
|
Dep.SharedObject.targetStack.push(target);
|
|
Dep.SharedObject.target = target;
|
|
Dep.SharedObject.target = target;
|
|
|
|
+ Dep.target = target;
|
|
}
|
|
}
|
|
|
|
|
|
function popTarget () {
|
|
function popTarget () {
|
|
Dep.SharedObject.targetStack.pop();
|
|
Dep.SharedObject.targetStack.pop();
|
|
Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
|
|
Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
|
|
|
|
+ Dep.target = Dep.SharedObject.target;
|
|
}
|
|
}
|
|
|
|
|
|
/* */
|
|
/* */
|
|
@@ -10118,7 +10140,7 @@ function type(obj) {
|
|
|
|
|
|
function flushCallbacks$1(vm) {
|
|
function flushCallbacks$1(vm) {
|
|
if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
|
|
if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
|
|
- if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
|
|
|
|
|
|
+ if (Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
|
|
var mpInstance = vm.$scope;
|
|
var mpInstance = vm.$scope;
|
|
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
|
|
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
|
|
']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
|
|
']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
|
|
@@ -10139,14 +10161,14 @@ function nextTick$1(vm, cb) {
|
|
//1.nextTick 之前 已 setData 且 setData 还未回调完成
|
|
//1.nextTick 之前 已 setData 且 setData 还未回调完成
|
|
//2.nextTick 之前存在 render watcher
|
|
//2.nextTick 之前存在 render watcher
|
|
if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
|
|
if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
|
|
- if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
|
|
|
|
|
|
+ if(Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
|
|
var mpInstance = vm.$scope;
|
|
var mpInstance = vm.$scope;
|
|
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
|
|
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
|
|
']:nextVueTick');
|
|
']:nextVueTick');
|
|
}
|
|
}
|
|
return nextTick(cb, vm)
|
|
return nextTick(cb, vm)
|
|
}else{
|
|
}else{
|
|
- if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
|
|
|
|
|
|
+ if(Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
|
|
var mpInstance$1 = vm.$scope;
|
|
var mpInstance$1 = vm.$scope;
|
|
console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
|
|
console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
|
|
']:nextMPTick');
|
|
']:nextMPTick');
|
|
@@ -10190,13 +10212,14 @@ function cloneWithData(vm) {
|
|
}, ret);
|
|
}, ret);
|
|
|
|
|
|
// vue-composition-api
|
|
// vue-composition-api
|
|
- var rawBindings = vm.__secret_vfa_state__ && vm.__secret_vfa_state__.rawBindings;
|
|
|
|
|
|
+ var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
|
|
|
|
+ var rawBindings = compositionApiState && compositionApiState.rawBindings;
|
|
if (rawBindings) {
|
|
if (rawBindings) {
|
|
Object.keys(rawBindings).forEach(function (key) {
|
|
Object.keys(rawBindings).forEach(function (key) {
|
|
ret[key] = vm[key];
|
|
ret[key] = vm[key];
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
//TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
|
|
//TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
|
|
Object.assign(ret, vm.$mp.data || {});
|
|
Object.assign(ret, vm.$mp.data || {});
|
|
if (
|
|
if (
|
|
@@ -10231,7 +10254,7 @@ var patch = function(oldVnode, vnode) {
|
|
});
|
|
});
|
|
var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
|
|
var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
|
|
if (Object.keys(diffData).length) {
|
|
if (Object.keys(diffData).length) {
|
|
- if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
|
|
|
|
|
|
+ if (Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
|
|
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
|
|
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
|
|
']差量更新',
|
|
']差量更新',
|
|
JSON.stringify(diffData));
|
|
JSON.stringify(diffData));
|
|
@@ -10640,7 +10663,7 @@ internalMixin(Vue);
|
|
|
|
|
|
/***/ 20:
|
|
/***/ 20:
|
|
/*!******************************************************!*\
|
|
/*!******************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/index.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/index.js ***!
|
|
\******************************************************/
|
|
\******************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -10787,7 +10810,7 @@ var install = function install(Vue) {
|
|
|
|
|
|
/***/ 21:
|
|
/***/ 21:
|
|
/*!*****************************************************************!*\
|
|
/*!*****************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/mixin/mixin.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/mixin/mixin.js ***!
|
|
\*****************************************************************/
|
|
\*****************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -10843,7 +10866,7 @@ var install = function install(Vue) {
|
|
|
|
|
|
/***/ 22:
|
|
/***/ 22:
|
|
/*!*******************************************************************!*\
|
|
/*!*******************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/request/index.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/request/index.js ***!
|
|
\*******************************************************************/
|
|
\*******************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11024,7 +11047,7 @@ new Request();exports.default = _default;
|
|
|
|
|
|
/***/ 23:
|
|
/***/ 23:
|
|
/*!************************************************************************!*\
|
|
/*!************************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/deepMerge.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/deepMerge.js ***!
|
|
\************************************************************************/
|
|
\************************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11065,7 +11088,7 @@ deepMerge;exports.default = _default;
|
|
|
|
|
|
/***/ 24:
|
|
/***/ 24:
|
|
/*!************************************************************************!*\
|
|
/*!************************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/deepClone.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/deepClone.js ***!
|
|
\************************************************************************/
|
|
\************************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11099,7 +11122,7 @@ deepClone;exports.default = _default;
|
|
|
|
|
|
/***/ 25:
|
|
/***/ 25:
|
|
/*!*******************************************************************!*\
|
|
/*!*******************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/test.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/test.js ***!
|
|
\*******************************************************************/
|
|
\*******************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11342,7 +11365,7 @@ function code(value) {var len = arguments.length > 1 && arguments[1] !== undefin
|
|
|
|
|
|
/***/ 26:
|
|
/***/ 26:
|
|
/*!**************************************************************************!*\
|
|
/*!**************************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/queryParams.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/queryParams.js ***!
|
|
\**************************************************************************/
|
|
\**************************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11411,7 +11434,7 @@ queryParams;exports.default = _default;
|
|
|
|
|
|
/***/ 27:
|
|
/***/ 27:
|
|
/*!********************************************************************!*\
|
|
/*!********************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/route.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/route.js ***!
|
|
\********************************************************************/
|
|
\********************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11508,7 +11531,7 @@ route;exports.default = _default;
|
|
|
|
|
|
/***/ 28:
|
|
/***/ 28:
|
|
/*!*************************************************************************!*\
|
|
/*!*************************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/timeFormat.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/timeFormat.js ***!
|
|
\*************************************************************************/
|
|
\*************************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11571,7 +11594,7 @@ timeFormat;exports.default = _default;
|
|
|
|
|
|
/***/ 29:
|
|
/***/ 29:
|
|
/*!***********************************************************************!*\
|
|
/*!***********************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/timeFrom.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/timeFrom.js ***!
|
|
\***********************************************************************/
|
|
\***********************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11659,7 +11682,7 @@ module.exports = g;
|
|
|
|
|
|
/***/ 30:
|
|
/***/ 30:
|
|
/*!****************************************************************************!*\
|
|
/*!****************************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/colorGradient.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/colorGradient.js ***!
|
|
\****************************************************************************/
|
|
\****************************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11769,7 +11792,7 @@ function rgbToHex(rgb) {
|
|
|
|
|
|
/***/ 31:
|
|
/***/ 31:
|
|
/*!*******************************************************************!*\
|
|
/*!*******************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/guid.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/guid.js ***!
|
|
\*******************************************************************/
|
|
\*******************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11821,7 +11844,7 @@ guid;exports.default = _default;
|
|
|
|
|
|
/***/ 32:
|
|
/***/ 32:
|
|
/*!********************************************************************!*\
|
|
/*!********************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/color.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/color.js ***!
|
|
\********************************************************************/
|
|
\********************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11869,7 +11892,7 @@ color;exports.default = _default;
|
|
|
|
|
|
/***/ 33:
|
|
/***/ 33:
|
|
/*!************************************************************************!*\
|
|
/*!************************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/type2icon.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/type2icon.js ***!
|
|
\************************************************************************/
|
|
\************************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11913,9 +11936,27 @@ type2icon;exports.default = _default;
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
-/***/ 338:
|
|
|
|
|
|
+/***/ 34:
|
|
|
|
+/*!**************************************************************************!*\
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/randomArray.js ***!
|
|
|
|
+ \**************************************************************************/
|
|
|
|
+/*! no static exports found */
|
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
+
|
|
|
|
+"use strict";
|
|
|
|
+Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
|
|
|
|
+function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
|
|
+ // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
|
|
|
|
+ return array.sort(function () {return Math.random() - 0.5;});
|
|
|
|
+}var _default =
|
|
|
|
+
|
|
|
|
+randomArray;exports.default = _default;
|
|
|
|
+
|
|
|
|
+/***/ }),
|
|
|
|
+
|
|
|
|
+/***/ 347:
|
|
/*!******************************************************************!*\
|
|
/*!******************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/util/emitter.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/util/emitter.js ***!
|
|
\******************************************************************/
|
|
\******************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -11973,27 +12014,9 @@ function _broadcast(componentName, eventName, params) {
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
-/***/ 34:
|
|
|
|
-/*!**************************************************************************!*\
|
|
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/randomArray.js ***!
|
|
|
|
- \**************************************************************************/
|
|
|
|
-/*! no static exports found */
|
|
|
|
-/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
-
|
|
|
|
-"use strict";
|
|
|
|
-Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
|
|
|
|
-function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
|
|
- // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
|
|
|
|
- return array.sort(function () {return Math.random() - 0.5;});
|
|
|
|
-}var _default =
|
|
|
|
-
|
|
|
|
-randomArray;exports.default = _default;
|
|
|
|
-
|
|
|
|
-/***/ }),
|
|
|
|
-
|
|
|
|
/***/ 35:
|
|
/***/ 35:
|
|
/*!**********************************************************************!*\
|
|
/*!**********************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/addUnit.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/addUnit.js ***!
|
|
\**********************************************************************/
|
|
\**********************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12012,7 +12035,7 @@ function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefin
|
|
|
|
|
|
/***/ 36:
|
|
/***/ 36:
|
|
/*!*********************************************************************!*\
|
|
/*!*********************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/random.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/random.js ***!
|
|
\*********************************************************************/
|
|
\*********************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12033,7 +12056,7 @@ random;exports.default = _default;
|
|
|
|
|
|
/***/ 37:
|
|
/***/ 37:
|
|
/*!*******************************************************************!*\
|
|
/*!*******************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/trim.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/trim.js ***!
|
|
\*******************************************************************/
|
|
\*******************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12059,7 +12082,7 @@ trim;exports.default = _default;
|
|
|
|
|
|
/***/ 38:
|
|
/***/ 38:
|
|
/*!********************************************************************!*\
|
|
/*!********************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/toast.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/toast.js ***!
|
|
\********************************************************************/
|
|
\********************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12080,7 +12103,7 @@ toast;exports.default = _default;
|
|
|
|
|
|
/***/ 39:
|
|
/***/ 39:
|
|
/*!************************************************************************!*\
|
|
/*!************************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/getParent.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/getParent.js ***!
|
|
\************************************************************************/
|
|
\************************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12138,7 +12161,7 @@ function getParent(name, keys) {
|
|
|
|
|
|
/***/ 4:
|
|
/***/ 4:
|
|
/*!***********************************************!*\
|
|
/*!***********************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/pages.json ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/pages.json ***!
|
|
\***********************************************/
|
|
\***********************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports) {
|
|
/***/ (function(module, exports) {
|
|
@@ -12149,7 +12172,7 @@ function getParent(name, keys) {
|
|
|
|
|
|
/***/ 40:
|
|
/***/ 40:
|
|
/*!**********************************************************************!*\
|
|
/*!**********************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/$parent.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/$parent.js ***!
|
|
\**********************************************************************/
|
|
\**********************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12176,9 +12199,28 @@ function $parent() {var name = arguments.length > 0 && arguments[0] !== undefine
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
-/***/ 402:
|
|
|
|
|
|
+/***/ 41:
|
|
/*!******************************************************************!*\
|
|
/*!******************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/components/uni-icons/icons.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/sys.js ***!
|
|
|
|
+ \******************************************************************/
|
|
|
|
+/*! no static exports found */
|
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
+
|
|
|
|
+"use strict";
|
|
|
|
+/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
|
|
|
|
+ return uni.getSystemInfoSync().platform;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+function sys() {
|
|
|
|
+ return uni.getSystemInfoSync();
|
|
|
|
+}
|
|
|
|
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
|
|
|
+
|
|
|
|
+/***/ }),
|
|
|
|
+
|
|
|
|
+/***/ 411:
|
|
|
|
+/*!******************************************************************!*\
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/components/uni-icons/icons.js ***!
|
|
\******************************************************************/
|
|
\******************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12318,28 +12360,9 @@ Object.defineProperty(exports, "__esModule", { value: true });exports.default =
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
-/***/ 41:
|
|
|
|
-/*!******************************************************************!*\
|
|
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/sys.js ***!
|
|
|
|
- \******************************************************************/
|
|
|
|
-/*! no static exports found */
|
|
|
|
-/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
-
|
|
|
|
-"use strict";
|
|
|
|
-/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
|
|
|
|
- return uni.getSystemInfoSync().platform;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-function sys() {
|
|
|
|
- return uni.getSystemInfoSync();
|
|
|
|
-}
|
|
|
|
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
|
|
|
-
|
|
|
|
-/***/ }),
|
|
|
|
-
|
|
|
|
/***/ 42:
|
|
/***/ 42:
|
|
/*!***********************************************************************!*\
|
|
/*!***********************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/debounce.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/debounce.js ***!
|
|
\***********************************************************************/
|
|
\***********************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12379,7 +12402,7 @@ debounce;exports.default = _default;
|
|
|
|
|
|
/***/ 43:
|
|
/***/ 43:
|
|
/*!***********************************************************************!*\
|
|
/*!***********************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/throttle.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/function/throttle.js ***!
|
|
\***********************************************************************/
|
|
\***********************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12422,7 +12445,7 @@ throttle;exports.default = _default;
|
|
|
|
|
|
/***/ 44:
|
|
/***/ 44:
|
|
/*!*******************************************************************!*\
|
|
/*!*******************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/config/config.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/config/config.js ***!
|
|
\*******************************************************************/
|
|
\*******************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12446,7 +12469,7 @@ var version = '1.7.3';var _default =
|
|
|
|
|
|
/***/ 45:
|
|
/***/ 45:
|
|
/*!*******************************************************************!*\
|
|
/*!*******************************************************************!*\
|
|
- !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/config/zIndex.js ***!
|
|
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/uview-ui/libs/config/zIndex.js ***!
|
|
\*******************************************************************/
|
|
\*******************************************************************/
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -12472,6 +12495,408 @@ Object.defineProperty(exports, "__esModule", { value: true });exports.default =
|
|
sticky: 970,
|
|
sticky: 970,
|
|
indexListSticky: 965 };exports.default = _default;
|
|
indexListSticky: 965 };exports.default = _default;
|
|
|
|
|
|
|
|
+/***/ }),
|
|
|
|
+
|
|
|
|
+/***/ 52:
|
|
|
|
+/*!********************************************************!*\
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/common/authorize.js ***!
|
|
|
|
+ \********************************************************/
|
|
|
|
+/*! no static exports found */
|
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
+
|
|
|
|
+var utilMd5 = __webpack_require__(/*! ./md5.js */ 53);
|
|
|
|
+var tx_key = 'XSWBZ-TBVWD-QJ54G-HGYZW-5AWQK-M2FYS'; // 腾讯地图key
|
|
|
|
+var tx_secret_key = ''; // key对应的签名
|
|
|
|
+
|
|
|
|
+// 登录
|
|
|
|
+function login() {
|
|
|
|
+ var promise = new Promise(function (resolve, reject) {
|
|
|
|
+ wx.login({
|
|
|
|
+ success: function success(res) {
|
|
|
|
+ console.log(res);
|
|
|
|
+ // 发送 res.code 到后台换取 openId, sessionKey, unionId
|
|
|
|
+ wx.request({
|
|
|
|
+ url: 'https://t5.9026.com/api/v1/common/wxLogin',
|
|
|
|
+ data: {
|
|
|
|
+ wechat_code: res.code },
|
|
|
|
+
|
|
|
|
+ method: "POST",
|
|
|
|
+ header: {
|
|
|
|
+ 'content-type': 'application/json' },
|
|
|
|
+
|
|
|
|
+ success: function success(res) {
|
|
|
|
+ resolve(res);
|
|
|
|
+ },
|
|
|
|
+ fail: function fail(e) {
|
|
|
|
+ reject(e);
|
|
|
|
+ } });
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ fail: function fail(res) {
|
|
|
|
+ reject('登录失败');
|
|
|
|
+ } });
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ return promise;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 获取用户信息
|
|
|
|
+function getUserInfo() {
|
|
|
|
+ var promise = new Promise(function (resolve, reject) {
|
|
|
|
+ getAuthSetting('scope.userInfo', false, '用户信息').then(function (res) {
|
|
|
|
+ if (res) {
|
|
|
|
+ // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
|
|
|
|
+ wx.getUserInfo({
|
|
|
|
+ success: function success(res) {
|
|
|
|
+ // 可以将 res 发送给后台解码出 unionId
|
|
|
|
+ resolve('获取用户信息成功', res.userInfo);
|
|
|
|
+ } });
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ resolve(false);
|
|
|
|
+ }
|
|
|
|
+ }).catch(function (res) {
|
|
|
|
+ reject(res);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ return promise;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 打开授权设置界面
|
|
|
|
+function openSetting(scope, isMust, name) {// scope是权限字段,isMust表示是否必须授权, name是授权信息名,用于模态框信息展示
|
|
|
|
+ var promise = new Promise(function (resolve, reject) {
|
|
|
|
+ wx.showModal({
|
|
|
|
+ title: '授权提示',
|
|
|
|
+ content: '请先授权获取' + name,
|
|
|
|
+ success: function success(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ wx.openSetting({
|
|
|
|
+ success: function success(res) {
|
|
|
|
+ if (res.authSetting[scope]) {// 用户打开了授权开关
|
|
|
|
+ resolve(true);
|
|
|
|
+ } else {// 用户没有打开授权开关, 继续打开设置页面
|
|
|
|
+ if (isMust) {
|
|
|
|
+ openSetting(scope, isMust, name);
|
|
|
|
+ } else {
|
|
|
|
+ reject('获取用户授权信息失败');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ fail: function fail(res) {} });
|
|
|
|
+
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ if (isMust) {
|
|
|
|
+ openSetting(scope, isMust, name);
|
|
|
|
+ } else {
|
|
|
|
+ reject('获取用户授权信息失败');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } });
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ return promise;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function getAuthSetting(scope, isMust, name) {// 获取用户授权信息,scope是授权的权限字段名, isMust表示是否必须授权才能进行下一步
|
|
|
|
+ var promise = new Promise(function (resolve, reject) {
|
|
|
|
+ wx.getSetting({
|
|
|
|
+ success: function success(res) {
|
|
|
|
+ if (res.authSetting[scope]) {
|
|
|
|
+ resolve(true); // 用户已经授权
|
|
|
|
+ } else {
|
|
|
|
+ // 用户还没有授权,向用户发起授权请求
|
|
|
|
+ wx.authorize({
|
|
|
|
+ scope: scope,
|
|
|
|
+ success: function success() {// 用户同意授权
|
|
|
|
+ resolve(true);
|
|
|
|
+ },
|
|
|
|
+ fail: function fail() {// 用户不同意授权
|
|
|
|
+ if (isMust) {// 如果是必须授权才能进行下一步的接口,则打开设置页面
|
|
|
|
+ openSetting(scope, isMust, name).then(function (res) {
|
|
|
|
+ resolve(true);
|
|
|
|
+ }).catch(function (res) {
|
|
|
|
+ resolve(false);
|
|
|
|
+ });
|
|
|
|
+ } else {// 如果不是必须授权的接口,则直接返回未授权状态
|
|
|
|
+ resolve(false);
|
|
|
|
+ }
|
|
|
|
+ } });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ fail: function fail(res) {
|
|
|
|
+ reject('获取用户授权信息失败');
|
|
|
|
+ } });
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ return promise;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function getLocation() {var _this2 = this; // 获取地理位置信息
|
|
|
|
+ var promise = new Promise(function (resolve, reject) {
|
|
|
|
+ getAuthSetting('scope.userLocation', true, '地理位置信息').then(function (res) {// 获取用户信息,must必须授权
|
|
|
|
+ if (res) {
|
|
|
|
+ // 已经授权,可以直接获取地理位置
|
|
|
|
+ var _this = _this2;
|
|
|
|
+ wx.getLocation({
|
|
|
|
+ type: 'wgs84',
|
|
|
|
+ success: function success(res) {
|
|
|
|
+ console.log(res);
|
|
|
|
+ var locationData = { // 新建一个对象用于保存经纬度等信息
|
|
|
|
+ latitude: res.latitude, // 纬度
|
|
|
|
+ longitude: res.longitude // 经度
|
|
|
|
+ };
|
|
|
|
+ var sig = utilMd5.hexMD5("/ws/geocoder/v1?key=" + tx_key + "&location=" + res.latitude + "," + res.longitude +
|
|
|
|
+ tx_secret_key);
|
|
|
|
+ var getAddressUrl = "https://apis.map.qq.com/ws/geocoder/v1?key=" + tx_key + "&location=" + res.latitude +
|
|
|
|
+ "," + res.longitude + "&sig=" + sig;
|
|
|
|
+ wx.request({ // 请求腾讯地图接口获取地理位置
|
|
|
|
+ url: getAddressUrl,
|
|
|
|
+ success: function success(res) {
|
|
|
|
+ if (res.data.status == 0) {// 获取地理位置成功
|
|
|
|
+ locationData.address = res.data.result;
|
|
|
|
+ resolve(locationData);
|
|
|
|
+ } else {// 获取地理位置信息失败
|
|
|
|
+ reject('获取地理位置信息失败');
|
|
|
|
+ }
|
|
|
|
+ } });
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ fail: function fail(res) {
|
|
|
|
+ reject('获取地理位置信息失败');
|
|
|
|
+ } });
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }).catch(function (res) {
|
|
|
|
+ reject(res);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ return promise;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+module.exports = {
|
|
|
|
+ login: login, // 登录 + 获取openID
|
|
|
|
+ getUserInfo: getUserInfo, // 获取用户信息
|
|
|
|
+ getAuthSetting: getAuthSetting, // 获取授权信息, 可选择是否必须授权
|
|
|
|
+ getLocation: getLocation // 获取经纬度 + 经纬度通过腾讯地图签名校验的方式换取城市位置
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/***/ }),
|
|
|
|
+
|
|
|
|
+/***/ 53:
|
|
|
|
+/*!**************************************************!*\
|
|
|
|
+ !*** C:/Users/26439/Desktop/mabao/common/md5.js ***!
|
|
|
|
+ \**************************************************/
|
|
|
|
+/*! no static exports found */
|
|
|
|
+/***/ (function(module, exports) {
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
|
|
|
+ * Digest Algorithm, as defined in RFC 1321.
|
|
|
|
+ * Version 1.1 Copyright (C) Paul Johnston 1999 - 2002.
|
|
|
|
+ * Code also contributed by Greg Holt
|
|
|
|
+ * See http://pajhome.org.uk/site/legal.html for details.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
|
|
|
+ * to work around bugs in some JS interpreters.
|
|
|
|
+ */
|
|
|
|
+function safe_add(x, y) {
|
|
|
|
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
|
|
|
|
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
|
|
|
+ return msw << 16 | lsw & 0xFFFF;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Bitwise rotate a 32-bit number to the left.
|
|
|
|
+ */
|
|
|
|
+function rol(num, cnt) {
|
|
|
|
+ return num << cnt | num >>> 32 - cnt;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * These functions implement the four basic operations the algorithm uses.
|
|
|
|
+ */
|
|
|
|
+function cmn(q, a, b, x, s, t) {
|
|
|
|
+ return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
|
|
|
|
+}
|
|
|
|
+function ff(a, b, c, d, x, s, t) {
|
|
|
|
+ return cmn(b & c | ~b & d, a, b, x, s, t);
|
|
|
|
+}
|
|
|
|
+function gg(a, b, c, d, x, s, t) {
|
|
|
|
+ return cmn(b & d | c & ~d, a, b, x, s, t);
|
|
|
|
+}
|
|
|
|
+function hh(a, b, c, d, x, s, t) {
|
|
|
|
+ return cmn(b ^ c ^ d, a, b, x, s, t);
|
|
|
|
+}
|
|
|
|
+function ii(a, b, c, d, x, s, t) {
|
|
|
|
+ return cmn(c ^ (b | ~d), a, b, x, s, t);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Calculate the MD5 of an array of little-endian words, producing an array
|
|
|
|
+ * of little-endian words.
|
|
|
|
+ */
|
|
|
|
+function coreMD5(x) {
|
|
|
|
+ var a = 1732584193;
|
|
|
|
+ var b = -271733879;
|
|
|
|
+ var c = -1732584194;
|
|
|
|
+ var d = 271733878;
|
|
|
|
+
|
|
|
|
+ for (var i = 0; i < x.length; i += 16) {
|
|
|
|
+ var olda = a;
|
|
|
|
+ var oldb = b;
|
|
|
|
+ var oldc = c;
|
|
|
|
+ var oldd = d;
|
|
|
|
+
|
|
|
|
+ a = ff(a, b, c, d, x[i + 0], 7, -680876936);
|
|
|
|
+ d = ff(d, a, b, c, x[i + 1], 12, -389564586);
|
|
|
|
+ c = ff(c, d, a, b, x[i + 2], 17, 606105819);
|
|
|
|
+ b = ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
|
|
|
+ a = ff(a, b, c, d, x[i + 4], 7, -176418897);
|
|
|
|
+ d = ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
|
|
|
+ c = ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
|
|
|
+ b = ff(b, c, d, a, x[i + 7], 22, -45705983);
|
|
|
|
+ a = ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
|
|
|
+ d = ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
|
|
|
+ c = ff(c, d, a, b, x[i + 10], 17, -42063);
|
|
|
|
+ b = ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
|
|
|
+ a = ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
|
|
|
+ d = ff(d, a, b, c, x[i + 13], 12, -40341101);
|
|
|
|
+ c = ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
|
|
|
+ b = ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
|
|
|
+
|
|
|
|
+ a = gg(a, b, c, d, x[i + 1], 5, -165796510);
|
|
|
|
+ d = gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
|
|
|
+ c = gg(c, d, a, b, x[i + 11], 14, 643717713);
|
|
|
|
+ b = gg(b, c, d, a, x[i + 0], 20, -373897302);
|
|
|
|
+ a = gg(a, b, c, d, x[i + 5], 5, -701558691);
|
|
|
|
+ d = gg(d, a, b, c, x[i + 10], 9, 38016083);
|
|
|
|
+ c = gg(c, d, a, b, x[i + 15], 14, -660478335);
|
|
|
|
+ b = gg(b, c, d, a, x[i + 4], 20, -405537848);
|
|
|
|
+ a = gg(a, b, c, d, x[i + 9], 5, 568446438);
|
|
|
|
+ d = gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
|
|
|
+ c = gg(c, d, a, b, x[i + 3], 14, -187363961);
|
|
|
|
+ b = gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
|
|
|
+ a = gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
|
|
|
+ d = gg(d, a, b, c, x[i + 2], 9, -51403784);
|
|
|
|
+ c = gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
|
|
|
+ b = gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
|
|
|
+
|
|
|
|
+ a = hh(a, b, c, d, x[i + 5], 4, -378558);
|
|
|
|
+ d = hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
|
|
|
+ c = hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
|
|
|
+ b = hh(b, c, d, a, x[i + 14], 23, -35309556);
|
|
|
|
+ a = hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
|
|
|
+ d = hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
|
|
|
+ c = hh(c, d, a, b, x[i + 7], 16, -155497632);
|
|
|
|
+ b = hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
|
|
|
+ a = hh(a, b, c, d, x[i + 13], 4, 681279174);
|
|
|
|
+ d = hh(d, a, b, c, x[i + 0], 11, -358537222);
|
|
|
|
+ c = hh(c, d, a, b, x[i + 3], 16, -722521979);
|
|
|
|
+ b = hh(b, c, d, a, x[i + 6], 23, 76029189);
|
|
|
|
+ a = hh(a, b, c, d, x[i + 9], 4, -640364487);
|
|
|
|
+ d = hh(d, a, b, c, x[i + 12], 11, -421815835);
|
|
|
|
+ c = hh(c, d, a, b, x[i + 15], 16, 530742520);
|
|
|
|
+ b = hh(b, c, d, a, x[i + 2], 23, -995338651);
|
|
|
|
+
|
|
|
|
+ a = ii(a, b, c, d, x[i + 0], 6, -198630844);
|
|
|
|
+ d = ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
|
|
|
+ c = ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
|
|
|
+ b = ii(b, c, d, a, x[i + 5], 21, -57434055);
|
|
|
|
+ a = ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
|
|
|
+ d = ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
|
|
|
+ c = ii(c, d, a, b, x[i + 10], 15, -1051523);
|
|
|
|
+ b = ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
|
|
|
+ a = ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
|
|
|
+ d = ii(d, a, b, c, x[i + 15], 10, -30611744);
|
|
|
|
+ c = ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
|
|
|
+ b = ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
|
|
|
+ a = ii(a, b, c, d, x[i + 4], 6, -145523070);
|
|
|
|
+ d = ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
|
|
|
+ c = ii(c, d, a, b, x[i + 2], 15, 718787259);
|
|
|
|
+ b = ii(b, c, d, a, x[i + 9], 21, -343485551);
|
|
|
|
+
|
|
|
|
+ a = safe_add(a, olda);
|
|
|
|
+ b = safe_add(b, oldb);
|
|
|
|
+ c = safe_add(c, oldc);
|
|
|
|
+ d = safe_add(d, oldd);
|
|
|
|
+ }
|
|
|
|
+ return [a, b, c, d];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Convert an array of little-endian words to a hex string.
|
|
|
|
+ */
|
|
|
|
+function binl2hex(binarray) {
|
|
|
|
+ var hex_tab = "0123456789abcdef";
|
|
|
|
+ var str = "";
|
|
|
|
+ for (var i = 0; i < binarray.length * 4; i++) {
|
|
|
|
+ str += hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 + 4 & 0xF) +
|
|
|
|
+ hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 & 0xF);
|
|
|
|
+ }
|
|
|
|
+ return str;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Convert an array of little-endian words to a base64 encoded string.
|
|
|
|
+ */
|
|
|
|
+function binl2b64(binarray) {
|
|
|
|
+ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
|
|
+ var str = "";
|
|
|
|
+ for (var i = 0; i < binarray.length * 32; i += 6) {
|
|
|
|
+ str += tab.charAt(binarray[i >> 5] << i % 32 & 0x3F |
|
|
|
|
+ binarray[i >> 5 + 1] >> 32 - i % 32 & 0x3F);
|
|
|
|
+ }
|
|
|
|
+ return str;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Convert an 8-bit character string to a sequence of 16-word blocks, stored
|
|
|
|
+ * as an array, and append appropriate padding for MD4/5 calculation.
|
|
|
|
+ * If any of the characters are >255, the high byte is silently ignored.
|
|
|
|
+ */
|
|
|
|
+function str2binl(str) {
|
|
|
|
+ var nblk = (str.length + 8 >> 6) + 1; // number of 16-word blocks
|
|
|
|
+ var blks = new Array(nblk * 16);
|
|
|
|
+ for (var i = 0; i < nblk * 16; i++) {blks[i] = 0;}
|
|
|
|
+ for (var i = 0; i < str.length; i++) {
|
|
|
|
+ blks[i >> 2] |= (str.charCodeAt(i) & 0xFF) << i % 4 * 8;}
|
|
|
|
+ blks[i >> 2] |= 0x80 << i % 4 * 8;
|
|
|
|
+ blks[nblk * 16 - 2] = str.length * 8;
|
|
|
|
+ return blks;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Convert a wide-character string to a sequence of 16-word blocks, stored as
|
|
|
|
+ * an array, and append appropriate padding for MD4/5 calculation.
|
|
|
|
+ */
|
|
|
|
+function strw2binl(str) {
|
|
|
|
+ var nblk = (str.length + 4 >> 5) + 1; // number of 16-word blocks
|
|
|
|
+ var blks = new Array(nblk * 16);
|
|
|
|
+ for (var i = 0; i < nblk * 16; i++) {blks[i] = 0;}
|
|
|
|
+ for (var i = 0; i < str.length; i++) {
|
|
|
|
+ blks[i >> 1] |= str.charCodeAt(i) << i % 2 * 16;}
|
|
|
|
+ blks[i >> 1] |= 0x80 << i % 2 * 16;
|
|
|
|
+ blks[nblk * 16 - 2] = str.length * 16;
|
|
|
|
+ return blks;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * External interface
|
|
|
|
+ */
|
|
|
|
+function hexMD5(str) {return binl2hex(coreMD5(str2binl(str)));}
|
|
|
|
+function hexMD5w(str) {return binl2hex(coreMD5(strw2binl(str)));}
|
|
|
|
+function b64MD5(str) {return binl2b64(coreMD5(str2binl(str)));}
|
|
|
|
+function b64MD5w(str) {return binl2b64(coreMD5(strw2binl(str)));}
|
|
|
|
+/* Backward compatibility */
|
|
|
|
+function calcMD5(str) {return binl2hex(coreMD5(str2binl(str)));}
|
|
|
|
+module.exports = {
|
|
|
|
+ hexMD5: hexMD5 };
|
|
|
|
+
|
|
/***/ })
|
|
/***/ })
|
|
|
|
|
|
}]);
|
|
}]);
|