赞
踩
创云享知识付费系统,定位于为广大创业者、自媒体及培训机构提供知识付费、内容付费、资源变现等领域的行业解决方案;全场景内容付费应用,多渠道营销推广方式、多种资源类型:付费文章、网盘资源、视频资源、音频课程、视频课程、卡密资源,轻松实现资源内容全方位运营变现。
智创云享知识付费系统功能核心定位于助力客户运营发展代理模式。
二、运行环境
2.1.硬件环境:2核CPU、4G内存、3M带宽、50G硬盘(建议)
2.2.软件环境:推荐使用宝塔安装软件环境
操作系统:CentOS 7.2+ (Ubuntu16.04+.、Debian9.0+)
环境软件:PHP7.2(推荐、支持5.6)、mysql5.6、redis5.0
(global.webpackJsonp = global.webpackJsonp || []).push([ [ "common/vendor" ], { 1: function(e, t, n) { "use strict"; (function(e) { Object.defineProperty(t, "__esModule", { value: !0 }), t.createApp = bt, t.createComponent = $t, t.createPage = It, t.createPlugin = Ct, t.createSubpackageApp = jt, t.default = void 0; var r, i = n(3), o = function(e) { return e && e.__esModule ? e : { default: e }; }(n(4)); function a(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e); t && (r = r.filter(function(t) { return Object.getOwnPropertyDescriptor(e, t).enumerable; })), n.push.apply(n, r); } return n; } function s(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? arguments[t] : {}; t % 2 ? a(Object(n), !0).forEach(function(t) { u(e, t, n[t]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : a(Object(n)).forEach(function(t) { Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t)); }); } return e; } function c(e, t) { return function(e) { if (Array.isArray(e)) return e; }(e) || function(e, t) { if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) { var n = [], r = !0, i = !1, o = void 0; try { for (var a, s = e[Symbol.iterator](); !(r = (a = s.next()).done) && (n.push(a.value), !t || n.length !== t); r = !0) ; } catch (e) { i = !0, o = e; } finally { try { r || null == s.return || s.return(); } finally { if (i) throw o; } } return n; } }(e, t) || f(e, t) || function() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }(); } function u(e, t, n) { return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e; } function l(e) { return function(e) { if (Array.isArray(e)) return p(e); }(e) || function(e) { if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) return Array.from(e); }(e) || f(e) || function() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }(); } function f(e, t) { if (e) { if ("string" == typeof e) return p(e, t); var n = Object.prototype.toString.call(e).slice(8, -1); return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? p(e, t) : void 0; } } function p(e, t) { (null == t || t > e.length) && (t = e.length); for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n]; return r; } var h = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", d = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/; function v() { var e, t = wx.getStorageSync("uni_id_token") || "", n = t.split("."); if (!t || 3 !== n.length) return { uid: null, role: [], permission: [], tokenExpired: 0 }; try { e = JSON.parse(function(e) { return decodeURIComponent(r(e).split("").map(function(e) { return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2); }).join("")); }(n[1])); } catch (e) { throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message); } return e.tokenExpired = 1e3 * e.exp, delete e.exp, delete e.iat, e; } r = "function" != typeof atob ? function(e) { if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !d.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded."); var t; e += "==".slice(2 - (3 & e.length)); for (var n, r, i = "", o = 0; o < e.length; ) t = h.indexOf(e.charAt(o++)) << 18 | h.indexOf(e.charAt(o++)) << 12 | (n = h.indexOf(e.charAt(o++))) << 6 | (r = h.indexOf(e.charAt(o++))), i += 64 === n ? String.fromCharCode(t >> 16 & 255) : 64 === r ? String.fromCharCode(t >> 16 & 255, t >> 8 & 255) : String.fromCharCode(t >> 16 & 255, t >> 8 & 255, 255 & t); return i; } : atob; var g = Object.prototype.toString, y = Object.prototype.hasOwnProperty; function m(e) { return "function" == typeof e; } function _(e) { return "string" == typeof e; } function b(e) { return "[object Object]" === g.call(e); } function w(e, t) { return y.call(e, t); } function k() {} function x(e) { var t = Object.create(null); return function(n) { return t[n] || (t[n] = e(n)); }; } var S = /-(\w)/g, T = x(function(e) { return e.replace(S, function(e, t) { return t ? t.toUpperCase() : ""; }); }); function O(e) { var t = {}; return b(e) && Object.keys(e).sort().forEach(function(n) { t[n] = e[n]; }), Object.keys(t) ? t : e; } var A = [ "invoke", "success", "fail", "complete", "returnValue" ], P = {}, I = {}; function $(e, t) { Object.keys(t).forEach(function(n) { -1 !== A.indexOf(n) && m(t[n]) && (e[n] = function(e, t) { var n = t ? e ? e.concat(t) : Array.isArray(t) ? t : [ t ] : e; return n ? function(e) { for (var t = [], n = 0; n < e.length; n++) -1 === t.indexOf(e[n]) && t.push(e[n]); return t; }(n) : n; }(e[n], t[n])); }); } function j(e, t) { e && t && Object.keys(t).forEach(function(n) { -1 !== A.indexOf(n) && m(t[n]) && function(e, t) { var n = e.indexOf(t); -1 !== n && e.splice(n, 1); }(e[n], t[n]); }); } function C(e) { return function(t) { return e(t) || t; }; } function E(e) { return !!e && ("object" == typeof e || "function" == typeof e) && "function" == typeof e.then; } function D(e, t) { for (var n = !1, r = 0; r < e.length; r++) { var i = e[r]; if (n) n = Promise.resolve(C(i)); else { var o = i(t); if (E(o) && (n = Promise.resolve(o)), !1 === o) return { then: function() {} }; } } return n || { then: function(e) { return e(t); } }; } function L(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; return [ "success", "fail", "complete" ].forEach(function(n) { if (Array.isArray(e[n])) { var r = t[n]; t[n] = function(t) { D(e[n], t).then(function(e) { return m(r) && r(e) || e; }); }; } }), t; } function R(e, t) { var n = []; Array.isArray(P.returnValue) && n.push.apply(n, l(P.returnValue)); var r = I[e]; return r && Array.isArray(r.returnValue) && n.push.apply(n, l(r.returnValue)), n.forEach(function(e) { t = e(t) || t; }), t; } function N(e) { var t = Object.create(null); Object.keys(P).forEach(function(e) { "returnValue" !== e && (t[e] = P[e].slice()); }); var n = I[e]; return n && Object.keys(n).forEach(function(e) { "returnValue" !== e && (t[e] = (t[e] || []).concat(n[e])); }), t; } function U(e, t, n) { for (var r = arguments.length, i = new Array(r > 3 ? r - 3 : 0), o = 3; o < r; o++) i[o - 3] = arguments[o]; var a = N(e); if (a && Object.keys(a).length) { if (Array.isArray(a.invoke)) { var s = D(a.invoke, n); return s.then(function(e) { return t.apply(void 0, [ L(a, e) ].concat(i)); }); } return t.apply(void 0, [ L(a, n) ].concat(i)); } return t.apply(void 0, [ n ].concat(i)); } var F = { returnValue: function(e) { return E(e) ? new Promise(function(t, n) { e.then(function(e) { e[0] ? n(e[0]) : t(e[1]); }); }) : e; } }, M = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting/, B = /^create|Manager$/, q = [ "createBLEConnection" ], V = [ "createBLEConnection", "createPushMessage" ], H = /^on|^off/; function z(e) { return B.test(e) && -1 === q.indexOf(e); } function W(e) { return M.test(e) && -1 === V.indexOf(e); } function K(e) { return e.then(function(e) { return [ null, e ]; }).catch(function(e) { return [ e ]; }); } function J(e) { return !(z(e) || W(e) || function(e) { return H.test(e) && "onPush" !== e; }(e)); } function G(e, t) { return J(e) ? function() { for (var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++) i[o - 1] = arguments[o]; return m(n.success) || m(n.fail) || m(n.complete) ? R(e, U.apply(void 0, [ e, t, n ].concat(i))) : R(e, K(new Promise(function(r, o) { U.apply(void 0, [ e, t, Object.assign({}, n, { success: r, fail: o }) ].concat(i)); }))); } : t; } Promise.prototype.finally || (Promise.prototype.finally = function(e) { var t = this.constructor; return this.then(function(n) { return t.resolve(e()).then(function() { return n; }); }, function(n) { return t.resolve(e()).then(function() { throw n; }); }); }); var Y, X = !1, Z = 0, Q = 0, ee = "zh-Hans", te = {}; Y = ie(wx.getSystemInfoSync().language) || "en", function() { if ("undefined" != typeof __uniConfig && __uniConfig.locales && Object.keys(__uniConfig.locales).length) { var e = Object.keys(__uniConfig.locales); e.length && e.forEach(function(e) { var t = te[e], n = __uniConfig.locales[e]; t ? Object.assign(t, n) : te[e] = n; }); } }(); var ne = (0, i.initVueI18n)(Y, {}), re = ne.t; function ie(e, t) { if (e) return e = e.trim().replace(/_/g, "-"), t && t[e] ? e : "chinese" === (e = e.toLowerCase()) ? ee : 0 === e.indexOf("zh") ? e.indexOf("-hans") > -1 ? ee : e.indexOf("-hant") > -1 || function(e, t) { return !!t.find(function(t) { return -1 !== e.indexOf(t); }); }(e, [ "-tw", "-hk", "-mo", "-cht" ]) ? "zh-Hant" : ee : function(e, t) { return t.find(function(t) { return 0 === e.indexOf(t); }); }(e, [ "en", "fr", "es" ]) || void 0; } function oe() { var e = getApp({ allowDefault: !0 }); return e && e.$vm ? e.$vm.$locale : ie(wx.getSystemInfoSync().language) || "en"; } ne.mixin = { beforeCreate: function() { var e = this, t = ne.i18n.watchLocale(function() { e.$forceUpdate(); }); this.$once("hook:beforeDestroy", function() { t(); }); }, methods: { $$t: function(e, t) { return re(e, t); } } }, ne.setLocale, ne.getLocale; var ae = []; void 0 !== e && (e.getLocale = oe); var se, ce = { promiseInterceptor: F }, ue = Object.freeze({ __proto__: null, upx2px: function(e, t) { if (0 === Z && function() { var e = wx.getSystemInfoSync(), t = e.platform, n = e.pixelRatio, r = e.windowWidth; Z = r, Q = n, X = "ios" === t; }(), 0 === (e = Number(e))) return 0; var n = e / 750 * (t || Z); return n < 0 && (n = -n), 0 === (n = Math.floor(n + 1e-4)) && (n = 1 !== Q && X ? .5 : 1), e < 0 ? -n : n; }, getLocale: oe, setLocale: function(e) { var t = getApp(); return !!t && t.$vm.$locale !== e && (t.$vm.$locale = e, ae.forEach(function(t) { return t({ locale: e }); }), !0); }, onLocaleChange: function(e) { -1 === ae.indexOf(e) && ae.push(e); }, addInterceptor: function(e, t) { "string" == typeof e && b(t) ? $(I[e] || (I[e] = {}), t) : b(e) && $(P, e); }, removeInterceptor: function(e, t) { "string" == typeof e ? b(t) ? j(I[e], t) : delete I[e] : b(e) && j(P, e); }, interceptors: ce }), le = "__DC_STAT_UUID"; function fe(e) { (se = se || wx.getStorageSync(le)) || (se = Date.now() + "" + Math.floor(1e7 * Math.random()), wx.setStorage({ key: le, data: se })), e.deviceId = se; } function pe(e) { if (e.safeArea) { var t = e.safeArea; e.safeAreaInsets = { top: t.top, left: t.left, right: e.windowWidth - t.right, bottom: e.screenHeight - t.bottom }; } } function he(e, t) { for (var n = e.deviceType || "phone", r = { ipad: "pad", windows: "pc", mac: "pc" }, i = Object.keys(r), o = t.toLocaleLowerCase(), a = 0; a < i.length; a++) { var s = i[a]; if (-1 !== o.indexOf(s)) { n = r[s]; break; } } return n; } function de(e) { var t = e; return t && (t = e.toLocaleLowerCase()), t; } function ve(e) { return oe ? oe() : e; } function ge(e) { var t = e.hostName || "WeChat"; return e.environment ? t = e.environment : e.host && e.host.env && (t = e.host.env), t; } var ye = { returnValue: function(e) { fe(e), pe(e), function(e) { var t, n = e.brand, r = void 0 === n ? "" : n, i = e.model, o = void 0 === i ? "" : i, a = e.system, s = void 0 === a ? "" : a, c = e.language, u = void 0 === c ? "" : c, l = e.theme, f = e.version, p = (e.platform, e.fontSizeSetting), h = e.SDKVersion, d = e.pixelRatio, v = e.deviceOrientation, g = ""; g = s.split(" ")[0] || "", t = s.split(" ")[1] || ""; var y = f, m = he(e, o), _ = de(r), b = ge(e), w = v, k = d, x = h, S = u.replace(/_/g, "-"), T = { appId: "__UNI__B90D30B", appName: "智创云享", appVersion: "2.3.2", appVersionCode: "100", appLanguage: ve(S), uniCompileVersion: "3.5.5", uniRuntimeVersion: "3.5.5", uniPlatform: "mp-weixin", deviceBrand: _, deviceModel: o, deviceType: m, devicePixelRatio: k, deviceOrientation: w, osName: g.toLocaleLowerCase(), osVersion: t, hostTheme: l, hostVersion: y, hostLanguage: S, hostName: b, hostSDKVersion: x, hostFontSizeSetting: p, windowTop: 0, windowBottom: 0, osLanguage: void 0, osTheme: void 0, ua: void 0, hostPackageName: void 0, browserName: void 0, browserVersion: void 0 }; Object.assign(e, T); }(e); } }, me = { redirectTo: { name: function(e) { return "back" === e.exists && e.delta ? "navigateBack" : "redirectTo"; }, args: function(e) { if ("back" === e.exists && e.url) { var t = function(e) { for (var t = getCurrentPages(), n = t.length; n--; ) { var r = t[n]; if (r.$page && r.$page.fullPath === e) return n; } return -1; }(e.url); if (-1 !== t) { var n = getCurrentPages().length - 1 - t; n > 0 && (e.delta = n); } } } }, previewImage: { args: function(e) { var t = parseInt(e.current); if (!isNaN(t)) { var n = e.urls; if (Array.isArray(n)) { var r = n.length; if (r) return t < 0 ? t = 0 : t >= r && (t = r - 1), t > 0 ? (e.current = n[t], e.urls = n.filter(function(e, r) { return !(r < t) || e !== n[t]; })) : e.current = n[0], { indicator: !1, loop: !1 }; } } } }, getSystemInfo: ye, getSystemInfoSync: ye, showActionSheet: { args: function(e) { "object" == typeof e && (e.alertText = e.title); } }, getAppBaseInfo: { returnValue: function(e) { var t = e, n = t.version, r = t.language, i = t.SDKVersion, o = t.theme, a = ge(e), s = r.replace("_", "-"); e = O(Object.assign(e, { appId: "__UNI__B90D30B", appName: "智创云享", appVersion: "2.3.2", appVersionCode: "100", appLanguage: ve(s), hostVersion: n, hostLanguage: s, hostName: a, hostSDKVersion: i, hostTheme: o })); } }, getDeviceInfo: { returnValue: function(e) { var t = e, n = t.brand, r = t.model, i = he(e, r), o = de(n); fe(e), e = O(Object.assign(e, { deviceType: i, deviceBrand: o, deviceModel: r })); } }, getWindowInfo: { returnValue: function(e) { pe(e), e = O(Object.assign(e, { windowTop: 0, windowBottom: 0 })); } }, getAppAuthorizeSetting: { returnValue: function(e) { var t = e.locationReducedAccuracy; e.locationAccuracy = "unsupported", !0 === t ? e.locationAccuracy = "reduced" : !1 === t && (e.locationAccuracy = "full"); } } }, _e = [ "success", "fail", "cancel", "complete" ]; function be(e, t, n) { return function(r) { return t(ke(e, r, n)); }; } function we(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, i = arguments.length > 4 && void 0 !== arguments[4] && arguments[4]; if (b(t)) { var o = !0 === i ? t : {}; for (var a in m(n) && (n = n(t, o) || {}), t) if (w(n, a)) { var s = n[a]; m(s) && (s = s(t[a], t, o)), s ? _(s) ? o[s] = t[a] : b(s) && (o[s.name ? s.name : a] = s.value) : console.warn("The '".concat(e, "' method of platform '微信小程序' does not support option '").concat(a, "'")); } else -1 !== _e.indexOf(a) ? m(t[a]) && (o[a] = be(e, t[a], r)) : i || (o[a] = t[a]); return o; } return m(t) && (t = be(e, t, r)), t; } function ke(e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; return m(me.returnValue) && (t = me.returnValue(e, t)), we(e, t, n, {}, r); } function xe(e, t) { if (w(me, e)) { var n = me[e]; return n ? function(t, r) { var i = n; m(n) && (i = n(t)); var o = [ t = we(e, t, i.args, i.returnValue) ]; void 0 !== r && o.push(r), m(i.name) ? e = i.name(t) : _(i.name) && (e = i.name); var a = wx[e].apply(wx, o); return W(e) ? ke(e, a, i.returnValue, z(e)) : a; } : function() { console.error("Platform '微信小程序' does not support '".concat(e, "'.")); }; } return t; } var Se = Object.create(null); [ "onTabBarMidButtonTap", "subscribePush", "unsubscribePush", "onPush", "offPush", "share" ].forEach(function(e) { Se[e] = function(e) { return function(t) { var n = t.fail, r = t.complete, i = { errMsg: "".concat(e, ":fail method '").concat(e, "' not supported") }; m(n) && n(i), m(r) && r(i); }; }(e); }); var Te = { oauth: [ "weixin" ], share: [ "weixin" ], payment: [ "wxpay" ], push: [ "weixin" ] }, Oe = Object.freeze({ __proto__: null, getProvider: function(e) { var t = e.service, n = e.success, r = e.fail, i = e.complete, o = !1; Te[t] ? (o = { errMsg: "getProvider:ok", service: t, provider: Te[t] }, m(n) && n(o)) : (o = { errMsg: "getProvider:fail service not found" }, m(r) && r(o)), m(i) && i(o); } }), Ae = function() { var e; return function() { return e || (e = new o.default()), e; }; }(); function Pe(e, t, n) { return e[t].apply(e, n); } var Ie, $e, je, Ce = Object.freeze({ __proto__: null, $on: function() { return Pe(Ae(), "$on", Array.prototype.slice.call(arguments)); }, $off: function() { return Pe(Ae(), "$off", Array.prototype.slice.call(arguments)); }, $once: function() { return Pe(Ae(), "$once", Array.prototype.slice.call(arguments)); }, $emit: function() { return Pe(Ae(), "$emit", Array.prototype.slice.call(arguments)); } }); function Ee(e) { return function() { try { return e.apply(e, arguments); } catch (e) { console.error(e); } }; } function De(e) { try { return JSON.parse(e); } catch (e) {} return e; } var Le = []; function Re(e, t) { Le.forEach(function(n) { n(e, t); }), Le.length = 0; } var Ne = [], Ue = Object.freeze({ __proto__: null, getPushClientId: function(e) { b(e) || (e = {}); var t = function(e) { var t = {}; for (var n in e) { var r = e[n]; m(r) && (t[n] = Ee(r), delete e[n]); } return t; }(e), n = t.success, r = t.fail, i = t.complete, o = m(n), a = m(r), s = m(i); Promise.resolve().then(function() { void 0 === je && (je = !1, Ie = "", $e = "uniPush is not enabled"), Le.push(function(e, t) { var c; e ? (c = { errMsg: "getPushClientId:ok", cid: e }, o && n(c)) : (c = { errMsg: "getPushClientId:fail" + (t ? " " + t : "") }, a && r(c)), s && i(c); }), void 0 !== Ie && Re(Ie, $e); }); }, onPushMessage: function(e) { -1 === Ne.indexOf(e) && Ne.push(e); }, offPushMessage: function(e) { if (e) { var t = Ne.indexOf(e); t > -1 && Ne.splice(t, 1); } else Ne.length = 0; }, invokePushCallback: function(e) { if ("enabled" === e.type) je = !0; else if ("clientId" === e.type) Ie = e.cid, $e = e.errMsg, Re(Ie, e.errMsg); else if ("pushMsg" === e.type) for (var t = { type: "receive", data: De(e.message) }, n = 0; n < Ne.length && ((0, Ne[n])(t), !t.stopped); n++) ; else "click" === e.type && Ne.forEach(function(t) { t({ type: "click", data: De(e.message) }); }); } }), Fe = Page, Me = Component, Be = /:/g, qe = x(function(e) { return T(e.replace(Be, "-")); }); function Ve(e) { var t = e.triggerEvent, n = function(n) { for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++) i[o - 1] = arguments[o]; return t.apply(e, [ qe(n) ].concat(i)); }; try { e.triggerEvent = n; } catch (t) { e._triggerEvent = n; } } function He(e, t, n) { var r = t[e]; t[e] = r ? function() { Ve(this); for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n]; return r.apply(this, t); } : function() { Ve(this); }; } function ze(e, t, n) { t.forEach(function(t) { (function e(t, n) { if (!n) return !0; if (o.default.options && Array.isArray(o.default.options[t])) return !0; if (m(n = n.default || n)) return !!m(n.extendOptions[t]) || !!(n.super && n.super.options && Array.isArray(n.super.options[t])); if (m(n[t])) return !0; var r = n.mixins; return Array.isArray(r) ? !!r.find(function(n) { return e(t, n); }) : void 0; })(t, n) && (e[t] = function(e) { return this.$vm && this.$vm.__call_hook(t, e); }); }); } function We(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : []; Ke(t).forEach(function(t) { return Je(e, t, n); }); } function Ke(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []; return e && Object.keys(e).forEach(function(n) { 0 === n.indexOf("on") && m(e[n]) && t.push(n); }), t; } function Je(e, t, n) { -1 !== n.indexOf(t) || w(e, t) || (e[t] = function(e) { return this.$vm && this.$vm.__call_hook(t, e); }); } function Ge(e, t) { var n; return [ n = m(t = t.default || t) ? t : e.extend(t), t = n.options ]; } function Ye(e, t) { if (Array.isArray(t) && t.length) { var n = Object.create(null); t.forEach(function(e) { n[e] = !0; }), e.$scopedSlots = e.$slots = n; } } function Xe(e, t) { var n = (e = (e || "").split(",")).length; 1 === n ? t._$vueId = e[0] : 2 === n && (t._$vueId = e[0], t._$vuePid = e[1]); } function Ze(e, t) { var n = e.data || {}, r = e.methods || {}; if ("function" == typeof n) try { n = n.call(t); } catch (e) { Object({ NODE_ENV: "development", VUE_APP_NAME: "智创云享", VUE_APP_PLATFORM: "mp-weixin", BASE_URL: "/" }).VUE_APP_DEBUG && console.warn("根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。", n); } else try { n = JSON.parse(JSON.stringify(n)); } catch (e) {} return b(n) || (n = {}), Object.keys(r).forEach(function(e) { -1 !== t.__lifecycle_hooks__.indexOf(e) || w(n, e) || (n[e] = r[e]); }), n; } Fe.__$wrappered || (Fe.__$wrappered = !0, Page = function() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; return He("onLoad", e), Fe(e); }, Page.after = Fe.after, Component = function() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; return He("created", e), Me(e); }); var Qe = [ String, Number, Boolean, Object, Array, null ]; function et(e) { return function(t, n) { this.$vm && (this.$vm[e] = t); }; } function tt(e, t) { var n = e.behaviors, r = e.extends, i = e.mixins, o = e.props; o || (e.props = o = []); var a = []; return Array.isArray(n) && n.forEach(function(e) { a.push(e.replace("uni://", "wx".concat("://"))), "uni://form-field" === e && (Array.isArray(o) ? (o.push("name"), o.push("value")) : (o.name = { type: String, default: "" }, o.value = { type: [ String, Number, Boolean, Array, Object, Date ], default: "" })); }), b(r) && r.props && a.push(t({ properties: rt(r.props, !0) })), Array.isArray(i) && i.forEach(function(e) { b(e) && e.props && a.push(t({ properties: rt(e.props, !0) })); }), a; } function nt(e, t, n, r) { return Array.isArray(t) && 1 === t.length ? t[0] : t; } function rt(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = arguments.length > 3 ? arguments[3] : void 0, r = {}; return t || (r.vueId = { type: String, value: "" }, n.virtualHost && (r.virtualHostStyle = { type: null, value: "" }, r.virtualHostClass = { type: null, value: "" }), r.scopedSlotsCompiler = { type: String, value: "" }, r.vueSlots = { type: null, value: [], observer: function(e, t) { var n = Object.create(null); e.forEach(function(e) { n[e] = !0; }), this.setData({ $slots: n }); } }), Array.isArray(e) ? e.forEach(function(e) { r[e] = { type: null, observer: et(e) }; }) : b(e) && Object.keys(e).forEach(function(t) { var n = e[t]; if (b(n)) { var i = n.default; m(i) && (i = i()), n.type = nt(0, n.type), r[t] = { type: -1 !== Qe.indexOf(n.type) ? n.type : null, value: i, observer: et(t) }; } else { var o = nt(0, n); r[t] = { type: -1 !== Qe.indexOf(o) ? o : null, observer: et(t) }; } }), r; } function it(e, t, n) { var r = {}; return Array.isArray(t) && t.length && t.forEach(function(t, i) { "string" == typeof t ? t ? "$event" === t ? r["$" + i] = n : "arguments" === t ? n.detail && n.detail.__args__ ? r["$" + i] = n.detail.__args__ : r["$" + i] = [ n ] : 0 === t.indexOf("$event.") ? r["$" + i] = e.__get_value(t.replace("$event.", ""), n) : r["$" + i] = e.__get_value(t) : r["$" + i] = e : r["$" + i] = function(e, t) { var n = e; return t.forEach(function(t) { var r = t[0], i = t[2]; if (r || void 0 !== i) { var o, a = t[1], s = t[3]; Number.isInteger(r) ? o = r : r ? "string" == typeof r && r && (o = 0 === r.indexOf("#s#") ? r.substr(3) : e.__get_value(r, n)) : o = n, Number.isInteger(o) ? n = i : a ? Array.isArray(o) ? n = o.find(function(t) { return e.__get_value(a, t) === i; }) : b(o) ? n = Object.keys(o).find(function(t) { return e.__get_value(a, o[t]) === i; }) : console.error("v-for 暂不支持循环数据:", o) : n = o[i], s && (n = e.__get_value(s, n)); } }), n; }(e, t); }), r; } function ot(e) { for (var t = {}, n = 1; n < e.length; n++) { var r = e[n]; t[r[0]] = r[1]; } return t; } function at(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [], r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : [], i = arguments.length > 4 ? arguments[4] : void 0, o = arguments.length > 5 ? arguments[5] : void 0, a = !1; if (i && (a = t.currentTarget && t.currentTarget.dataset && "wx" === t.currentTarget.dataset.comType, !n.length)) return a ? [ t ] : t.detail.__args__ || t.detail; var s = it(e, r, t), c = []; return n.forEach(function(e) { "$event" === e ? "__set_model" !== o || i ? i && !a ? c.push(t.detail.__args__[0]) : c.push(t) : c.push(t.target.value) : Array.isArray(e) && "o" === e[0] ? c.push(ot(e)) : "string" == typeof e && w(s, e) ? c.push(s[e]) : c.push(e); }), c; } function st(e) { var t = this, n = ((e = function(e) { try { e.mp = JSON.parse(JSON.stringify(e)); } catch (e) {} return e.stopPropagation = k, e.preventDefault = k, e.target = e.target || {}, w(e, "detail") || (e.detail = {}), w(e, "markerId") && (e.detail = "object" == typeof e.detail ? e.detail : {}, e.detail.markerId = e.markerId), b(e.detail) && (e.target = Object.assign({}, e.target, e.detail)), e; }(e)).currentTarget || e.target).dataset; if (!n) return console.warn("事件信息不存在"); var r = n.eventOpts || n["event-opts"]; if (!r) return console.warn("事件信息不存在"); var i = e.type, o = []; return r.forEach(function(n) { var r = n[0], a = n[1], s = "^" === r.charAt(0), c = "~" === (r = s ? r.slice(1) : r).charAt(0); r = c ? r.slice(1) : r, a && function(e, t) { return e === t || "regionchange" === t && ("begin" === e || "end" === e); }(i, r) && a.forEach(function(n) { var r = n[0]; if (r) { var i = t.$vm; if (i.$options.generic && (i = function(e) { for (var t = e.$parent; t && t.$parent && (t.$options.generic || t.$parent.$options.generic || t.$scope._$vuePid); ) t = t.$parent; return t && t.$parent; }(i) || i), "$emit" === r) return void i.$emit.apply(i, at(t.$vm, e, n[1], n[2], s, r)); var a = i[r]; if (!m(a)) { var u = "page" === t.$vm.mpType ? "Page" : "Component", l = t.route || t.is; throw new Error("".concat(u, ' "').concat(l, '" does not have a method "').concat(r, '"')); } if (c) { if (a.once) return; a.once = !0; } var f = at(t.$vm, e, n[1], n[2], s, r); f = Array.isArray(f) ? f : [], /=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(a.toString()) && (f = f.concat([ , , , , , , , , , , e ])), o.push(a.apply(i, f)); } }); }), "input" === i && 1 === o.length && void 0 !== o[0] ? o[0] : void 0; } var ct = {}, ut = [], lt = [ "onShow", "onHide", "onError", "onPageNotFound", "onThemeChange", "onUnhandledRejection" ]; function ft() { o.default.prototype.getOpenerEventChannel = function() { return this.$scope.getOpenerEventChannel(); }; var e = o.default.prototype.__call_hook; o.default.prototype.__call_hook = function(t, n) { return "onLoad" === t && n && n.__id__ && (this.__eventChannel__ = function(e) { if (e) { var t = ct[e]; return delete ct[e], t; } return ut.shift(); }(n.__id__), delete n.__id__), e.call(this, t, n); }; } function pt(e, t) { var n = t.mocks, r = t.initRefs; ft(), function() { var e = {}, t = {}; o.default.prototype.$hasScopedSlotsParams = function(n) { var r = e[n]; return r || (t[n] = this, this.$on("hook:destroyed", function() { delete t[n]; })), r; }, o.default.prototype.$getScopedSlotsParams = function(n, r, i) { var o = e[n]; if (o) { var a = o[r] || {}; return i ? a[i] : a; } t[n] = this, this.$on("hook:destroyed", function() { delete t[n]; }); }, o.default.prototype.$setScopedSlotsParams = function(n, r) { var i = this.$options.propsData.vueId; if (i) { var o = i.split(",")[0]; (e[o] = e[o] || {})[n] = r, t[o] && t[o].$forceUpdate(); } }, o.default.mixin({ destroyed: function() { var n = this.$options.propsData, r = n && n.vueId; r && (delete e[r], delete t[r]); } }); }(), e.$options.store && (o.default.prototype.$store = e.$options.store), function(e) { e.prototype.uniIDHasRole = function(e) { return v().role.indexOf(e) > -1; }, e.prototype.uniIDHasPermission = function(e) { var t = v().permission; return this.uniIDHasRole("admin") || t.indexOf(e) > -1; }, e.prototype.uniIDTokenValid = function() { return v().tokenExpired > Date.now(); }; }(o.default), o.default.prototype.mpHost = "mp-weixin", o.default.mixin({ beforeCreate: function() { if (this.$options.mpType) { if (this.mpType = this.$options.mpType, this.$mp = u({ data: {} }, this.mpType, this.$options.mpInstance), this.$scope = this.$options.mpInstance, delete this.$options.mpType, delete this.$options.mpInstance, "page" === this.mpType && "function" == typeof getApp) { var e = getApp(); e.$vm && e.$vm.$i18n && (this._i18n = e.$vm.$i18n); } "app" !== this.mpType && (r(this), function(e, t) { var n = e.$mp[e.mpType]; t.forEach(function(t) { w(n, t) && (e[t] = n[t]); }); }(this, n)); } } }); var i = { onLaunch: function(t) { this.$vm || (wx.canIUse && !wx.canIUse("nextTick") && console.error("当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上"), this.$vm = e, this.$vm.$mp = { app: this }, this.$vm.$scope = this, this.$vm.globalData = this.globalData, this.$vm._isMounted = !0, this.$vm.__call_hook("mounted", t), this.$vm.__call_hook("onLaunch", t)); } }; i.globalData = e.$options.globalData || {}; var a = e.$options.methods; return a && Object.keys(a).forEach(function(e) { i[e] = a[e]; }), function(e, t, n) { var r = e.observable({ locale: n || ne.getLocale() }), i = []; t.$watchLocale = function(e) { i.push(e); }, Object.defineProperty(t, "$locale", { get: function() { return r.locale; }, set: function(e) { r.locale = e, i.forEach(function(t) { return t(e); }); } }); }(o.default, e, ie(wx.getSystemInfoSync().language) || "en"), ze(i, lt), We(i, e.$options), i; } var ht = [ "__route__", "__wxExparserNodeId__", "__wxWebviewId__" ]; function dt(e) { return Behavior(e); } function vt() { return !!this.route; } function gt(e) { this.triggerEvent("__l", e); } function yt(e) { var t = e.$scope; Object.defineProperty(e, "$refs", { get: function() { var e = {}; return function e(t, n, r) { t.selectAllComponents(n).forEach(function(t) { var i = t.dataset.ref; r[i] = t.$vm || t, "scoped" === t.dataset.vueGeneric && t.selectAllComponents(".scoped-ref").forEach(function(t) { e(t, n, r); }); }); }(t, ".vue-ref", e), t.selectAllComponents(".vue-ref-in-for").forEach(function(t) { var n = t.dataset.ref; e[n] || (e[n] = []), e[n].push(t.$vm || t); }), e; } }); } function mt(e) { var t, n = e.detail || e.value, r = n.vuePid, i = n.vueOptions; r && (t = function e(t, n) { for (var r, i = t.$children, o = i.length - 1; o >= 0; o--) { var a = i[o]; if (a.$scope._$vueId === n) return a; } for (var s = i.length - 1; s >= 0; s--) if (r = e(i[s], n)) return r; }(this.$vm, r)), t || (t = this.$vm), i.parent = t; } function _t(e) { return pt(e, { mocks: ht, initRefs: yt }); } function bt(e) { return App(_t(e)), e; } var wt = /[!'()*]/g, kt = function(e) { return "%" + e.charCodeAt(0).toString(16); }, xt = /%2C/g, St = function(e) { return encodeURIComponent(e).replace(wt, kt).replace(xt, ","); }; function Tt(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : St, n = e ? Object.keys(e).map(function(n) { var r = e[n]; if (void 0 === r) return ""; if (null === r) return t(n); if (Array.isArray(r)) { var i = []; return r.forEach(function(e) { void 0 !== e && (null === e ? i.push(t(n)) : i.push(t(n) + "=" + t(e))); }), i.join("&"); } return t(n) + "=" + t(r); }).filter(function(e) { return e.length > 0; }).join("&") : null; return n ? "?".concat(n) : ""; } function Ot(e) { return function(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = t.isPage, r = t.initRelation, i = Ge(o.default, e), a = c(i, 2), u = a[0], l = a[1], f = s({ multipleSlots: !0, addGlobalClass: !0 }, l.options || {}); l["mp-weixin"] && l["mp-weixin"].options && Object.assign(f, l["mp-weixin"].options); var p = { options: f, data: Ze(l, o.default.prototype), behaviors: tt(l, dt), properties: rt(l.props, !1, l.__file, f), lifetimes: { attached: function() { var e = this.properties, t = { mpType: n.call(this) ? "page" : "component", mpInstance: this, propsData: e }; Xe(e.vueId, this), r.call(this, { vuePid: this._$vuePid, vueOptions: t }), this.$vm = new u(t), Ye(this.$vm, e.vueSlots), this.$vm.$mount(); }, ready: function() { this.$vm && (this.$vm._isMounted = !0, this.$vm.__call_hook("mounted"), this.$vm.__call_hook("onReady")); }, detached: function() { this.$vm && this.$vm.$destroy(); } }, pageLifetimes: { show: function(e) { this.$vm && this.$vm.__call_hook("onPageShow", e); }, hide: function() { this.$vm && this.$vm.__call_hook("onPageHide"); }, resize: function(e) { this.$vm && this.$vm.__call_hook("onPageResize", e); } }, methods: { __l: mt, __e: st } }; return l.externalClasses && (p.externalClasses = l.externalClasses), Array.isArray(l.wxsCallMethods) && l.wxsCallMethods.forEach(function(e) { p.methods[e] = function(t) { return this.$vm[e](t); }; }), n ? p : [ p, u ]; }(e, { isPage: vt, initRelation: gt }); } var At = [ "onShow", "onHide", "onUnload" ]; function Pt(e) { return function(e, t) { t.isPage, t.initRelation; var n = Ot(e); return ze(n.methods, At, e), We(n.methods, e), n.methods.onLoad = function(e) { this.options = e; var t = Object.assign({}, e); delete t.__id__, this.$page = { fullPath: "/" + (this.route || this.is) + Tt(t) }, this.$vm.$mp.query = e, this.$vm.__call_hook("onLoad", e); }, n; }(e, { isPage: vt, initRelation: gt }); } function It(e) { return Component(Pt(e)); } function $t(e) { return Component(Ot(e)); } function jt(e) { var t = _t(e), n = getApp({ allowDefault: !0 }); e.$scope = n; var r = n.globalData; if (r && Object.keys(t.globalData).forEach(function(e) { w(r, e) || (r[e] = t.globalData[e]); }), Object.keys(t).forEach(function(e) { w(n, e) || (n[e] = t[e]); }), m(t.onShow) && wx.onAppShow && wx.onAppShow(function() { for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r]; e.__call_hook("onShow", n); }), m(t.onHide) && wx.onAppHide && wx.onAppHide(function() { for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r]; e.__call_hook("onHide", n); }), m(t.onLaunch)) { var i = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync(); e.__call_hook("onLaunch", i); } return e; } function Ct(e) { var t = _t(e); if (m(t.onShow) && wx.onAppShow && wx.onAppShow(function() { for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r]; e.__call_hook("onShow", n); }), m(t.onHide) && wx.onAppHide && wx.onAppHide(function() { for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r]; e.__call_hook("onHide", n); }), m(t.onLaunch)) { var n = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync(); e.__call_hook("onLaunch", n); } return e; } At.push.apply(At, [ "onPullDownRefresh", "onReachBottom", "onAddToFavorites", "onShareTimeline", "onShareAppMessage", "onPageScroll", "onResize", "onTabItemTap" ]), [ "vibrate", "preloadPage", "unPreloadPage", "loadSubPackage" ].forEach(function(e) { me[e] = !1; }), [].forEach(function(e) { var t = me[e] && me[e].name ? me[e].name : e; wx.canIUse(t) || (me[e] = !1); }); var Et = {}; "undefined" != typeof Proxy ? Et = new Proxy({}, { get: function(e, t) { return w(e, t) ? e[t] : ue[t] ? ue[t] : Ue[t] ? G(t, Ue[t]) : Oe[t] ? G(t, Oe[t]) : Se[t] ? G(t, Se[t]) : Ce[t] ? Ce[t] : w(wx, t) || w(me, t) ? G(t, xe(t, wx[t])) : void 0; }, set: function(e, t, n) { return e[t] = n, !0; } }) : (Object.keys(ue).forEach(function(e) { Et[e] = ue[e]; }), Object.keys(Se).forEach(function(e) { Et[e] = G(e, Se[e]); }), Object.keys(Oe).forEach(function(e) { Et[e] = G(e, Se[e]); }), Object.keys(Ce).forEach(function(e) { Et[e] = Ce[e]; }), Object.keys(Ue).forEach(function(e) { Et[e] = G(e, Ue[e]); }), Object.keys(wx).forEach(function(e) { (w(wx, e) || w(me, e)) && (Et[e] = G(e, xe(e, wx[e]))); })), wx.createApp = bt, wx.createPage = It, wx.createComponent = $t, wx.createSubpackageApp = jt, wx.createPlugin = Ct; var Dt = Et; t.default = Dt; }).call(this, n(2)); }, 13: function(e, t, n) { "use strict"; function r(e, t, n, r, i, o, a, s, c, u) { var l, f = "function" == typeof e ? e.options : e; if (c) { f.components || (f.components = {}); var p = Object.prototype.hasOwnProperty; for (var h in c) p.call(c, h) && !p.call(f.components, h) && (f.components[h] = c[h]); } if (u && ((u.beforeCreate || (u.beforeCreate = [])).unshift(function() { this[u.__module] = this; }), (f.mixins || (f.mixins = [])).push(u)), t && (f.render = t, f.staticRenderFns = n, f._compiled = !0), r && (f.functional = !0), o && (f._scopeId = "data-v-" + o), a ? (l = function(e) { (e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), i && i.call(this, e), e && e._registeredComponents && e._registeredComponents.add(a); }, f._ssrRegister = l) : i && (l = s ? function() { i.call(this, this.$root.$options.shadowRoot); } : i), l) if (f.functional) { f._injectStyles = l; var d = f.render; f.render = function(e, t) { return l.call(t), d(e, t); }; } else { var v = f.beforeCreate; f.beforeCreate = v ? [].concat(v, l) : [ l ]; } return { exports: e, options: f }; } n.r(t), n.d(t, "default", function() { return r; }); }, 14: function(e, t, n) { "use strict"; (function(e) { Object.defineProperty(t, "__esModule", { value: !0 }), t.smsLogin = t.spreadH5Poster = t.spreadPoster = t.buykmList = t.createH5Poster = t.wechatConfig = t.savekamiTask = t.viewLog = t.payQrcode = t.articleList = t.articleShow = t.saveSubscribe = t.tqrCode = t.wqrCode = t.handleTaskVip = t.svipTask = t.handelCash = t.cancelOrder = t.keepttOrder = t.keepWebOrder = t.keepOrder = t.saveInfo = t.getincomeStat = t.getTeamList = t.getCashList = t.getMyFav = t.getMyTask = t.getMyResource = t.userInfo = t.createPoster = t.getVipinfo = t.getViplist = t.queryOrder = t.createWebVip = t.createAccVip = t.createWebOrder = t.createAccOrder = t.createTTOrder = t.createTTVip = t.createVip = t.createOrder = t.handleFavs = t.findPwd = t.sendSMS = t.register = t.loginH5 = t.loginwx = t.logintt = t.login2 = t.login1 = t.receiveTask = t.subTaskVideo = t.doSubTask = t.getResinfo = t.getResource = t.getSwiper = t.getSort = t.getAllSort = t.getNotice = t.getAdvert = t.pageDatas = t.shopConfig = t.uploadImage = t.uploadFiles = t.showTips = void 0; var r = n(15), i = s(n(17)), o = s(n(18)); function a() { if ("function" != typeof WeakMap) return null; var e = new WeakMap(); return a = function() { return e; }, e; } function s(e) { if (e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = a(); if (t && t.has(e)) return t.get(e); var n = {}, r = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var i in e) if (Object.prototype.hasOwnProperty.call(e, i)) { var o = r ? Object.getOwnPropertyDescriptor(e, i) : null; o && (o.get || o.set) ? Object.defineProperty(n, i, o) : n[i] = e[i]; } return n.default = e, t && t.set(e, n), n; } var c = [ "api.user.coll", "api.Order.buyres", "api.Order.buyvip", "api.user.userinfo", "api.user.mybuyres", "api.user.mytaskres", "api.Resource.subrestask", "api.user.keeporder", "api.user.qxorder", "api.user.sviptask", "api.user.obsviptask", "api.user.mycoll", "api.user.cashlist", "api.user.teamlist", "api.user.incomeStat", "api.user.cash", "api.user.saveInfo", "api.index.getxcode", "api.user.subscribe", "api.Resource.subTaskVideo", "api.Resource.receiveTask", "api.user.createPoster", "api.Payorder.qrcode", "api.Resource.viewLog", "api.Resource.kammiTask", "api.Resource.buykmList", "api.user.spreadPoster", "api.Order.accbuyvip", "api.Order.webbuyvip", "api.Order.ttbuyvip", "api.Order.ttbuyres", "api.Order.queryOrder", "api.Order.accbuyres", "api.Order.webbuyres", "api.index.createH5Poster", "api.user.spreadH5Poster", "api.user.keepweborder", "api.user.keepttorder", "api.index.gettcode" ], u = function(t, n, a, s) { if (c.indexOf(t) >= 0) { var u = o.get("userToken"); if (!u) return i.jumpToLogin(), !1; n.token = u; } e.request({ url: r.apiUrl + l(t), data: n, header: { Accept: "application/json", "Content-Type": "application/json" }, method: "POST", success: function(t) { var n = t.data; 200 !== n.code && 403 === n.code && (o.del("userToken"), e.showToast({ title: n.msg, icon: "none", duration: 1e3, complete: function() { i.jumpToLogin(); } })), a(n); }, complete: function(e) { s && s(); }, fail: function(t) { e.showLoading({ title: "网络开小差了" }), setTimeout(function() { e.hideLoading(); }, 1e3), t && t.response && p(t.response); } }); }; function l(e) { var t = e.split("."), n = o.get("invite_fid"); return t[0] + "/" + t[1] + "/" + t[2] + "?from_id=" + n; } var f = function(t, n, i) { e.request({ url: r.apiUrl + l(t) + n, header: { Accept: "application/json", "Content-Type": "application/x-www-form-urlencoded" }, method: "GET", success: function(e) { i(e.data); }, fail: function(t) { e.hideLoading(), t && t.response && p(t.response); }, complete: function() {} }); }, p = function(t) { var n = ""; switch (t.status) { case 400: n = "请求参数错误"; break; case 401: n = "未授权,请登录"; break; case 403: n = "跨域拒绝访问"; break; case 404: n = "请求地址出错: ".concat(t.config.url); break; case 408: n = "请求超时"; break; case 500: n = "服务器内部错误"; break; case 501: n = "服务未实现"; break; case 502: n = "网关错误"; break; case 503: n = "服务不可用"; break; case 504: n = "网关超时"; break; case 505: n = "HTTP版本不受支持"; break; default: n = t.msg; } e.showToast({ title: n, icon: "none", duration: 1e3, complete: function() { setTimeout(function() { e.hideToast(); }, 1e3); } }); }; t.showTips = function(t) { e.showToast({ title: t, icon: "none", duration: 1e3 }); }, t.uploadFiles = function(t) { e.chooseImage({ success: function(n) { e.showLoading({ title: "上传中..." }); var i = n.tempFilePaths; e.uploadFile({ url: r.apiUrl + "api.html", filePath: i[0], fileType: "image", name: "file", headers: { Accept: "application/json", "Content-Type": "multipart/form-data" }, formData: { method: "images.upload", upfile: i[0] }, success: function(e) { t(JSON.parse(e.data)); }, fail: function(e) { e && e.response && p(e.response); }, complete: function() { setTimeout(function() { e.hideLoading(); }, 250); } }); } }); }, t.uploadImage = function(t, n) { e.chooseImage({ count: t, success: function(t) { e.showLoading({ title: "上传中..." }); for (var i = t.tempFilePaths, o = 0; o < i.length; o++) e.uploadFile({ url: r.apiUrl + "api.html", filePath: i[o], fileType: "image", name: "file", headers: { Accept: "application/json", "Content-Type": "multipart/form-data" }, formData: { method: "images.upload", upfile: i[o] }, success: function(e) { n(JSON.parse(e.data)); }, fail: function(e) { e && e.response && p(e.response); }, complete: function() { setTimeout(function() { e.hideLoading(); }, 250); } }); } }); }, t.shopConfig = function(e, t) { return f("api.index.config", e, t); }, t.pageDatas = function(e) { return f("api.index.pageData", "", e); }, t.getAdvert = function(e, t) { return u("api.index.advert", e, t); }, t.getNotice = function(e, t) { return u("api.index.article", e, t); }, t.getAllSort = function(e) { return f("api.Resource.allsort", "", e); }, t.getSort = function(e, t) { return f("api.Resource.resourcesort", e, t); }, t.getSwiper = function(e) { return f("api.index.swiper", "", e); }, t.getResource = function(e, t) { return u("api.Resource.resource", e, t); }, t.getResinfo = function(e, t) { return u("api.Resource.resdetail", e, t); }, t.doSubTask = function(e, t) { return u("api.Resource.subrestask", e, t); }, t.subTaskVideo = function(e, t) { return u("api.Resource.subTaskVideo", e, t); }, t.receiveTask = function(e, t) { return u("api.Resource.receiveTask", e, t); }, t.login1 = function(e, t) { return u("api.Login.subcode", e, t); }, t.login2 = function(e, t) { return u("api.Login.login", e, t); }, t.logintt = function(e, t) { return u("api.Login.toutiaologin", e, t); }, t.loginwx = function(e, t) { return u("api.Login.oauth", e, t); }, t.loginH5 = function(e, t) { return u("api.Login.weblogin", e, t); }, t.register = function(e, t) { return u("api.Login.register", e, t); }, t.sendSMS = function(e, t) { return u("api.index.sendsms", e, t); }, t.findPwd = function(e, t) { return u("api.Login.resetpwd", e, t); }, t.handleFavs = function(e, t) { return u("api.user.coll", e, t); }, t.createOrder = function(e, t, n) { return u("api.Order.buyres", e, t, n); }, t.createVip = function(e, t, n) { return u("api.Order.buyvip", e, t, n); }, t.createTTVip = function(e, t, n) { return u("api.Order.ttbuyvip", e, t, n); }, t.createTTOrder = function(e, t, n) { return u("api.Order.ttbuyres", e, t, n); }, t.createAccOrder = function(e, t, n) { return u("api.Order.accbuyres", e, t, n); }, t.createWebOrder = function(e, t, n) { return u("api.Order.webbuyres", e, t, n); }, t.createAccVip = function(e, t, n) { return u("api.Order.accbuyvip", e, t, n); }, t.createWebVip = function(e, t, n) { return u("api.Order.webbuyvip", e, t, n); }, t.queryOrder = function(e, t, n) { return u("api.Order.queryOrder", e, t, n); }, t.getViplist = function(e, t, n) { return u("api.svip.sviptype", e, t, n); }, t.getVipinfo = function(e, t, n) { return u("api.svip.svipinfo", e, t, n); }, t.createPoster = function(e, t, n) { return u("api.user.createPoster", e, t, n); }, t.userInfo = function(e, t) { return u("api.user.userinfo", e, t); }, t.getMyResource = function(e, t, n) { return u("api.user.mybuyres", e, t, n); }, t.getMyTask = function(e, t, n) { return u("api.user.mytaskres", e, t, n); }, t.getMyFav = function(e, t, n) { return u("api.user.mycoll", e, t, n); }, t.getCashList = function(e, t, n) { return u("api.user.cashlist", e, t, n); }, t.getTeamList = function(e, t, n) { return u("api.user.teamlist", e, t, n); }, t.getincomeStat = function(e, t, n) { return u("api.user.incomeStat", e, t, n); }, t.saveInfo = function(e, t, n) { return u("api.user.saveInfo", e, t, n); }, t.keepOrder = function(e, t, n) { return u("api.user.keeporder", e, t, n); }, t.keepWebOrder = function(e, t, n) { return u("api.user.keepweborder", e, t, n); }, t.keepttOrder = function(e, t, n) { return u("api.user.keepttorder", e, t, n); }, t.cancelOrder = function(e, t, n) { return u("api.user.qxorder", e, t, n); }, t.handelCash = function(e, t, n) { return u("api.user.cash", e, t, n); }, t.svipTask = function(e, t, n) { return u("api.user.sviptask", e, t, n); }, t.handleTaskVip = function(e, t, n) { return u("api.user.obsviptask", e, t, n); }, t.wqrCode = function(e, t, n) { return u("api.index.getxcode", e, t, n); }, t.tqrCode = function(e, t, n) { return u("api.index.gettcode", e, t, n); }, t.saveSubscribe = function(e, t, n) { return u("api.user.subscribe", e, t, n); }, t.articleShow = function(e, t) { return u("api.article.show", e, t); }, t.articleList = function(e, t) { return u("api.article.lists", e, t); }, t.payQrcode = function(e, t) { return u("api.Payorder.qrcode", e, t); }, t.viewLog = function(e, t) { return u("api.Resource.viewLog", e, t); }, t.savekamiTask = function(e, t, n) { return u("api.Resource.kammiTask", e, t, n); }, t.wechatConfig = function(e, t) { return u("api.index.getWxConfig", e, t); }, t.createH5Poster = function(e, t) { return u("api.index.createH5Poster", e, t); }, t.buykmList = function(e, t) { return u("api.Resource.buykmList", e, t); }, t.spreadPoster = function(e, t, n) { return u("api.user.spreadPoster", e, t, n); }, t.spreadH5Poster = function(e, t) { return u("api.user.spreadH5Poster", e, t); }, t.smsLogin = function(e, t) { return u("api.login.smsLogin", e, t); }; }).call(this, n(1).default); }, 15: function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.apiUrl = void 0; var r = function(e) { return e && e.__esModule ? e : { default: e }; }(n(16)).default.siteurl; t.apiUrl = r; }, 16: function(e, t) { e.exports = { name: "智创云享", version: "3.0.1", siteurl: "https://we.56juben.cn/" }; }, 17: function(e, t, n) { "use strict"; (function(e) { Object.defineProperty(t, "__esModule", { value: !0 }), t.deepCopy = function e(t, n) { if ("object" != typeof n) return n; for (var r in n) { var i = {}; t[r] && (i = t[r]), t[r] = e(i, n[r]); } return t; }, t.jumpToLogin = function(t) { Date.parse(new Date()); var n = r.get("jump_to_login"); n || (n = 0), e.showToast({ title: "请稍后...", icon: "none", duration: 1e3, success: function(t) { setTimeout(function() { e.hideToast(), e.navigateTo({ url: "/pages/login/index", animationType: "pop-in", animationDuration: 200 }); }, 500); } }); }, t.timeToDate = function(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return function(e) { var n = (e = new Date(1e3 * e)).getFullYear() + "-", r = (e.getMonth() + 1 < 10 ? "0" + (e.getMonth() + 1) : e.getMonth() + 1) + "-", i = (e.getDate() < 10 ? "0" + e.getDate() : e.getDate()) + " ", o = (e.getHours() < 10 ? "0" + e.getHours() : e.getHours()) + ":", a = (e.getMinutes() < 10 ? "0" + e.getMinutes() : e.getMinutes()) + ":", s = e.getSeconds() < 10 ? "0" + e.getSeconds() : e.getSeconds(); return t ? n + r + i : n + r + i + o + a + s; }(e); }, t.formatMoney = function(e, t, n, r, i) { e = e || 0, t = isNaN(t = Math.abs(t)) ? 2 : t, n = void 0 !== n ? n : "¥", r = r || ",", i = i || "."; var o = e < 0 ? "-" : "", a = parseInt(e = Math.abs(+e || 0).toFixed(t), 10) + "", s = (s = a.length) > 3 ? s % 3 : 0; return n + o + (s ? a.substr(0, s) + r : "") + a.substr(s).replace(/(\d{3})(?=\d)/g, "$1" + r) + (t ? i + Math.abs(e - a).toFixed(t).slice(2) : ""); }, t.successToShow = function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "保存成功", n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : function() {}; setTimeout(function() { e.showToast({ title: t, icon: "success", duration: 1e3, success: function() { setTimeout(function() { n(); }, 500); } }); }, 100); }, t.throttle = function(e, t, n) { clearTimeout(e.timeoutId), e.timeoutId = setTimeout(function() { e.call(t); }, n); }, t.errorToShow = function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "操作失败", n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : function() {}; setTimeout(function() { e.showToast({ title: t, icon: "none", duration: 1500, success: function() { setTimeout(function() { n(); }, 1500); } }); }, 100); }, t.time2date = function(e) { var t = {}, n = Math.floor(e); return t.day = a(Math.floor(n / 3600 / 24), 2), t.hour = a(Math.floor(n / 3600 % 24), 2), t.minute = a(Math.floor(n / 60 % 60), 2), t.second = a(Math.floor(n % 60), 2), t.day > 0 ? t.day + "天" + t.hour + "小时" + t.minute + "分" + t.second + "秒" : 0 != t.hour ? t.hour + "小时" + t.minute + "分" + t.second + "秒" : t.minute + "分" + t.second + "秒"; }, t.isPhoneNumber = function(e) { return !!/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(e); }, t.isInArray = function(e, t) { for (var n = 0; n < e.length; n++) if (t === e[n]) return !0; return !1; }, t.loadToShow = function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "加载中"; e.showToast({ title: t, icon: "loading" }); }, t.loadToHide = function() { e.hideToast(); }, t.navigateTo = s, t.redirectTo = function(t) { e.redirectTo({ url: t, animationType: "pop-in", animationDuration: 300 }); }, t.modelShow = function() { var t, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "提示", r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "确认执行此操作吗?", i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : function() {}, a = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : "取消", c = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : "确定"; e.showModal((o(t = { title: n, content: r, showCancel: a, cancelText: s, confirmText: c }, "cancelText", s), o(t, "success", function(e) { e.confirm ? setTimeout(function() { i(); }, 500) : e.cancel; }), t)); }, t.builderParams = function(e) { if (void 0 === e || null == e || "object" != typeof e) return ""; var t = ""; for (var n in e) t += ("" == t ? "&" : "") + n + "=" + encodeURI(e[n]); return t; }, t.isWeiXinBrowser = function() { return !1; }, t.dateformat = function(e) { var t = {}, n = Math.floor(e / 1e3); return t.day = a(Math.floor(n / 3600 / 24), 2), t.hour = a(Math.floor(n / 3600 % 24), 2), t.minute = a(Math.floor(n / 60 % 60), 2), t.second = a(Math.floor(n % 60), 2), t; }, t.getQueryString = function(e, t) { t = t || window.location.href; var n = new RegExp("(^|&|/?)" + e + "=([^&|/?]*)(&|/?|$)", "i"), r = t.substr(1).match(n); return null != r ? r[2] : null; }, t.timeToDateObj = function(e) { var t = {}, n = Math.floor(e); return t.day = Math.floor(n / 3600 / 24), t.hour = Math.floor(n / 3600 % 24), t.minute = Math.floor(n / 60 % 60), t.second = Math.floor(n % 60), t; }, t.moneySum = function(e, t) { return (parseFloat(e) + parseFloat(t)).toFixed(2); }, t.moneySub = function(e, t) { var n = (parseFloat(e) - parseFloat(t)).toFixed(2); return n > 0 ? n : 0; }, t.goviewTo = function(e, t) { switch (parseInt(e)) { case 1: s("/pages/resource/resource?id=" + t); break; case 2: s("/pages/resource/video?id=" + t); break; case 3: s("/pages/resource/normal?id=" + t); break; case 4: s("/pages/resource/coursevideo?id=" + t); break; case 5: s("/pages/resource/courseaudio?id=" + t); break; case 6: s("/pages/resource/cdkey?id=" + t); } }, t.getPrice = function(e) { var t = "免费"; return e > 0 && (t = e), t; }, t.shareUrlEncode = function(e) { var t = e.split("-"); return "type=" + t[0] + "&fid=" + t[1] + "&uid=" + t[2] + "&id=" + t[3]; }, t.shareUrlDecode = function(e) { for (var t = e.split("&"), n = { type: "", fid: "", uid: "", id: "" }, r = 0; r < t.length; r++) { var i = t[r].split("="); n[i[0]] = i[1]; } return n.type + "-" + n.fid + "-" + n.uid + "-" + n.id; }, t.getPagePath = function(e, t) { switch (parseInt(e)) { case 1: return "/pages/resource/resource?id=" + t; case 2: return "/pages/resource/video?id=" + t; case 3: return "/pages/resource/normal?id=" + t; case 4: return "/pages/resource/coursevideo?id=" + t; case 5: return "/pages/resource/courseaudio?id=" + t; case 6: return "/pages/resource/cdkey?id=" + t; } }; var r = function(e) { if (e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = i(); if (t && t.has(e)) return t.get(e); var n = {}, r = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var o in e) if (Object.prototype.hasOwnProperty.call(e, o)) { var a = r ? Object.getOwnPropertyDescriptor(e, o) : null; a && (a.get || a.set) ? Object.defineProperty(n, o, a) : n[o] = e[o]; } return n.default = e, t && t.set(e, n), n; }(n(18)); function i() { if ("function" != typeof WeakMap) return null; var e = new WeakMap(); return i = function() { return e; }, e; } function o(e, t, n) { return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e; } function a(e, t) { return (Array(t).join("0") + e).slice(-t); } function s(t) { e.navigateTo({ url: t, animationType: "pop-in", animationDuration: 300 }); } }).call(this, n(1).default); }, 18: function(e, t, n) { "use strict"; (function(e) { Object.defineProperty(t, "__esModule", { value: !0 }), t.get = o, t.set = function(t, n) { var r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; try { if (r) return e.setStorageSync(t, n); e.setStorage({ key: t, data: n }); } catch (e) {} }, t.del = function(t) { var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; try { if (n) return e.removeStorageSync(t); e.removeStorage({ key: t }); } catch (e) { return !1; } }, t.clear = function() { var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; try { if (t) return e.clearStorageSync(); e.clearStorage(); } catch (e) { return !1; } }, t.userToken = function(e) { var t = o("userToken"); t ? e(t) : r.jumpToLogin(); }; var r = function(e) { if (e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = i(); if (t && t.has(e)) return t.get(e); var n = {}, r = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var o in e) if (Object.prototype.hasOwnProperty.call(e, o)) { var a = r ? Object.getOwnPropertyDescriptor(e, o) : null; a && (a.get || a.set) ? Object.defineProperty(n, o, a) : n[o] = e[o]; } return n.default = e, t && t.set(e, n), n; }(n(17)); function i() { if ("function" != typeof WeakMap) return null; var e = new WeakMap(); return i = function() { return e; }, e; } function o(t) { var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; try { if (n) return e.getStorageSync(t); var r = ""; return e.getStorage({ key: t, success: function(e) { r = e.data; } }), r; } catch (e) { return !1; } } }).call(this, n(1).default); }, 19: function(e, t, n) { "use strict"; (function(e) { Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var n = { data: function() { return { share: { title: "share测试", path: "/pages/tabbar/home/index", imageUrl: "", desc: "", content: "" } }; }, onShareTimeline: function(t) { var n = "/pages/share/jump?type=1&fid=" + this.$db.get("invite_fid") + "&uid=" + this.$db.get("invite_uid"); return { title: this.$db.get("config").share.title, imageUrl: this.$db.get("config").share.img, query: n, success: function(t) { e.showToast({ title: "分享成功" }); }, fail: function(t) { e.showToast({ title: "分享失败", icon: "none" }); } }; }, onShareAppMessage: function(t) { var n = "/pages/share/jump?type=1&fid=" + this.$db.get("invite_fid") + "&uid=" + this.$db.get("invite_uid"); return { title: this.$db.get("config").share.title, imageUrl: this.$db.get("config").share.img, content: this.share.content, path: n, success: function(t) { e.showToast({ title: "分享成功" }); }, fail: function(t) { e.showToast({ title: "分享失败", icon: "none" }); } }; } }; t.default = n; }).call(this, n(1).default); }, 2: function(e, t) { var n; n = function() { return this; }(); try { n = n || new Function("return this")(); } catch (e) { "object" == typeof window && (n = window); } e.exports = n; }, 20: function(e, t) {}, 285: function(e, t, n) { "use strict"; (function(e) { Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var n = { props: { localdata: { type: [ Array, Object ], default: function() { return []; } }, spaceInfo: { type: Object, default: function() { return {}; } }, collection: { type: String, default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [ String, Object ], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [ Boolean, String ], default: !1 }, getone: { type: [ Boolean, String ], default: !1 }, gettree: { type: [ Boolean, String ], default: !1 }, manual: { type: Boolean, default: !1 }, value: { type: [ Array, String, Number ], default: function() { return []; } }, modelValue: { type: [ Array, String, Number ], default: function() { return []; } }, preload: { type: Boolean, default: !1 }, stepSearh: { type: Boolean, default: !0 }, selfField: { type: String, default: "" }, parentField: { type: String, default: "" }, multiple: { type: Boolean, default: !1 }, map: { type: Object, default: function() { return { text: "text", value: "value" }; } } }, data: function() { return { loading: !1, errorMessage: "", loadMore: { contentdown: "", contentrefresh: "", contentnomore: "" }, dataList: [], selected: [], selectedIndex: 0, page: { current: this.pageCurrent, size: this.pageSize, count: 0 } }; }, computed: { isLocaldata: function() { return !this.collection.length; }, postField: function() { var e = [ this.field ]; return this.parentField && e.push("".concat(this.parentField, " as parent_value")), e.join(","); }, dataValue: function() { return (Array.isArray(this.modelValue) ? this.modelValue.length > 0 : null !== this.modelValue || void 0 !== this.modelValue) ? this.modelValue : this.value; }, hasValue: function() { return "number" == typeof this.dataValue || null != this.dataValue && this.dataValue.length > 0; } }, created: function() { var e = this; this.$watch(function() { var t = []; return [ "pageCurrent", "pageSize", "spaceInfo", "value", "modelValue", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree" ].forEach(function(n) { t.push(e[n]); }), t; }, function(t, n) { for (var r = 2; r < t.length && t[r] == n[r]; r++) ; t[0] != n[0] && (e.page.current = e.pageCurrent), e.page.size = e.pageSize, e.onPropsChange(); }), this._treeData = []; }, methods: { onPropsChange: function() { this._treeData = []; }, getCommand: function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n = e.database(this.spaceInfo), r = t.action || this.action; r && (n = n.action(r)); var i = t.collection || this.collection; n = n.collection(i); var o = t.where || this.where; o && Object.keys(o).length && (n = n.where(o)); var a = t.field || this.field; a && (n = n.field(a)); var s = t.orderby || this.orderby; s && (n = n.orderBy(s)); var c = void 0 !== t.pageCurrent ? t.pageCurrent : this.page.current, u = void 0 !== t.pageSize ? t.pageSize : this.page.size, l = void 0 !== t.getcount ? t.getcount : this.getcount, f = void 0 !== t.gettree ? t.gettree : this.gettree, p = { getCount: l, getTree: f }; return t.getTreePath && (p.getTreePath = t.getTreePath), n = n.skip(u * (c - 1)).limit(u).get(p); }, getNodeData: function(e) { var t = this; this.loading || (this.loading = !0, this.getCommand({ field: this.postField, where: this._pathWhere() }).then(function(n) { t.loading = !1, t.selected = n.result.data, e && e(); }).catch(function(e) { t.loading = !1, t.errorMessage = e; })); }, getTreePath: function(e) { var t = this; this.loading || (this.loading = !0, this.getCommand({ field: this.postField, getTreePath: { startWith: "".concat(this.selfField, "=='").concat(this.dataValue, "'") } }).then(function(n) { t.loading = !1; var r = []; t._extractTreePath(n.result.data, r), t.selected = r, e && e(); }).catch(function(e) { t.loading = !1, t.errorMessage = e; })); }, loadData: function() { var e = this; this.isLocaldata ? this._processLocalData() : null == this.dataValue ? this.stepSearh ? this._loadNodeData(function(t) { e._treeData = t, e._updateBindData(); }) : this._loadAllData(function(t) { e._treeData = [], e._extractTree(t, e._treeData, null), e._updateBindData(); }) : this._loadNodeData(function(t) { e._treeData = t, e._updateBindData(), e._updateSelected(); }); }, _loadAllData: function(e) { var t = this; this.loading || (this.loading = !0, this.getCommand({ field: this.postField, gettree: !0, startwith: "".concat(this.selfField, "=='").concat(this.dataValue, "'") }).then(function(n) { t.loading = !1, e(n.result.data), t.onDataChange(); }).catch(function(e) { t.loading = !1, t.errorMessage = e; })); }, _loadNodeData: function(e, t) { var n = this; this.loading || (this.loading = !0, this.getCommand({ field: this.postField, where: t || this._postWhere(), pageSize: 500 }).then(function(t) { n.loading = !1, e(t.result.data), n.onDataChange(); }).catch(function(e) { n.loading = !1, n.errorMessage = e; })); }, _pathWhere: function() { var e = [], t = this._getParentNameByField(); return t && e.push("".concat(t, " == '").concat(this.dataValue, "'")), this.where ? "(".concat(this.where, ") && (").concat(e.join(" || "), ")") : e.join(" || "); }, _postWhere: function() { var e = [], t = this.selected, n = this.parentField; if (n && e.push("".concat(n, " == null || ").concat(n, ' == ""')), t.length) for (var r = 0; r < t.length - 1; r++) e.push("".concat(n, " == '").concat(t[r].value, "'")); var i = []; return this.where && i.push("(".concat(this.where, ")")), e.length && i.push("(".concat(e.join(" || "), ")")), i.join(" && "); }, _nodeWhere: function() { var e = [], t = this.selected; return t.length && e.push("".concat(this.parentField, " == '").concat(t[t.length - 1].value, "'")), this.where ? "(".concat(this.where, ") && (").concat(e.join(" || "), ")") : e.join(" || "); }, _getParentNameByField: function() { for (var e = this.field.split(","), t = null, n = 0; n < e.length; n++) { var r = e[n].split("as"); if (!(r.length < 2) && "value" === r[1].trim()) { t = r[0].trim(); break; } } return t; }, _isTreeView: function() { return this.parentField && this.selfField; }, _updateSelected: function() { for (var e = this.dataList, t = this.selected, n = this.map.text, r = this.map.value, i = 0; i < t.length; i++) for (var o = t[i].value, a = e[i], s = 0; s < a.length; s++) { var c = a[s]; if (c[r] === o) { t[i].text = c[n]; break; } } }, _updateBindData: function(e) { var t = this._filterData(this._treeData, this.selected), n = t.dataList, r = t.hasNodes, i = !1 === this._stepSearh && !r; return e && (e.isleaf = i), this.dataList = n, this.selectedIndex = n.length - 1, !i && this.selected.length < n.length && this.selected.push({ value: null, text: "请选择" }), { isleaf: i, hasNodes: r }; }, _filterData: function(e, t) { var n = [], r = !0; n.push(e.filter(function(e) { return null === e.parent_value || void 0 === e.parent_value || "" === e.parent_value; })); for (var i = 0; i < t.length; i++) { var o = t[i].value, a = e.filter(function(e) { return e.parent_value === o; }); a.length ? n.push(a) : r = !1; } return { dataList: n, hasNodes: r }; }, _extractTree: function(e, t, n) { for (var r = this.map.value, i = 0; i < e.length; i++) { var o = e[i], a = {}; for (var s in o) "children" !== s && (a[s] = o[s]); null != n && "" !== n && (a.parent_value = n), t.push(a); var c = o.children; c && this._extractTree(c, t, o[r]); } }, _extractTreePath: function(e, t) { for (var n = 0; n < e.length; n++) { var r = e[n], i = {}; for (var o in r) "children" !== o && (i[o] = r[o]); t.push(i); var a = r.children; a && this._extractTreePath(a, t); } }, _findNodePath: function(e, t) { for (var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [], r = this.map.text, i = this.map.value, o = 0; o < t.length; o++) { var a = t[o], s = a.children, c = a[r], u = a[i]; if (n.push({ value: u, text: c }), u === e) return n; if (s) { var l = this._findNodePath(e, s, n); if (l.length) return l; } n.pop(); } return []; }, _processLocalData: function() { this._treeData = [], this._extractTree(this.localdata, this._treeData); var e = this.dataValue; void 0 !== e && (Array.isArray(e) && "object" == typeof (e = e[e.length - 1]) && e[this.map.value] && (e = e[this.map.value]), this.selected = this._findNodePath(e, this.localdata)); } } }; t.default = n; }).call(this, n(286).default); }, 286: function(e, t, n) { "use strict"; (function(e, r) { Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var i = s(n(287)), o = n(3), a = s(n(290)); function s(e) { return e && e.__esModule ? e : { default: e }; } function c(e, t, n, r, i, o, a) { try { var s = e[o](a), c = s.value; } catch (e) { return void n(e); } s.done ? t(c) : Promise.resolve(c).then(r, i); } function u(e) { return function() { var t = this, n = arguments; return new Promise(function(r, i) { var o = e.apply(t, n); function a(e) { c(o, r, i, a, s, "next", e); } function s(e) { c(o, r, i, a, s, "throw", e); } a(void 0); }); }; } function l(e) { return function(e) { if (Array.isArray(e)) return h(e); }(e) || function(e) { if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) return Array.from(e); }(e) || p(e) || function() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }(); } function f(e, t) { var n; if ("undefined" == typeof Symbol || null == e[Symbol.iterator]) { if (Array.isArray(e) || (n = p(e)) || t && e && "number" == typeof e.length) { n && (e = n); var r = 0, i = function() {}; return { s: i, n: function() { return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] }; }, e: function(e) { throw e; }, f: i }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, s = !1; return { s: function() { n = e[Symbol.iterator](); }, n: function() { var e = n.next(); return a = e.done, e; }, e: function(e) { s = !0, o = e; }, f: function() { try { a || null == n.return || n.return(); } finally { if (s) throw o; } } }; } function p(e, t) { if (e) { if ("string" == typeof e) return h(e, t); var n = Object.prototype.toString.call(e).slice(8, -1); return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? h(e, t) : void 0; } } function h(e, t) { (null == t || t > e.length) && (t = e.length); for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n]; return r; } function d(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); } } function v(e, t, n) { return t && d(e.prototype, t), n && d(e, n), e; } function g(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e); t && (r = r.filter(function(t) { return Object.getOwnPropertyDescriptor(e, t).enumerable; })), n.push.apply(n, r); } return n; } function y(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? arguments[t] : {}; t % 2 ? g(Object(n), !0).forEach(function(t) { m(e, t, n[t]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : g(Object(n)).forEach(function(t) { Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t)); }); } return e; } function m(e, t, n) { return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e; } function _(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function b(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && O(e, t); } function w(e) { var t = T(); return function() { var n, r = A(e); if (t) { var i = A(this).constructor; n = Reflect.construct(r, arguments, i); } else n = r.apply(this, arguments); return k(this, n); }; } function k(e, t) { return !t || "object" != typeof t && "function" != typeof t ? function(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }(e) : t; } function x(e) { var t = "function" == typeof Map ? new Map() : void 0; return (x = function(e) { if (null === e || !function(e) { return -1 !== Function.toString.call(e).indexOf("[native code]"); }(e)) return e; if ("function" != typeof e) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== t) { if (t.has(e)) return t.get(e); t.set(e, n); } function n() { return S(e, arguments, A(this).constructor); } return n.prototype = Object.create(e.prototype, { constructor: { value: n, enumerable: !1, writable: !0, configurable: !0 } }), O(n, e); })(e); } function S(e, t, n) { return (S = T() ? Reflect.construct : function(e, t, n) { var r = [ null ]; r.push.apply(r, t); var i = new (Function.bind.apply(e, r))(); return n && O(i, n.prototype), i; }).apply(null, arguments); } function T() { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0; } catch (e) { return !1; } } function O(e, t) { return (O = Object.setPrototypeOf || function(e, t) { return e.__proto__ = t, e; })(e, t); } function A(e) { return (A = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) { return e.__proto__ || Object.getPrototypeOf(e); })(e); } function P(e, t, n) { return e(n = { path: t, exports: {}, require: function(e, t) { return function() { throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs"); }(null == t && n.path); } }, n.exports), n.exports; } "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== e || "undefined" != typeof self && self; var I = P(function(e, t) { var n; e.exports = n = n || function(e, t) { var n = Object.create || function() { function e() {} return function(t) { var n; return e.prototype = t, n = new e(), e.prototype = null, n; }; }(), r = {}, i = r.lib = {}, o = i.Base = { extend: function(e) { var t = n(this); return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function() { t.$super.init.apply(this, arguments); }), t.init.prototype = t, t.$super = this, t; }, create: function() { var e = this.extend(); return e.init.apply(e, arguments), e; }, init: function() {}, mixIn: function(e) { for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t]); e.hasOwnProperty("toString") && (this.toString = e.toString); }, clone: function() { return this.init.prototype.extend(this); } }, a = i.WordArray = o.extend({ init: function(e, t) { e = this.words = e || [], this.sigBytes = null != t ? t : 4 * e.length; }, toString: function(e) { return (e || c).stringify(this); }, concat: function(e) { var t = this.words, n = e.words, r = this.sigBytes, i = e.sigBytes; if (this.clamp(), r % 4) for (var o = 0; o < i; o++) { var a = n[o >>> 2] >>> 24 - o % 4 * 8 & 255; t[r + o >>> 2] |= a << 24 - (r + o) % 4 * 8; } else for (o = 0; o < i; o += 4) t[r + o >>> 2] = n[o >>> 2]; return this.sigBytes += i, this; }, clamp: function() { var t = this.words, n = this.sigBytes; t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4); }, clone: function() { var e = o.clone.call(this); return e.words = this.words.slice(0), e; }, random: function(t) { for (var n, r = [], i = function(t) { t = t; var n = 987654321, r = 4294967295; return function() { var i = ((n = 36969 * (65535 & n) + (n >> 16) & r) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & r) & r; return i /= 4294967296, (i += .5) * (e.random() > .5 ? 1 : -1); }; }, o = 0; o < t; o += 4) { var s = i(4294967296 * (n || e.random())); n = 987654071 * s(), r.push(4294967296 * s() | 0); } return new a.init(r, t); } }), s = r.enc = {}, c = s.Hex = { stringify: function(e) { for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) { var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 255; r.push((o >>> 4).toString(16)), r.push((15 & o).toString(16)); } return r.join(""); }, parse: function(e) { for (var t = e.length, n = [], r = 0; r < t; r += 2) n[r >>> 3] |= parseInt(e.substr(r, 2), 16) << 24 - r % 8 * 4; return new a.init(n, t / 2); } }, u = s.Latin1 = { stringify: function(e) { for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) { var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 255; r.push(String.fromCharCode(o)); } return r.join(""); }, parse: function(e) { for (var t = e.length, n = [], r = 0; r < t; r++) n[r >>> 2] |= (255 & e.charCodeAt(r)) << 24 - r % 4 * 8; return new a.init(n, t); } }, l = s.Utf8 = { stringify: function(e) { try { return decodeURIComponent(escape(u.stringify(e))); } catch (e) { throw new Error("Malformed UTF-8 data"); } }, parse: function(e) { return u.parse(unescape(encodeURIComponent(e))); } }, f = i.BufferedBlockAlgorithm = o.extend({ reset: function() { this._data = new a.init(), this._nDataBytes = 0; }, _append: function(e) { "string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes; }, _process: function(t) { var n = this._data, r = n.words, i = n.sigBytes, o = this.blockSize, s = i / (4 * o), c = (s = t ? e.ceil(s) : e.max((0 | s) - this._minBufferSize, 0)) * o, u = e.min(4 * c, i); if (c) { for (var l = 0; l < c; l += o) this._doProcessBlock(r, l); var f = r.splice(0, c); n.sigBytes -= u; } return new a.init(f, u); }, clone: function() { var e = o.clone.call(this); return e._data = this._data.clone(), e; }, _minBufferSize: 0 }); i.Hasher = f.extend({ cfg: o.extend(), init: function(e) { this.cfg = this.cfg.extend(e), this.reset(); }, reset: function() { f.reset.call(this), this._doReset(); }, update: function(e) { return this._append(e), this._process(), this; }, finalize: function(e) { return e && this._append(e), this._doFinalize(); }, blockSize: 16, _createHelper: function(e) { return function(t, n) { return new e.init(n).finalize(t); }; }, _createHmacHelper: function(e) { return function(t, n) { return new p.HMAC.init(e, n).finalize(t); }; } }); var p = r.algo = {}; return r; }(Math); }), $ = (P(function(e, t) { var n; e.exports = (n = I, function(e) { var t = n, r = t.lib, i = r.WordArray, o = r.Hasher, a = t.algo, s = []; !function() { for (var t = 0; t < 64; t++) s[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0; }(); var c = a.MD5 = o.extend({ _doReset: function() { this._hash = new i.init([ 1732584193, 4023233417, 2562383102, 271733878 ]); }, _doProcessBlock: function(e, t) { for (var n = 0; n < 16; n++) { var r = t + n, i = e[r]; e[r] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8); } var o = this._hash.words, a = e[t + 0], c = e[t + 1], h = e[t + 2], d = e[t + 3], v = e[t + 4], g = e[t + 5], y = e[t + 6], m = e[t + 7], _ = e[t + 8], b = e[t + 9], w = e[t + 10], k = e[t + 11], x = e[t + 12], S = e[t + 13], T = e[t + 14], O = e[t + 15], A = o[0], P = o[1], I = o[2], $ = o[3]; A = u(A, P, I, $, a, 7, s[0]), $ = u($, A, P, I, c, 12, s[1]), I = u(I, $, A, P, h, 17, s[2]), P = u(P, I, $, A, d, 22, s[3]), A = u(A, P, I, $, v, 7, s[4]), $ = u($, A, P, I, g, 12, s[5]), I = u(I, $, A, P, y, 17, s[6]), P = u(P, I, $, A, m, 22, s[7]), A = u(A, P, I, $, _, 7, s[8]), $ = u($, A, P, I, b, 12, s[9]), I = u(I, $, A, P, w, 17, s[10]), P = u(P, I, $, A, k, 22, s[11]), A = u(A, P, I, $, x, 7, s[12]), $ = u($, A, P, I, S, 12, s[13]), I = u(I, $, A, P, T, 17, s[14]), A = l(A, P = u(P, I, $, A, O, 22, s[15]), I, $, c, 5, s[16]), $ = l($, A, P, I, y, 9, s[17]), I = l(I, $, A, P, k, 14, s[18]), P = l(P, I, $, A, a, 20, s[19]), A = l(A, P, I, $, g, 5, s[20]), $ = l($, A, P, I, w, 9, s[21]), I = l(I, $, A, P, O, 14, s[22]), P = l(P, I, $, A, v, 20, s[23]), A = l(A, P, I, $, b, 5, s[24]), $ = l($, A, P, I, T, 9, s[25]), I = l(I, $, A, P, d, 14, s[26]), P = l(P, I, $, A, _, 20, s[27]), A = l(A, P, I, $, S, 5, s[28]), $ = l($, A, P, I, h, 9, s[29]), I = l(I, $, A, P, m, 14, s[30]), A = f(A, P = l(P, I, $, A, x, 20, s[31]), I, $, g, 4, s[32]), $ = f($, A, P, I, _, 11, s[33]), I = f(I, $, A, P, k, 16, s[34]), P = f(P, I, $, A, T, 23, s[35]), A = f(A, P, I, $, c, 4, s[36]), $ = f($, A, P, I, v, 11, s[37]), I = f(I, $, A, P, m, 16, s[38]), P = f(P, I, $, A, w, 23, s[39]), A = f(A, P, I, $, S, 4, s[40]), $ = f($, A, P, I, a, 11, s[41]), I = f(I, $, A, P, d, 16, s[42]), P = f(P, I, $, A, y, 23, s[43]), A = f(A, P, I, $, b, 4, s[44]), $ = f($, A, P, I, x, 11, s[45]), I = f(I, $, A, P, O, 16, s[46]), A = p(A, P = f(P, I, $, A, h, 23, s[47]), I, $, a, 6, s[48]), $ = p($, A, P, I, m, 10, s[49]), I = p(I, $, A, P, T, 15, s[50]), P = p(P, I, $, A, g, 21, s[51]), A = p(A, P, I, $, x, 6, s[52]), $ = p($, A, P, I, d, 10, s[53]), I = p(I, $, A, P, w, 15, s[54]), P = p(P, I, $, A, c, 21, s[55]), A = p(A, P, I, $, _, 6, s[56]), $ = p($, A, P, I, O, 10, s[57]), I = p(I, $, A, P, y, 15, s[58]), P = p(P, I, $, A, S, 21, s[59]), A = p(A, P, I, $, v, 6, s[60]), $ = p($, A, P, I, k, 10, s[61]), I = p(I, $, A, P, h, 15, s[62]), P = p(P, I, $, A, b, 21, s[63]), o[0] = o[0] + A | 0, o[1] = o[1] + P | 0, o[2] = o[2] + I | 0, o[3] = o[3] + $ | 0; }, _doFinalize: function() { var t = this._data, n = t.words, r = 8 * this._nDataBytes, i = 8 * t.sigBytes; n[i >>> 5] |= 128 << 24 - i % 32; var o = e.floor(r / 4294967296), a = r; n[15 + (i + 64 >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), n[14 + (i + 64 >>> 9 << 4)] = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8), t.sigBytes = 4 * (n.length + 1), this._process(); for (var s = this._hash, c = s.words, u = 0; u < 4; u++) { var l = c[u]; c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8); } return s; }, clone: function() { var e = o.clone.call(this); return e._hash = this._hash.clone(), e; } }); function u(e, t, n, r, i, o, a) { var s = e + (t & n | ~t & r) + i + a; return (s << o | s >>> 32 - o) + t; } function l(e, t, n, r, i, o, a) { var s = e + (t & r | n & ~r) + i + a; return (s << o | s >>> 32 - o) + t; } function f(e, t, n, r, i, o, a) { var s = e + (t ^ n ^ r) + i + a; return (s << o | s >>> 32 - o) + t; } function p(e, t, n, r, i, o, a) { var s = e + (n ^ (t | ~r)) + i + a; return (s << o | s >>> 32 - o) + t; } t.MD5 = o._createHelper(c), t.HmacMD5 = o._createHmacHelper(c); }(Math), n.MD5); }), P(function(e, t) { var n, r, i; e.exports = (r = (n = I).lib.Base, i = n.enc.Utf8, void (n.algo.HMAC = r.extend({ init: function(e, t) { e = this._hasher = new e.init(), "string" == typeof t && (t = i.parse(t)); var n = e.blockSize, r = 4 * n; t.sigBytes > r && (t = e.finalize(t)), t.clamp(); for (var o = this._oKey = t.clone(), a = this._iKey = t.clone(), s = o.words, c = a.words, u = 0; u < n; u++) s[u] ^= 1549556828, c[u] ^= 909522486; o.sigBytes = a.sigBytes = r, this.reset(); }, reset: function() { var e = this._hasher; e.reset(), e.update(this._iKey); }, update: function(e) { return this._hasher.update(e), this; }, finalize: function(e) { var t = this._hasher, n = t.finalize(e); return t.reset(), t.finalize(this._oKey.clone().concat(n)); } }))); }), P(function(e, t) { e.exports = I.HmacMD5; })), j = "FUNCTION", C = "OBJECT"; function E(e) { return Object.prototype.toString.call(e).slice(8, -1).toLowerCase(); } function D(e) { return "object" === E(e); } function L(e) { return e && "string" == typeof e ? JSON.parse(e) : e; } var R, N = "mp-weixin"; R = N; var U = L(void 0), F = L([]) || [], M = ""; try { var B = n(291).default || n(291); M = B.appid; } catch (e) {} var q = {}; function V(e) { var t, n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; return t = q, n = e, Object.prototype.hasOwnProperty.call(t, n) || (q[e] = r), q[e]; } "app" === R && (q = r._globalUniCloudObj ? r._globalUniCloudObj : r._globalUniCloudObj = {}); var H = [ "invoke", "success", "fail", "complete" ], z = V("_globalUniCloudInterceptor"); function W(e, t) { z[e] || (z[e] = {}), D(t) && Object.keys(t).forEach(function(n) { H.indexOf(n) > -1 && function(e, t, n) { var r = z[e][t]; r || (r = z[e][t] = []), -1 === r.indexOf(n) && "function" == typeof n && r.push(n); }(e, n, t[n]); }); } function K(e, t) { z[e] || (z[e] = {}), D(t) ? Object.keys(t).forEach(function(n) { H.indexOf(n) > -1 && function(e, t, n) { var r = z[e][t]; if (r) { var i = r.indexOf(n); i > -1 && r.splice(i, 1); } }(e, n, t[n]); }) : delete z[e]; } function J(e, t) { return e && 0 !== e.length ? e.reduce(function(e, n) { return e.then(function() { return n(t); }); }, Promise.resolve()) : Promise.resolve(); } function G(e, t) { return z[e] && z[e][t] || []; } function Y(e) { W("callObject", e); } var X = V("_globalUniCloudListener"), Z = "response", Q = "needLogin", ee = "refreshToken", te = "clientdb", ne = "cloudfunction", re = "cloudobject"; function ie(e) { return X[e] || (X[e] = []), X[e]; } function oe(e, t) { var n = ie(e); n.includes(t) || n.push(t); } function ae(e, t) { var n = ie(e), r = n.indexOf(t); -1 !== r && n.splice(r, 1); } function se(e, t) { for (var n = ie(e), r = 0; r < n.length; r++) (0, n[r])(t); } var ce = !1, ue = new Promise(function(e) { ce && e(), function t() { if ("function" == typeof getCurrentPages) { var n = getCurrentPages(); n && n[0] && (ce = !0, e()); } ce || setTimeout(function() { t(); }, 30); }(); }); function le() { return ue; } function fe(e, t) { return t ? function(n) { var r = this, i = !1; if ("callFunction" === t) { var o = n && n.type || j; i = o !== j; } var a, s = "callFunction" === t && !i; a = this.isReady ? Promise.resolve() : this.initUniCloud, n = n || {}; var c = a.then(function() { return i ? Promise.resolve() : J(G(t, "invoke"), n); }).then(function() { return e.call(r, n); }).then(function(e) { return i ? Promise.resolve(e) : J(G(t, "success"), e).then(function() { return J(G(t, "complete"), e); }).then(function() { return s && se(Z, { type: ne, content: e }), Promise.resolve(e); }); }, function(e) { return i ? Promise.reject(e) : J(G(t, "fail"), e).then(function() { return J(G(t, "complete"), e); }).then(function() { return se(Z, { type: ne, content: e }), Promise.reject(e); }); }); if (!(n.success || n.fail || n.complete)) return c; c.then(function(e) { n.success && n.success(e), n.complete && n.complete(e), s && se(Z, { type: ne, content: e }); }, function(e) { n.fail && n.fail(e), n.complete && n.complete(e), s && se(Z, { type: ne, content: e }); }); } : function(t) { if (!((t = t || {}).success || t.fail || t.complete)) return e.call(this, t); e.call(this, t).then(function(e) { t.success && t.success(e), t.complete && t.complete(e); }, function(e) { t.fail && t.fail(e), t.complete && t.complete(e); }); }; } var pe, he = function(e) { b(n, e); var t = w(n); function n(e) { var r; return _(this, n), (r = t.call(this, e.message)).errMsg = e.message || "", r.errCode = r.code = e.code || "SYSTEM_ERROR", r.requestId = e.requestId, r; } return n; }(x(Error)); function de() { var e = r.getLocale && r.getLocale() || "en"; if (pe) return y(y({}, pe), {}, { locale: e, LOCALE: e }); for (var t = r.getSystemInfoSync(), n = t.deviceId, i = t.osName, o = t.uniPlatform, a = t.appId, s = [ "pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting" ], c = 0; c < s.length; c++) delete t[s[c]]; return pe = y(y({ PLATFORM: o, OS: i, APPID: a, DEVICEID: n }, function() { var e, t; try { if (r.getLaunchOptionsSync) { if (r.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return; var n = r.getLaunchOptionsSync(), i = n.scene; e = n.channel, t = i; } } catch (e) {} return { channel: e, scene: t }; }()), t), y(y({}, pe), {}, { locale: e, LOCALE: e }); } var ve, ge = function(e, t) { var n = ""; return Object.keys(e).sort().forEach(function(t) { e[t] && (n = n + "&" + t + "=" + e[t]); }), n = n.slice(1), $(n, t).toString(); }, ye = function(e, t) { return new Promise(function(n, r) { t(Object.assign(e, { complete: function(e) { e || (e = {}), "web" === R && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5"); var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"]; if (!e.statusCode || e.statusCode >= 400) return r(new he({ code: "SYS_ERR", message: e.errMsg || "request:fail", requestId: t })); var i = e.data; if (i.error) return r(new he({ code: i.error.code, message: i.error.message, requestId: t })); i.result = i.data, i.requestId = t, delete i.data, n(i); } })); }); }, me = { request: function(e) { return r.request(e); }, uploadFile: function(e) { return r.uploadFile(e); }, setStorageSync: function(e, t) { return r.setStorageSync(e, t); }, getStorageSync: function(e) { return r.getStorageSync(e); }, removeStorageSync: function(e) { return r.removeStorageSync(e); }, clearStorageSync: function() { return r.clearStorageSync(); } }, _e = { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, be = (0, o.initVueI18n)({ "zh-Hans": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, "zh-Hant": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, en: _e, fr: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, es: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, ja: _e }, "zh-Hans").t, we = function() { function e(t) { _(this, e), [ "spaceId", "clientSecret" ].forEach(function(e) { if (!Object.prototype.hasOwnProperty.call(t, e)) throw new Error(be("uniCloud.init.paramRequired", { param: e })); }), this.config = Object.assign({}, { endpoint: "https://api.bspapp.com" }, t), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = me, this._getAccessTokenPromise = null, this._getAccessTokenPromiseStatus = null; } return v(e, [ { key: "setAccessToken", value: function(e) { this.accessToken = e; } }, { key: "requestWrapped", value: function(e) { return ye(e, this.adapter.request); } }, { key: "requestAuth", value: function(e) { return this.requestWrapped(e); } }, { key: "request", value: function(e, t) { var n = this; return Promise.resolve().then(function() { return n.hasAccessToken ? t ? n.requestWrapped(e) : n.requestWrapped(e).catch(function(t) { return new Promise(function(e, n) { !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e(); }).then(function() { return n.getAccessToken(); }).then(function() { var t = n.rebuildRequest(e); return n.request(t, !0); }); }) : n.getAccessToken().then(function() { var t = n.rebuildRequest(e); return n.request(t, !0); }); }); } }, { key: "rebuildRequest", value: function(e) { var t = Object.assign({}, e); return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = ge(t.data, this.config.clientSecret), t; } }, { key: "setupRequest", value: function(e, t) { var n = Object.assign({}, e, { spaceId: this.config.spaceId, timestamp: Date.now() }), r = { "Content-Type": "application/json" }; return "auth" !== t && (n.token = this.accessToken, r["x-basement-token"] = this.accessToken), r["x-serverless-sign"] = ge(n, this.config.clientSecret), { url: this.config.requestUrl, method: "POST", data: n, dataType: "json", header: r }; } }, { key: "getAccessToken", value: function() { var e = this; return "pending" === this._getAccessTokenPromiseStatus || (this._getAccessTokenPromiseStatus = "pending", this._getAccessTokenPromise = this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then(function(t) { return new Promise(function(n, r) { t.result && t.result.accessToken ? (e.setAccessToken(t.result.accessToken), e._getAccessTokenPromiseStatus = "fulfilled", n(e.accessToken)) : (e._getAccessTokenPromiseStatus = "rejected", r(new he({ code: "AUTH_FAILED", message: "获取accessToken失败" }))); }); }, function(t) { return e._getAccessTokenPromiseStatus = "rejected", Promise.reject(t); })), this._getAccessTokenPromise; } }, { key: "authorize", value: function() { this.getAccessToken(); } }, { key: "callFunction", value: function(e) { var t = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e.name, functionArgs: e.data || {} }) }; return this.request(this.setupRequest(t)); } }, { key: "getOSSUploadOptionsFromPath", value: function(e) { var t = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e) }; return this.request(this.setupRequest(t)); } }, { key: "uploadFileToOSS", value: function(e) { var t = this, n = e.url, r = e.formData, i = e.name, o = e.filePath, a = e.fileType, s = e.onUploadProgress; return new Promise(function(e, c) { var u = t.adapter.uploadFile({ url: n, formData: r, name: i, filePath: o, fileType: a, header: { "X-OSS-server-side-encrpytion": "AES256" }, success: function(t) { t && t.statusCode < 400 ? e(t) : c(new he({ code: "UPLOAD_FAILED", message: "文件上传失败" })); }, fail: function(e) { c(new he({ code: e.code || "UPLOAD_FAILED", message: e.message || e.errMsg || "文件上传失败" })); } }); "function" == typeof s && u && "function" == typeof u.onProgressUpdate && u.onProgressUpdate(function(e) { s({ loaded: e.totalBytesSent, total: e.totalBytesExpectedToSend }); }); }); } }, { key: "reportOSSUpload", value: function(e) { var t = { method: "serverless.file.resource.report", params: JSON.stringify(e) }; return this.request(this.setupRequest(t)); } }, { key: "uploadFile", value: function(e) { var t = this, n = e.filePath, r = e.cloudPath, i = e.fileType, o = void 0 === i ? "image" : i, a = e.onUploadProgress, s = e.config; if ("string" !== E(r)) throw new he({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" }); if (!(r = r.trim())) throw new he({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" }); if (/:\/\//.test(r)) throw new he({ code: "INVALID_PARAM", message: "cloudPath不合法" }); var c, u, l = s && s.envType || this.config.envType; return this.getOSSUploadOptionsFromPath({ env: l, filename: r }).then(function(e) { var r = e.result; c = r.id, u = "https://" + r.cdnDomain + "/" + r.ossPath; var i = { url: "https://" + r.host, formData: { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: r.accessKeyId, Signature: r.signature, host: r.host, id: c, key: r.ossPath, policy: r.policy, success_action_status: 200 }, fileName: "file", name: "file", filePath: n, fileType: o }; return t.uploadFileToOSS(Object.assign({}, i, { onUploadProgress: a })); }).then(function() { return t.reportOSSUpload({ id: c }); }).then(function(e) { return new Promise(function(t, r) { e.success ? t({ success: !0, filePath: n, fileID: u }) : r(new he({ code: "UPLOAD_FAILED", message: "文件上传失败" })); }); }); } }, { key: "deleteFile", value: function(e) { var t = e.fileList, n = { method: "serverless.file.resource.delete", params: JSON.stringify({ id: t[0] }) }; return this.request(this.setupRequest(n)); } }, { key: "getTempFileURL", value: function() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = e.fileList; return new Promise(function(e, n) { Array.isArray(t) && 0 !== t.length || n(new he({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), e({ fileList: t.map(function(e) { return { fileID: e, tempFileURL: e }; }) }); }); } }, { key: "hasAccessToken", get: function() { return !!this.accessToken; } } ]), e; }(), ke = { init: function(e) { var t = new we(e), n = { signInAnonymously: function() { return t.authorize(); }, getLoginState: function() { return Promise.resolve(!1); } }; return t.auth = function() { return n; }, t.customAuth = t.auth, t; } }, xe = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:"; !function(e) { e.local = "local", e.none = "none", e.session = "session"; }(ve || (ve = {})); var Se, Te = function() { var e; if (!Promise) { (e = function() {}).promise = {}; var t = function() { throw new he({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' }); }; return Object.defineProperty(e.promise, "then", { get: t }), Object.defineProperty(e.promise, "catch", { get: t }), e; } var n = new Promise(function(t, n) { e = function(e, r) { return e ? n(e) : t(r); }; }); return e.promise = n, e; }; function Oe(e) { return void 0 === e; } function Ae(e) { return "[object Null]" === Object.prototype.toString.call(e); } !function(e) { e.WEB = "web", e.WX_MP = "wx_mp"; }(Se || (Se = {})); var Pe = { adapter: null, runtime: void 0 }, Ie = [ "anonymousUuidKey" ], $e = function(e) { b(n, e); var t = w(n); function n() { var e; return _(this, n), e = t.call(this), Pe.adapter.root.tcbObject || (Pe.adapter.root.tcbObject = {}), e; } return v(n, [ { key: "setItem", value: function(e, t) { Pe.adapter.root.tcbObject[e] = t; } }, { key: "getItem", value: function(e) { return Pe.adapter.root.tcbObject[e]; } }, { key: "removeItem", value: function(e) { delete Pe.adapter.root.tcbObject[e]; } }, { key: "clear", value: function() { delete Pe.adapter.root.tcbObject; } } ]), n; }(function() {}); function je(e, t) { switch (e) { case "local": return t.localStorage || new $e(); case "none": return new $e(); default: return t.sessionStorage || new $e(); } } var Ce = function() { function e(t) { if (_(this, e), !this._storage) { this._persistence = Pe.adapter.primaryStorage || t.persistence, this._storage = je(this._persistence, Pe.adapter); var n = "access_token_".concat(t.env), r = "access_token_expire_".concat(t.env), i = "refresh_token_".concat(t.env), o = "anonymous_uuid_".concat(t.env), a = "login_type_".concat(t.env), s = "user_info_".concat(t.env); this.keys = { accessTokenKey: n, accessTokenExpireKey: r, refreshTokenKey: i, anonymousUuidKey: o, loginTypeKey: a, userInfoKey: s }; } } return v(e, [ { key: "updatePersistence", value: function(e) { if (e !== this._persistence) { var t = "local" === this._persistence; this._persistence = e; var n = je(e, Pe.adapter); for (var r in this.keys) { var i = this.keys[r]; if (!t || !Ie.includes(r)) { var o = this._storage.getItem(i); Oe(o) || Ae(o) || (n.setItem(i, o), this._storage.removeItem(i)); } } this._storage = n; } } }, { key: "setStore", value: function(e, t, n) { if (this._storage) { var r = { version: n || "localCachev1", content: t }, i = JSON.stringify(r); try { this._storage.setItem(e, i); } catch (e) { throw e; } } } }, { key: "getStore", value: function(e, t) { try { if (!this._storage) return; } catch (e) { return ""; } t = t || "localCachev1"; var n = this._storage.getItem(e); return n && n.indexOf(t) >= 0 ? JSON.parse(n).content : ""; } }, { key: "removeStore", value: function(e) { this._storage.removeItem(e); } } ]), e; }(), Ee = {}, De = {}; function Le(e) { return Ee[e]; } var Re = function e(t, n) { _(this, e), this.data = n || null, this.name = t; }, Ne = function(e) { b(n, e); var t = w(n); function n(e, r) { var i; return _(this, n), (i = t.call(this, "error", { error: e, data: r })).error = e, i; } return n; }(Re), Ue = new (function() { function e() { _(this, e), this._listeners = {}; } return v(e, [ { key: "on", value: function(e, t) { return function(e, t, n) { n[e] = n[e] || [], n[e].push(t); }(e, t, this._listeners), this; } }, { key: "off", value: function(e, t) { return function(e, t, n) { if (n && n[e]) { var r = n[e].indexOf(t); -1 !== r && n[e].splice(r, 1); } }(e, t, this._listeners), this; } }, { key: "fire", value: function(e, t) { if (e instanceof Ne) return console.error(e.error), this; var n = "string" == typeof e ? new Re(e, t || {}) : e, r = n.name; if (this._listens(r)) { n.target = this; var i, o = f(this._listeners[r] ? l(this._listeners[r]) : []); try { for (o.s(); !(i = o.n()).done; ) i.value.call(this, n); } catch (e) { o.e(e); } finally { o.f(); } } return this; } }, { key: "_listens", value: function(e) { return this._listeners[e] && this._listeners[e].length > 0; } } ]), e; }())(); function Fe(e, t) { Ue.on(e, t); } function Me(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; Ue.fire(e, t); } function Be(e, t) { Ue.off(e, t); } var qe, Ve = "loginStateChanged", He = "loginStateExpire", ze = "loginTypeChanged", We = "anonymousConverted", Ke = "refreshAccessToken"; !function(e) { e.ANONYMOUS = "ANONYMOUS", e.WECHAT = "WECHAT", e.WECHAT_PUBLIC = "WECHAT-PUBLIC", e.WECHAT_OPEN = "WECHAT-OPEN", e.CUSTOM = "CUSTOM", e.EMAIL = "EMAIL", e.USERNAME = "USERNAME", e.NULL = "NULL"; }(qe || (qe = {})); var Je = [ "auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered" ], Ge = { "X-SDK-Version": "1.3.5" }; function Ye(e, t, n) { var r = e[t]; e[t] = function(t) { var i = {}, o = {}; n.forEach(function(n) { var r = n.call(e, t), a = r.data, s = r.headers; Object.assign(i, a), Object.assign(o, s); }); var a = t.data; return a && function() { var e; if (e = a, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = y(y({}, a), i); else for (var n in i) a.append(n, i[n]); }(), t.headers = y(y({}, t.headers || {}), o), r.call(e, t); }; } function Xe() { var e = Math.random().toString(16).slice(2); return { data: { seqId: e }, headers: y(y({}, Ge), {}, { "x-seqid": e }) }; } var Ze = function() { function e() { var t, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; _(this, e), this.config = n, this._reqClass = new Pe.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: "请求在".concat(this.config.timeout / 1e3, "s内未完成,已中断"), restrictedMethods: [ "post" ] }), this._cache = Le(this.config.env), this._localCache = (t = this.config.env, De[t]), Ye(this._reqClass, "post", [ Xe ]), Ye(this._reqClass, "upload", [ Xe ]), Ye(this._reqClass, "download", [ Xe ]); } return v(e, [ { key: "post", value: function() { var e = u(i.default.mark(function e(t) { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.next = 2, this._reqClass.post(t); case 2: return e.abrupt("return", e.sent); case 3: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "upload", value: function() { var e = u(i.default.mark(function e(t) { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.next = 2, this._reqClass.upload(t); case 2: return e.abrupt("return", e.sent); case 3: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "download", value: function() { var e = u(i.default.mark(function e(t) { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.next = 2, this._reqClass.download(t); case 2: return e.abrupt("return", e.sent); case 3: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "refreshAccessToken", value: function() { var e = u(i.default.mark(function e() { var t, n; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken()), e.prev = 1, e.next = 4, this._refreshAccessTokenPromise; case 4: t = e.sent, e.next = 10; break; case 7: e.prev = 7, e.t0 = e.catch(1), n = e.t0; case 10: if (this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, !n) { e.next = 12; break; } throw n; case 12: return e.abrupt("return", t); case 13: case "end": return e.stop(); } }, e, this, [ [ 1, 7 ] ]); })); return function() { return e.apply(this, arguments); }; }() }, { key: "_refreshAccessToken", value: function() { var e = u(i.default.mark(function e() { var t, n, r, o, a, s, c, u, l, f, p, h, d; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: if (t = this._cache.keys, n = t.accessTokenKey, r = t.accessTokenExpireKey, o = t.refreshTokenKey, a = t.loginTypeKey, s = t.anonymousUuidKey, this._cache.removeStore(n), this._cache.removeStore(r), c = this._cache.getStore(o)) { e.next = 5; break; } throw new he({ message: "未登录CloudBase" }); case 5: return u = { refresh_token: c }, e.next = 8, this.request("auth.fetchAccessTokenWithRefreshToken", u); case 8: if (!(l = e.sent).data.code) { e.next = 21; break; } if ("SIGN_PARAM_INVALID" !== (f = l.data.code) && "REFRESH_TOKEN_EXPIRED" !== f && "INVALID_REFRESH_TOKEN" !== f) { e.next = 20; break; } if (this._cache.getStore(a) !== qe.ANONYMOUS || "INVALID_REFRESH_TOKEN" !== f) { e.next = 19; break; } return p = this._cache.getStore(s), h = this._cache.getStore(o), e.next = 17, this.send("auth.signInAnonymously", { anonymous_uuid: p, refresh_token: h }); case 17: return d = e.sent, e.abrupt("return", (this.setRefreshToken(d.refresh_token), this._refreshAccessToken())); case 19: Me(He), this._cache.removeStore(o); case 20: throw new he({ code: l.data.code, message: "刷新access token失败:".concat(l.data.code) }); case 21: if (!l.data.access_token) { e.next = 23; break; } return e.abrupt("return", (Me(Ke), this._cache.setStore(n, l.data.access_token), this._cache.setStore(r, l.data.access_token_expire + Date.now()), { accessToken: l.data.access_token, accessTokenExpire: l.data.access_token_expire })); case 23: l.data.refresh_token && (this._cache.removeStore(o), this._cache.setStore(o, l.data.refresh_token), this._refreshAccessToken()); case 24: case "end": return e.stop(); } }, e, this); })); return function() { return e.apply(this, arguments); }; }() }, { key: "getAccessToken", value: function() { var e = u(i.default.mark(function e() { var t, n, r, o, a, s, c; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: if (t = this._cache.keys, n = t.accessTokenKey, r = t.accessTokenExpireKey, o = t.refreshTokenKey, this._cache.getStore(o)) { e.next = 3; break; } throw new he({ message: "refresh token不存在,登录状态异常" }); case 3: if (a = this._cache.getStore(n), s = this._cache.getStore(r), c = !0, e.t0 = this._shouldRefreshAccessTokenHook, !e.t0) { e.next = 9; break; } return e.next = 8, this._shouldRefreshAccessTokenHook(a, s); case 8: e.t0 = !e.sent; case 9: if (e.t1 = e.t0, !e.t1) { e.next = 12; break; } c = !1; case 12: return e.abrupt("return", (!a || !s || s < Date.now()) && c ? this.refreshAccessToken() : { accessToken: a, accessTokenExpire: s }); case 13: case "end": return e.stop(); } }, e, this); })); return function() { return e.apply(this, arguments); }; }() }, { key: "request", value: function() { var e = u(i.default.mark(function e(t, n, r) { var o, a, s, c, u, l, f, p, h, d, v, g, m, _, b, w; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: if (o = "x-tcb-trace_".concat(this.config.env), a = "application/x-www-form-urlencoded", s = y({ action: t, env: this.config.env, dataVersion: "2019-08-16" }, n), -1 !== Je.indexOf(t)) { e.next = 10; break; } if (c = this._cache.keys.refreshTokenKey, e.t0 = this._cache.getStore(c), !e.t0) { e.next = 10; break; } return e.next = 9, this.getAccessToken(); case 9: s.access_token = e.sent.accessToken; case 10: if ("storage.uploadFile" === t) { for (l in u = new FormData()) u.hasOwnProperty(l) && void 0 !== u[l] && u.append(l, s[l]); a = "multipart/form-data"; } else for (f in a = "application/json", u = {}, s) void 0 !== s[f] && (u[f] = s[f]); return p = { headers: { "content-type": a } }, r && r.onUploadProgress && (p.onUploadProgress = r.onUploadProgress), (h = this._localCache.getStore(o)) && (p.headers["X-TCB-Trace"] = h), d = n.parse, v = n.inQuery, g = n.search, m = { env: this.config.env }, d && (m.parse = !0), v && (m = y(y({}, v), m)), _ = function(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r = /\?/.test(t), i = ""; for (var o in n) "" === i ? !r && (t += "?") : i += "&", i += "".concat(o, "=").concat(encodeURIComponent(n[o])); return /^http(s)?\:\/\//.test(t += i) ? t : "".concat(e).concat(t); }(xe, "//tcb-api.tencentcloudapi.com/web", m), g && (_ += g), e.next = 22, this.post(y({ url: _, data: u }, p)); case 22: if (b = e.sent, (w = b.header && b.header["x-tcb-trace"]) && this._localCache.setStore(o, w), (200 === Number(b.status) || 200 === Number(b.statusCode)) && b.data) { e.next = 26; break; } throw new he({ code: "NETWORK_ERROR", message: "network request error" }); case 26: return e.abrupt("return", b); case 27: case "end": return e.stop(); } }, e, this); })); return function(t, n, r) { return e.apply(this, arguments); }; }() }, { key: "send", value: function() { var e = u(i.default.mark(function e(t) { var n, r, o, a = arguments; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return n = a.length > 1 && void 0 !== a[1] ? a[1] : {}, e.next = 3, this.request(t, n, { onUploadProgress: n.onUploadProgress }); case 3: if ("ACCESS_TOKEN_EXPIRED" !== (r = e.sent).data.code || -1 !== Je.indexOf(t)) { e.next = 13; break; } return e.next = 7, this.refreshAccessToken(); case 7: return e.next = 9, this.request(t, n, { onUploadProgress: n.onUploadProgress }); case 9: if (!(o = e.sent).data.code) { e.next = 12; break; } throw new he({ code: o.data.code, message: o.data.message }); case 12: return e.abrupt("return", o.data); case 13: if (!r.data.code) { e.next = 15; break; } throw new he({ code: r.data.code, message: r.data.message }); case 15: return e.abrupt("return", r.data); case 16: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "setRefreshToken", value: function(e) { var t = this._cache.keys, n = t.accessTokenKey, r = t.accessTokenExpireKey, i = t.refreshTokenKey; this._cache.removeStore(n), this._cache.removeStore(r), this._cache.setStore(i, e); } } ]), e; }(), Qe = {}; function et(e) { return Qe[e]; } var tt = function() { function e(t) { _(this, e), this.config = t, this._cache = Le(t.env), this._request = et(t.env); } return v(e, [ { key: "setRefreshToken", value: function(e) { var t = this._cache.keys, n = t.accessTokenKey, r = t.accessTokenExpireKey, i = t.refreshTokenKey; this._cache.removeStore(n), this._cache.removeStore(r), this._cache.setStore(i, e); } }, { key: "setAccessToken", value: function(e, t) { var n = this._cache.keys, r = n.accessTokenKey, i = n.accessTokenExpireKey; this._cache.setStore(r, e), this._cache.setStore(i, t); } }, { key: "refreshUserInfo", value: function() { var e = u(i.default.mark(function e() { var t, n; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.next = 2, this._request.send("auth.getUserInfo", {}); case 2: return t = e.sent, n = t.data, e.abrupt("return", (this.setLocalUserInfo(n), n)); case 5: case "end": return e.stop(); } }, e, this); })); return function() { return e.apply(this, arguments); }; }() }, { key: "setLocalUserInfo", value: function(e) { var t = this._cache.keys.userInfoKey; this._cache.setStore(t, e); } } ]), e; }(), nt = function() { function e(t) { if (_(this, e), !t) throw new he({ code: "PARAM_ERROR", message: "envId is not defined" }); this._envId = t, this._cache = Le(this._envId), this._request = et(this._envId), this.setUserInfo(); } return v(e, [ { key: "linkWithTicket", value: function(e) { if ("string" != typeof e) throw new he({ code: "PARAM_ERROR", message: "ticket must be string" }); return this._request.send("auth.linkWithTicket", { ticket: e }); } }, { key: "linkWithRedirect", value: function(e) { e.signInWithRedirect(); } }, { key: "updatePassword", value: function(e, t) { return this._request.send("auth.updatePassword", { oldPassword: t, newPassword: e }); } }, { key: "updateEmail", value: function(e) { return this._request.send("auth.updateEmail", { newEmail: e }); } }, { key: "updateUsername", value: function(e) { if ("string" != typeof e) throw new he({ code: "PARAM_ERROR", message: "username must be a string" }); return this._request.send("auth.updateUsername", { username: e }); } }, { key: "getLinkedUidList", value: function() { var e = u(i.default.mark(function e() { var t, n, r, o; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.next = 2, this._request.send("auth.getLinkedUidList", {}); case 2: return t = e.sent, n = t.data, r = !1, o = n.users, e.abrupt("return", (o.forEach(function(e) { e.wxOpenId && e.wxPublicId && (r = !0); }), { users: o, hasPrimaryUid: r })); case 7: case "end": return e.stop(); } }, e, this); })); return function() { return e.apply(this, arguments); }; }() }, { key: "setPrimaryUid", value: function(e) { return this._request.send("auth.setPrimaryUid", { uid: e }); } }, { key: "unlink", value: function(e) { return this._request.send("auth.unlink", { platform: e }); } }, { key: "update", value: function() { var e = u(i.default.mark(function e(t) { var n, r, o, a, s, c, u, l; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return n = t.nickName, r = t.gender, o = t.avatarUrl, a = t.province, s = t.country, c = t.city, e.next = 8, this._request.send("auth.updateUserInfo", { nickName: n, gender: r, avatarUrl: o, province: a, country: s, city: c }); case 8: u = e.sent, l = u.data, this.setLocalUserInfo(l); case 11: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "refresh", value: function() { var e = u(i.default.mark(function e() { var t, n; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.next = 2, this._request.send("auth.getUserInfo", {}); case 2: return t = e.sent, n = t.data, e.abrupt("return", (this.setLocalUserInfo(n), n)); case 5: case "end": return e.stop(); } }, e, this); })); return function() { return e.apply(this, arguments); }; }() }, { key: "setUserInfo", value: function() { var e = this, t = this._cache.keys.userInfoKey, n = this._cache.getStore(t); [ "uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl" ].forEach(function(t) { e[t] = n[t]; }), this.location = { country: n.country, province: n.province, city: n.city }; } }, { key: "setLocalUserInfo", value: function(e) { var t = this._cache.keys.userInfoKey; this._cache.setStore(t, e), this.setUserInfo(); } } ]), e; }(), rt = function() { function e(t) { if (_(this, e), !t) throw new he({ code: "PARAM_ERROR", message: "envId is not defined" }); this._cache = Le(t); var n = this._cache.keys, r = n.refreshTokenKey, i = n.accessTokenKey, o = n.accessTokenExpireKey, a = this._cache.getStore(r), s = this._cache.getStore(i), c = this._cache.getStore(o); this.credential = { refreshToken: a, accessToken: s, accessTokenExpire: c }, this.user = new nt(t); } return v(e, [ { key: "isAnonymousAuth", get: function() { return this.loginType === qe.ANONYMOUS; } }, { key: "isCustomAuth", get: function() { return this.loginType === qe.CUSTOM; } }, { key: "isWeixinAuth", get: function() { return this.loginType === qe.WECHAT || this.loginType === qe.WECHAT_OPEN || this.loginType === qe.WECHAT_PUBLIC; } }, { key: "loginType", get: function() { return this._cache.getStore(this._cache.keys.loginTypeKey); } } ]), e; }(), it = function(e) { b(n, e); var t = w(n); function n() { return _(this, n), t.apply(this, arguments); } return v(n, [ { key: "signIn", value: function() { var e = u(i.default.mark(function e() { var t, n, r, o, a, s, c; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return this._cache.updatePersistence("local"), t = this._cache.keys, n = t.anonymousUuidKey, r = t.refreshTokenKey, o = this._cache.getStore(n) || void 0, a = this._cache.getStore(r) || void 0, e.next = 8, this._request.send("auth.signInAnonymously", { anonymous_uuid: o, refresh_token: a }); case 8: if (!(s = e.sent).uuid || !s.refresh_token) { e.next = 20; break; } return this._setAnonymousUUID(s.uuid), this.setRefreshToken(s.refresh_token), e.next = 14, this._request.refreshAccessToken(); case 14: return Me(Ve), Me(ze, { env: this.config.env, loginType: qe.ANONYMOUS, persistence: "local" }), c = new rt(this.config.env), e.next = 19, c.user.refresh(); case 19: return e.abrupt("return", c); case 20: throw new he({ message: "匿名登录失败" }); case 21: case "end": return e.stop(); } }, e, this); })); return function() { return e.apply(this, arguments); }; }() }, { key: "linkAndRetrieveDataWithTicket", value: function() { var e = u(i.default.mark(function e(t) { var n, r, o, a, s, c; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return n = this._cache.keys, r = n.anonymousUuidKey, o = n.refreshTokenKey, a = this._cache.getStore(r), s = this._cache.getStore(o), e.next = 7, this._request.send("auth.linkAndRetrieveDataWithTicket", { anonymous_uuid: a, refresh_token: s, ticket: t }); case 7: if (!(c = e.sent).refresh_token) { e.next = 16; break; } return this._clearAnonymousUUID(), this.setRefreshToken(c.refresh_token), e.next = 13, this._request.refreshAccessToken(); case 13: return Me(We, { env: this.config.env }), Me(ze, { loginType: qe.CUSTOM, persistence: "local" }), e.abrupt("return", { credential: { refreshToken: c.refresh_token } }); case 16: throw new he({ message: "匿名转化失败" }); case 17: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "_setAnonymousUUID", value: function(e) { var t = this._cache.keys, n = t.anonymousUuidKey, r = t.loginTypeKey; this._cache.removeStore(n), this._cache.setStore(n, e), this._cache.setStore(r, qe.ANONYMOUS); } }, { key: "_clearAnonymousUUID", value: function() { this._cache.removeStore(this._cache.keys.anonymousUuidKey); } } ]), n; }(tt), ot = function(e) { b(n, e); var t = w(n); function n() { return _(this, n), t.apply(this, arguments); } return v(n, [ { key: "signIn", value: function() { var e = u(i.default.mark(function e(t) { var n, r; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: if ("string" == typeof t) { e.next = 2; break; } throw new he({ param: "PARAM_ERROR", message: "ticket must be a string" }); case 2: return n = this._cache.keys.refreshTokenKey, e.next = 5, this._request.send("auth.signInWithTicket", { ticket: t, refresh_token: this._cache.getStore(n) || "" }); case 5: if (!(r = e.sent).refresh_token) { e.next = 15; break; } return this.setRefreshToken(r.refresh_token), e.next = 10, this._request.refreshAccessToken(); case 10: return Me(Ve), Me(ze, { env: this.config.env, loginType: qe.CUSTOM, persistence: this.config.persistence }), e.next = 14, this.refreshUserInfo(); case 14: return e.abrupt("return", new rt(this.config.env)); case 15: throw new he({ message: "自定义登录失败" }); case 16: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() } ]), n; }(tt), at = function(e) { b(n, e); var t = w(n); function n() { return _(this, n), t.apply(this, arguments); } return v(n, [ { key: "signIn", value: function() { var e = u(i.default.mark(function e(t, n) { var r, o, a, s, c; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: if ("string" == typeof t) { e.next = 2; break; } throw new he({ code: "PARAM_ERROR", message: "email must be a string" }); case 2: return r = this._cache.keys.refreshTokenKey, e.next = 5, this._request.send("auth.signIn", { loginType: "EMAIL", email: t, password: n, refresh_token: this._cache.getStore(r) || "" }); case 5: if (o = e.sent, a = o.refresh_token, s = o.access_token, c = o.access_token_expire, !a) { e.next = 22; break; } if (this.setRefreshToken(a), !s || !c) { e.next = 15; break; } this.setAccessToken(s, c), e.next = 17; break; case 15: return e.next = 17, this._request.refreshAccessToken(); case 17: return e.next = 19, this.refreshUserInfo(); case 19: return Me(Ve), Me(ze, { env: this.config.env, loginType: qe.EMAIL, persistence: this.config.persistence }), e.abrupt("return", new rt(this.config.env)); case 22: throw o.code ? new he({ code: o.code, message: "邮箱登录失败: ".concat(o.message) }) : new he({ message: "邮箱登录失败" }); case 23: case "end": return e.stop(); } }, e, this); })); return function(t, n) { return e.apply(this, arguments); }; }() }, { key: "activate", value: function() { var e = u(i.default.mark(function e(t) { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.abrupt("return", this._request.send("auth.activateEndUserMail", { token: t })); case 1: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "resetPasswordWithToken", value: function() { var e = u(i.default.mark(function e(t, n) { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.abrupt("return", this._request.send("auth.resetPasswordWithToken", { token: t, newPassword: n })); case 1: case "end": return e.stop(); } }, e, this); })); return function(t, n) { return e.apply(this, arguments); }; }() } ]), n; }(tt), st = function(e) { b(n, e); var t = w(n); function n() { return _(this, n), t.apply(this, arguments); } return v(n, [ { key: "signIn", value: function() { var e = u(i.default.mark(function e(t, n) { var r, o, a, s, c; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: if ("string" == typeof t) { e.next = 2; break; } throw new he({ code: "PARAM_ERROR", message: "username must be a string" }); case 2: return "string" != typeof n && (n = "", console.warn("password is empty")), r = this._cache.keys.refreshTokenKey, e.next = 6, this._request.send("auth.signIn", { loginType: qe.USERNAME, username: t, password: n, refresh_token: this._cache.getStore(r) || "" }); case 6: if (o = e.sent, a = o.refresh_token, s = o.access_token_expire, c = o.access_token, !a) { e.next = 23; break; } if (this.setRefreshToken(a), !c || !s) { e.next = 16; break; } this.setAccessToken(c, s), e.next = 18; break; case 16: return e.next = 18, this._request.refreshAccessToken(); case 18: return e.next = 20, this.refreshUserInfo(); case 20: return Me(Ve), Me(ze, { env: this.config.env, loginType: qe.USERNAME, persistence: this.config.persistence }), e.abrupt("return", new rt(this.config.env)); case 23: throw o.code ? new he({ code: o.code, message: "用户名密码登录失败: ".concat(o.message) }) : new he({ message: "用户名密码登录失败" }); case 24: case "end": return e.stop(); } }, e, this); })); return function(t, n) { return e.apply(this, arguments); }; }() } ]), n; }(tt), ct = function() { function e(t) { _(this, e), this.config = t, this._cache = Le(t.env), this._request = et(t.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Fe(ze, this._onLoginTypeChanged); } return v(e, [ { key: "anonymousAuthProvider", value: function() { return new it(this.config); } }, { key: "customAuthProvider", value: function() { return new ot(this.config); } }, { key: "emailAuthProvider", value: function() { return new at(this.config); } }, { key: "usernameAuthProvider", value: function() { return new st(this.config); } }, { key: "signInAnonymously", value: function() { var e = u(i.default.mark(function e() { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.abrupt("return", new it(this.config).signIn()); case 1: case "end": return e.stop(); } }, e, this); })); return function() { return e.apply(this, arguments); }; }() }, { key: "signInWithEmailAndPassword", value: function() { var e = u(i.default.mark(function e(t, n) { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.abrupt("return", new at(this.config).signIn(t, n)); case 1: case "end": return e.stop(); } }, e, this); })); return function(t, n) { return e.apply(this, arguments); }; }() }, { key: "signInWithUsernameAndPassword", value: function(e, t) { return new st(this.config).signIn(e, t); } }, { key: "linkAndRetrieveDataWithTicket", value: function() { var e = u(i.default.mark(function e(t) { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return this._anonymousAuthProvider || (this._anonymousAuthProvider = new it(this.config)), Fe(We, this._onAnonymousConverted), e.next = 3, this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(t); case 3: return e.abrupt("return", e.sent); case 4: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "signOut", value: function() { var e = u(i.default.mark(function e() { var t, n, r, o, a, s; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: if (this.loginType !== qe.ANONYMOUS) { e.next = 2; break; } throw new he({ message: "匿名用户不支持登出操作" }); case 2: if (t = this._cache.keys, n = t.refreshTokenKey, r = t.accessTokenKey, o = t.accessTokenExpireKey, a = this._cache.getStore(n)) { e.next = 5; break; } return e.abrupt("return"); case 5: return e.next = 7, this._request.send("auth.logout", { refresh_token: a }); case 7: return s = e.sent, e.abrupt("return", (this._cache.removeStore(n), this._cache.removeStore(r), this._cache.removeStore(o), Me(Ve), Me(ze, { env: this.config.env, loginType: qe.NULL, persistence: this.config.persistence }), s)); case 9: case "end": return e.stop(); } }, e, this); })); return function() { return e.apply(this, arguments); }; }() }, { key: "signUpWithEmailAndPassword", value: function() { var e = u(i.default.mark(function e(t, n) { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", { email: t, password: n })); case 1: case "end": return e.stop(); } }, e, this); })); return function(t, n) { return e.apply(this, arguments); }; }() }, { key: "sendPasswordResetEmail", value: function() { var e = u(i.default.mark(function e(t) { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.abrupt("return", this._request.send("auth.sendPasswordResetEmail", { email: t })); case 1: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "onLoginStateChanged", value: function(e) { var t = this; Fe(Ve, function() { var n = t.hasLoginState(); e.call(t, n); }); var n = this.hasLoginState(); e.call(this, n); } }, { key: "onLoginStateExpired", value: function(e) { Fe(He, e.bind(this)); } }, { key: "onAccessTokenRefreshed", value: function(e) { Fe(Ke, e.bind(this)); } }, { key: "onAnonymousConverted", value: function(e) { Fe(We, e.bind(this)); } }, { key: "onLoginTypeChanged", value: function(e) { var t = this; Fe(ze, function() { var n = t.hasLoginState(); e.call(t, n); }); } }, { key: "getAccessToken", value: function() { var e = u(i.default.mark(function e() { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.next = 2, this._request.getAccessToken(); case 2: return e.t0 = e.sent.accessToken, e.t1 = this.config.env, e.abrupt("return", { accessToken: e.t0, env: e.t1 }); case 5: case "end": return e.stop(); } }, e, this); })); return function() { return e.apply(this, arguments); }; }() }, { key: "hasLoginState", value: function() { var e = this._cache.keys.refreshTokenKey; return this._cache.getStore(e) ? new rt(this.config.env) : null; } }, { key: "isUsernameRegistered", value: function() { var e = u(i.default.mark(function e(t) { var n, r; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: if ("string" == typeof t) { e.next = 2; break; } throw new he({ code: "PARAM_ERROR", message: "username must be a string" }); case 2: return e.next = 4, this._request.send("auth.isUsernameRegistered", { username: t }); case 4: return n = e.sent, r = n.data, e.abrupt("return", r && r.isRegistered); case 7: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "getLoginState", value: function() { return Promise.resolve(this.hasLoginState()); } }, { key: "signInWithTicket", value: function() { var e = u(i.default.mark(function e(t) { return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return e.abrupt("return", new ot(this.config).signIn(t)); case 1: case "end": return e.stop(); } }, e, this); })); return function(t) { return e.apply(this, arguments); }; }() }, { key: "shouldRefreshAccessToken", value: function(e) { this._request._shouldRefreshAccessTokenHook = e.bind(this); } }, { key: "getUserInfo", value: function() { return this._request.send("auth.getUserInfo", {}).then(function(e) { return e.code ? e : y(y({}, e.data), {}, { requestId: e.seqId }); }); } }, { key: "getAuthHeader", value: function() { var e = this._cache.keys, t = e.refreshTokenKey, n = e.accessTokenKey, r = this._cache.getStore(t); return { "x-cloudbase-credentials": this._cache.getStore(n) + "/@@/" + r }; } }, { key: "_onAnonymousConverted", value: function(e) { e.data.env === this.config.env && this._cache.updatePersistence(this.config.persistence); } }, { key: "_onLoginTypeChanged", value: function(e) { var t = e.data, n = t.loginType, r = t.persistence; t.env === this.config.env && (this._cache.updatePersistence(r), this._cache.setStore(this._cache.keys.loginTypeKey, n)); } }, { key: "currentUser", get: function() { var e = this.hasLoginState(); return e && e.user || null; } }, { key: "loginType", get: function() { return this._cache.getStore(this._cache.keys.loginTypeKey); } } ]), e; }(), ut = function(e, t) { t = t || Te(); var n = et(this.config.env), r = e.cloudPath, i = e.filePath, o = e.onUploadProgress, a = e.fileType, s = void 0 === a ? "image" : a; return n.send("storage.getUploadMetadata", { path: r }).then(function(e) { var a = e.data, c = a.url, u = a.authorization, l = a.token, f = a.fileId, p = a.cosFileId, h = e.requestId, d = { key: r, signature: u, "x-cos-meta-fileid": p, success_action_status: "201", "x-cos-security-token": l }; n.upload({ url: c, data: d, file: i, name: r, fileType: s, onUploadProgress: o }).then(function(e) { 201 === e.statusCode ? t(null, { fileID: f, requestId: h }) : t(new he({ code: "STORAGE_REQUEST_FAIL", message: "STORAGE_REQUEST_FAIL: ".concat(e.data) })); }).catch(function(e) { t(e); }); }).catch(function(e) { t(e); }), t.promise; }, lt = function(e, t) { t = t || Te(); var n = et(this.config.env), r = e.cloudPath; return n.send("storage.getUploadMetadata", { path: r }).then(function(e) { t(null, e); }).catch(function(e) { t(e); }), t.promise; }, ft = function(e, t) { var n = e.fileList; if (t = t || Te(), !n || !Array.isArray(n)) return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" }; var r, i = f(n); try { for (i.s(); !(r = i.n()).done; ) { var o = r.value; if (!o || "string" != typeof o) return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" }; } } catch (e) { i.e(e); } finally { i.f(); } var a = { fileid_list: n }; return et(this.config.env).send("storage.batchDeleteFile", a).then(function(e) { e.code ? t(null, e) : t(null, { fileList: e.data.delete_list, requestId: e.requestId }); }).catch(function(e) { t(e); }), t.promise; }, pt = function(e, t) { var n = e.fileList; t = t || Te(), n && Array.isArray(n) || t(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" }); var r, i = [], o = f(n); try { for (o.s(); !(r = o.n()).done; ) { var a = r.value; "object" == typeof a ? (a.hasOwnProperty("fileID") && a.hasOwnProperty("maxAge") || t(null, { code: "INVALID_PARAM", message: "fileList的元素必须是包含fileID和maxAge的对象" }), i.push({ fileid: a.fileID, max_age: a.maxAge })) : "string" == typeof a ? i.push({ fileid: a }) : t(null, { code: "INVALID_PARAM", message: "fileList的元素必须是字符串" }); } } catch (e) { o.e(e); } finally { o.f(); } var s = { file_list: i }; return et(this.config.env).send("storage.batchGetDownloadUrl", s).then(function(e) { e.code ? t(null, e) : t(null, { fileList: e.data.download_list, requestId: e.requestId }); }).catch(function(e) { t(e); }), t.promise; }, ht = function() { var e = u(i.default.mark(function e(t, n) { var r, o, a, s; return i.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: return r = t.fileID, e.next = 3, pt.call(this, { fileList: [ { fileID: r, maxAge: 600 } ] }); case 3: if ("SUCCESS" === (o = e.sent.fileList[0]).code) { e.next = 6; break; } return e.abrupt("return", n ? n(o) : new Promise(function(e) { e(o); })); case 6: if (a = et(this.config.env), s = o.download_url, s = encodeURI(s), n) { e.next = 10; break; } return e.abrupt("return", a.download({ url: s })); case 10: return e.t0 = n, e.next = 13, a.download({ url: s }); case 13: e.t1 = e.sent, (0, e.t0)(e.t1); case 15: case "end": return e.stop(); } }, e, this); })); return function(t, n) { return e.apply(this, arguments); }; }(), dt = function(e, t) { var n, r = e.name, i = e.data, o = e.query, a = e.parse, s = e.search, c = t || Te(); try { n = i ? JSON.stringify(i) : ""; } catch (r) { return Promise.reject(r); } if (!r) return Promise.reject(new he({ code: "PARAM_ERROR", message: "函数名不能为空" })); var u = { inQuery: o, parse: a, search: s, function_name: r, request_data: n }; return et(this.config.env).send("functions.invokeFunction", u).then(function(e) { if (e.code) c(null, e); else { var t = e.data.response_data; if (a) c(null, { result: t, requestId: e.requestId }); else try { t = JSON.parse(e.data.response_data), c(null, { result: t, requestId: e.requestId }); } catch (e) { c(new he({ message: "response data must be json" })); } } return c.promise; }).catch(function(e) { c(e); }), c.promise; }, vt = { timeout: 15e3, persistence: "session" }, gt = {}, yt = new (function() { function e(t) { _(this, e), this.config = t || this.config, this.authObj = void 0; } return v(e, [ { key: "init", value: function(t) { switch (Pe.adapter || (this.requestClient = new Pe.adapter.reqClass({ timeout: t.timeout || 5e3, timeoutMsg: "请求在".concat((t.timeout || 5e3) / 1e3, "s内未完成,已中断") })), this.config = y(y({}, vt), t), !0) { case this.config.timeout > 6e5: console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeou
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。