bh-mobile-sdk
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BH_MOBILE=t():e.BH_MOBILE=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;var r=o(3),i=n(r),u=o(1),a=n(u),s={};window.mamp=s,t["default"]=a["default"],t.init=i["default"]},function(e,t,o){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=o(4),u=r(i),a=o(2),s=r(a),c=o(5),l=n(c),d=null;t["default"]=function(){if(d)return d;var e=window.mamp,t={};return e&&(t.ENV="hybrid",e.cpdaily&&(t.ENV="hybrid.cpdaily")),Object.keys(u["default"]).forEach(function(o){var n=u["default"][o],r=e[o]||{};t[o]={},Object.keys(n).forEach(function(e){var i=n[e],u=l[e];i&&(r[e]?u?t[o][e]=u(r[e]):r[e]&&(t[o][e]=r[e]):t[o][e]=function(){s["default"].wisedu?console.error("调用的"+o+"."+e+"接口不存在"):console.log("你当前不在 Hybrid 环境, 或Hybrid 环境没有初始化, "+e+" 处于 mock 实现")})})}),d=t}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={wisedu:/wisedu/.test(navigator.userAgent)}},function(e,t,o){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(1),i=n(r),u=!1;t["default"]=function(t){var o=function(){e.BH_MOBILE_SDK=(0,i["default"])(),t()};if(u)return o(),void console.error("请不要重复初始化");if(localStorage.getItem("wisedu-browser-debug")||/wisedu/.test(navigator.userAgent)===!1)o();else{var n="mamp://injectionmamp/cordova.js",r=document.createElement("script");r.src=n,document.head.appendChild(r),window.close=function(){window.location.href="mamp://close"},document.addEventListener("deviceready",o,!1)}u=!0}}).call(t,function(){return this}())},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={UI:{actionSheet:!0,alertView:!0,closeWebView:!0,multiPicker:!0,multiSelect:!0,openWebView:!0,preViewImages:!0,setNavHeader:!0,setTitleText:!0,setNavBarBgColor:!0,setStatusBarTintColor:!0,singleSelect:!0,showToast:!0,toggleNavBar:!0,webviewOnResume:!0},systemAbility:{takeCamera:!0,takePhoto:!0},file:{},social:{share:!0},cpdaily:{getTenantID:!0,getUserBasicInfos:!0,getUserInfo:!0,mainAppListChange:!0,onMineAppChanged:!0,openApp:!0,openHomePage:!0,openMarketList:!0,openUsersPage:!0,setStatusBarColor:!0,showLoginView:!0,showMain:!0,showOrHideTabbar:!0,showSettingView:!0,startIMChat:!0,toggleFocus:!0,uploadToOSS:!0,zhugeioTrack:!0}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.webviewOnResume=function(e){var t=!1,o=[];return function(n){o.push(n),t||(e(function(){o.forEach(function(e){e()})}),t=!0)}}}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.BH_MOBILE=e():t.BH_MOBILE=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.init=void 0;var o=n(36),i=r(o),u=n(22),c=r(u),a={};window.mamp=a,e["default"]=c["default"],e.init=i["default"]},function(t,e,n){var r=n(30)("wks"),o=n(34),i=n(2).Symbol,u="function"==typeof i,c=t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))};c.store=r},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(11);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(12),o=n(29);t.exports=n(6)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){t.exports=!n(17)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports={}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(13);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(4),o=n(48),i=n(68),u=Object.defineProperty;e.f=n(6)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return u(t,e,n)}catch(c){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(11),o=n(2).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(2),o=n(3),i=n(9),u=n(5),c="prototype",a=function(t,e,n){var s,f,l,p=t&a.F,d=t&a.G,v=t&a.S,h=t&a.P,y=t&a.B,m=t&a.W,_=d?o:o[e]||(o[e]={}),g=_[c],x=d?r:v?r[e]:(r[e]||{})[c];d&&(n=e);for(s in n)f=!p&&x&&void 0!==x[s],f&&s in _||(l=f?x[s]:n[s],_[s]=d&&"function"!=typeof x[s]?n[s]:y&&f?i(l,r):m&&x[s]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[c]=t[c],e}(l):h&&"function"==typeof l?i(Function.call,l):l,h&&((_.virtual||(_.virtual={}))[s]=l,t&a.R&&g&&!g[s]&&u(g,s,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){var r=n(12).f,o=n(10),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(30)("keys"),o=n(34);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(50),o=n(14);t.exports=function(t){return r(o(t))}},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(40),u=o(i),c=n(38),a=o(c),s=n(35),f=o(s),l=n(39),p=r(l),d=n(37),v=r(d),h=null;e["default"]=function(){if(h)return h;var t=window.mamp,e={};return t&&(e.ENV="hybrid",t.cpdaily&&(e.ENV="hybrid.cpdaily")),(0,u["default"])(a["default"]).forEach(function(n){var r=a["default"][n],o=t[n]||{};e[n]={},(0,u["default"])(r).forEach(function(t){var i=r[t],u=p[t],c=v[t];i&&(o[t]?u?e[n][t]=u(o[t]):o[t]&&(e[n][t]=o[t]):c?e[n][t]=c:e[n][t]=function(){f["default"].wisedu?console.error("调用的"+n+"."+t+"接口不存在"):console.log("你当前不在 Hybrid 环境, 或Hybrid 环境没有初始化, "+t+" 处于 mock 实现")})})}),h=e}},function(t,e,n){var r=n(8),o=n(1)("toStringTag"),i="Arguments"==r(function(){return arguments}()),u=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var e,n,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=u(e=Object(t),o))?n:i?r(e):"Object"==(c=r(e))&&"function"==typeof e.callee?"Arguments":c}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){t.exports=n(2).document&&document.documentElement},function(t,e,n){"use strict";var r=n(27),o=n(16),i=n(63),u=n(5),c=n(10),a=n(7),s=n(53),f=n(18),l=n(59),p=n(1)("iterator"),d=!([].keys&&"next"in[].keys()),v="@@iterator",h="keys",y="values",m=function(){return this};t.exports=function(t,e,n,_,g,x,w){s(n,e,_);var b,O,j,S=function(t){if(!d&&t in E)return E[t];switch(t){case h:return function(){return new n(this,t)};case y:return function(){return new n(this,t)}}return function(){return new n(this,t)}},M=e+" Iterator",P=g==y,T=!1,E=t.prototype,k=E[p]||E[v]||g&&E[g],A=k||S(g),I=g?P?S("entries"):A:void 0,B="Array"==e?E.entries||k:k;if(B&&(j=l(B.call(new t)),j!==Object.prototype&&(f(j,M,!0),r||c(j,p)||u(j,p,m))),P&&k&&k.name!==y&&(T=!0,A=function(){return k.call(this)}),r&&!w||!d&&!T&&E[p]||u(E,p,A),a[e]=A,a[M]=m,g)if(b={values:P?A:S(y),keys:x?A:S(h),entries:I},w)for(O in b)O in E||i(E,O,b[O]);else o(o.P+o.F*(d||T),e,b);return b}},function(t,e){t.exports=!0},function(t,e,n){var r=n(60),o=n(24);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(2),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,n){var r,o,i,u=n(9),c=n(49),a=n(25),s=n(15),f=n(2),l=f.process,p=f.setImmediate,d=f.clearImmediate,v=f.MessageChannel,h=0,y={},m="onreadystatechange",_=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},g=function(t){_.call(t.data)};p&&d||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++h]=function(){c("function"==typeof t?t:Function(t),e)},r(h),h},d=function(t){delete y[t]},"process"==n(8)(l)?r=function(t){l.nextTick(u(_,t,1))}:v?(o=new v,i=o.port2,o.port1.onmessage=g,r=u(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",g,!1)):r=m in s("script")?function(t){a.appendChild(s("script"))[m]=function(){a.removeChild(this),_.call(t)}}:function(t){setTimeout(u(_,t,1),0)}),t.exports={set:p,clear:d}},function(t,e,n){var r=n(20),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(14);t.exports=function(t){return Object(r(t))}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={wisedu:/wisedu/.test(navigator.userAgent)}},function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(22),i=r(o),u=!1;e["default"]=function(e){var n=function(){t.BH_MOBILE_SDK=(0,i["default"])(),e()};if(u)return n(),void console.error("请不要重复初始化");if(localStorage.getItem("wisedu-browser-debug")||/wisedu/.test(navigator.userAgent)===!1)n();else{var r="mamp://injectionmamp/cordova.js",o=document.createElement("script");o.src=r,document.head.appendChild(o),window.close=function(){window.location.href="mamp://close"},document.addEventListener("deviceready",n,!1)}u=!0}}).call(e,function(){return this}())},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.uploadToEMAP=void 0;var o=n(41),i=r(o);e.uploadToEMAP=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.token,o=void 0;return r?o=r.substring(0,r.length-1):(o=(new Date).getTime()+""+parseInt(100*Math.random()).toString(),r=o+1),new i["default"](function(i,u){t||u("server 地址未指定"),0===e.length&&u("没有可供上传的文件"),n.params={scope:o,fileToken:r,isSingle:"1",storeId:"image"},BH_MOBILE_SDK.file.uploadToServer(t+"/sys/emapcomponent/file/uploadTempFile.do",e,n,function(e){var n=!1;e.forEach(function(t){if(200!==t.code)n=!0;else try{t.response=JSON.parse(t.response),t.response.success||(n=!0)}catch(e){n=!0}}),n?u(e):!function(){var e=new FormData;e.append("scope",o),e.append("fileToken",r),e.append("attachmentParam",'{"storeId": "image"}');var n=new XMLHttpRequest;n.withCredentials=!0,n.addEventListener("readystatechange",function(){if(4===this.readyState&&200==n.status)try{i(JSON.parse(this.responseText))}catch(t){u(t)}else u(n)}),n.open("POST",t+"/sys/emapcomponent/file/saveAttachment.do"),n.setRequestHeader("cache-control","no-cache"),n.setRequestHeader("postman-token","c5696e9c-d1c1-1dd4-677f-42b591f8b678"),n.send(e)}()})})}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={UI:{actionSheet:!0,alertView:!0,closeWebView:!0,multiPicker:!0,multiSelect:!0,openWebView:!0,preViewImages:!0,setNavHeader:!0,setTitleText:!0,setNavBarBgColor:!0,setStatusBarTintColor:!0,singleSelect:!0,showToast:!0,toggleNavBar:!0,webviewOnResume:!0},systemAbility:{takeCamera:!0,takePhoto:!0},file:{filePreview:!0,uploadToServer:!0},wisedu:{uploadToEMAP:!0},social:{share:!0},cpdaily:{getTenantID:!0,getUserBasicInfos:!0,getUserInfo:!0,mainAppListChange:!0,onMineAppChanged:!0,openApp:!0,openHomePage:!0,openMarketList:!0,openUsersPage:!0,setStatusBarColor:!0,showLoginView:!0,showMain:!0,showOrHideTabbar:!0,showSettingView:!0,startIMChat:!0,toggleFocus:!0,uploadToOSS:!0,zhugeioTrack:!0}}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.webviewOnResume=function(t){var e=!1,n=[];return function(r){n.push(r),e||(t(function(){n.forEach(function(t){t()})}),e=!0)}},e.uploadToServer=function(t){return function(e,n,r,o){t(e,n,o,r)}}},function(t,e,n){t.exports={"default":n(42),__esModule:!0}},function(t,e,n){t.exports={"default":n(43),__esModule:!0}},function(t,e,n){n(71),t.exports=n(3).Object.keys},function(t,e,n){n(72),n(74),n(75),n(73),t.exports=n(3).Promise},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(21),o=n(32),i=n(67);t.exports=function(t){return function(e,n,u){var c,a=r(e),s=o(a.length),f=i(u,s);if(t&&n!=n){for(;s>f;)if(c=a[f++],c!=c)return!0}else for(;s>f;f++)if((t||f in a)&&a[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(9),o=n(52),i=n(51),u=n(4),c=n(32),a=n(69),s={},f={},e=t.exports=function(t,e,n,l,p){var d,v,h,y,m=p?function(){return t}:a(t),_=r(n,l,e?2:1),g=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(i(m)){for(d=c(t.length);d>g;g++)if(y=e?_(u(v=t[g])[0],v[1]):_(t[g]),y===s||y===f)return y}else for(h=m.call(t);!(v=h.next()).done;)if(y=o(h,_,v.value,e),y===s||y===f)return y};e.BREAK=s,e.RETURN=f},function(t,e,n){t.exports=!n(6)&&!n(17)(function(){return 7!=Object.defineProperty(n(15)("div"),"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(8);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(7),o=n(1)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},function(t,e,n){var r=n(4);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(i){var u=t["return"];throw void 0!==u&&r(u.call(t)),i}}},function(t,e,n){"use strict";var r=n(57),o=n(29),i=n(18),u={};n(5)(u,n(1)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(1)("iterator"),o=!1;try{var i=[7][r]();i["return"]=function(){o=!0},Array.from(i,function(){throw 2})}catch(u){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],u=i[r]();u.next=function(){return{done:n=!0}},i[r]=function(){return u},t(i)}catch(c){}return n}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(2),o=n(31).set,i=r.MutationObserver||r.WebKitMutationObserver,u=r.process,c=r.Promise,a="process"==n(8)(u);t.exports=function(){var t,e,n,s=function(){var r,o;for(a&&(r=u.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(i){throw t?n():e=void 0,i}}e=void 0,r&&r.enter()};if(a)n=function(){u.nextTick(s)};else if(i){var f=!0,l=document.createTextNode("");new i(s).observe(l,{characterData:!0}),n=function(){l.data=f=!f}}else if(c&&c.resolve){var p=c.resolve();n=function(){p.then(s)}}else n=function(){o.call(r,s)};return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},function(t,e,n){var r=n(4),o=n(58),i=n(24),u=n(19)("IE_PROTO"),c=function(){},a="prototype",s=function(){var t,e=n(15)("iframe"),r=i.length,o="<",u=">";for(e.style.display="none",n(25).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+u+"document.F=Object"+o+"/script"+u),t.close(),s=t.F;r--;)delete s[a][i[r]];return s()};t.exports=Object.create||function(t,e){var n;return null!==t?(c[a]=r(t),n=new c,c[a]=null,n[u]=t):n=s(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(12),o=n(4),i=n(28);t.exports=n(6)?Object.defineProperties:function(t,e){o(t);for(var n,u=i(e),c=u.length,a=0;c>a;)r.f(t,n=u[a++],e[n]);return t}},function(t,e,n){var r=n(10),o=n(33),i=n(19)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){var r=n(10),o=n(21),i=n(46)(!1),u=n(19)("IE_PROTO");t.exports=function(t,e){var n,c=o(t),a=0,s=[];for(n in c)n!=u&&r(c,n)&&s.push(n);for(;e.length>a;)r(c,n=e[a++])&&(~i(s,n)||s.push(n));return s}},function(t,e,n){var r=n(16),o=n(3),i=n(17);t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],u={};u[t]=e(n),r(r.S+r.F*i(function(){n(1)}),"Object",u)}},function(t,e,n){var r=n(5);t.exports=function(t,e,n){for(var o in e)n&&t[o]?t[o]=e[o]:r(t,o,e[o]);return t}},function(t,e,n){t.exports=n(5)},function(t,e,n){"use strict";var r=n(2),o=n(3),i=n(12),u=n(6),c=n(1)("species");t.exports=function(t){var e="function"==typeof o[t]?o[t]:r[t];u&&e&&!e[c]&&i.f(e,c,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(4),o=n(13),i=n(1)("species");t.exports=function(t,e){var n,u=r(t).constructor;return void 0===u||void 0==(n=r(u)[i])?e:o(n)}},function(t,e,n){var r=n(20),o=n(14);t.exports=function(t){return function(e,n){var i,u,c=String(o(e)),a=r(n),s=c.length;return a<0||a>=s?t?"":void 0:(i=c.charCodeAt(a),i<55296||i>56319||a+1===s||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):(i-55296<<10)+(u-56320)+65536)}}},function(t,e,n){var r=n(20),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},function(t,e,n){var r=n(11);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(23),o=n(1)("iterator"),i=n(7);t.exports=n(3).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,e,n){"use strict";var r=n(44),o=n(55),i=n(7),u=n(21);t.exports=n(26)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e,n){var r=n(33),o=n(28);n(61)("keys",function(){return function(t){return o(r(t))}})},function(t,e){},function(t,e,n){"use strict";var r,o,i,u=n(27),c=n(2),a=n(9),s=n(23),f=n(16),l=n(11),p=n(13),d=n(45),v=n(47),h=n(65),y=n(31).set,m=n(56)(),_="Promise",g=c.TypeError,x=c.process,w=c[_],x=c.process,b="process"==s(x),O=function(){},j=!!function(){try{var t=w.resolve(1),e=(t.constructor={})[n(1)("species")]=function(t){t(O,O)};return(b||"function"==typeof PromiseRejectionEvent)&&t.then(O)instanceof e}catch(r){}}(),S=function(t,e){return t===e||t===w&&e===i},M=function(t){var e;return!(!l(t)||"function"!=typeof(e=t.then))&&e},P=function(t){return S(w,t)?new T(t):new o(t)},T=o=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw g("Bad Promise constructor");e=t,n=r}),this.resolve=p(e),this.reject=p(n)},E=function(t){try{t()}catch(e){return{error:e}}},k=function(t,e){if(!t._n){t._n=!0;var n=t._c;m(function(){for(var r=t._v,o=1==t._s,i=0,u=function(e){var n,i,u=o?e.ok:e.fail,c=e.resolve,a=e.reject,s=e.domain;try{u?(o||(2==t._h&&B(t),t._h=1),u===!0?n=r:(s&&s.enter(),n=u(r),s&&s.exit()),n===e.promise?a(g("Promise-chain cycle")):(i=M(n))?i.call(n,c,a):c(n)):a(r)}catch(f){a(f)}};n.length>i;)u(n[i++]);t._c=[],t._n=!1,e&&!t._h&&A(t)})}},A=function(t){y.call(c,function(){var e,n,r,o=t._v;if(I(t)&&(e=E(function(){b?x.emit("unhandledRejection",o,t):(n=c.onunhandledrejection)?n({promise:t,reason:o}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=b||I(t)?2:1),t._a=void 0,e)throw e.error})},I=function(t){if(1==t._h)return!1;for(var e,n=t._a||t._c,r=0;n.length>r;)if(e=n[r++],e.fail||!I(e.promise))return!1;return!0},B=function(t){y.call(c,function(){var e;b?x.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})})},C=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),k(e,!0))},L=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw g("Promise can't be resolved itself");(e=M(t))?m(function(){var r={_w:n,_d:!1};try{e.call(t,a(L,r,1),a(C,r,1))}catch(o){C.call(r,o)}}):(n._v=t,n._s=1,k(n,!1))}catch(r){C.call({_w:n,_d:!1},r)}}};j||(w=function(t){d(this,w,_,"_h"),p(t),r.call(this);try{t(a(L,this,1),a(C,this,1))}catch(e){C.call(this,e)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(62)(w.prototype,{then:function(t,e){var n=P(h(this,w));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=b?x.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&k(this,!1),n.promise},"catch":function(t){return this.then(void 0,t)}}),T=function(){var t=new r;this.promise=t,this.resolve=a(L,t,1),this.reject=a(C,t,1)}),f(f.G+f.W+f.F*!j,{Promise:w}),n(18)(w,_),n(64)(_),i=n(3)[_],f(f.S+f.F*!j,_,{reject:function(t){var e=P(this),n=e.reject;return n(t),e.promise}}),f(f.S+f.F*(u||!j),_,{resolve:function(t){if(t instanceof w&&S(t.constructor,this))return t;var e=P(this),n=e.resolve;return n(t),e.promise}}),f(f.S+f.F*!(j&&n(54)(function(t){w.all(t)["catch"](O)})),_,{all:function(t){var e=this,n=P(e),r=n.resolve,o=n.reject,i=E(function(){var n=[],i=0,u=1;v(t,!1,function(t){var c=i++,a=!1;n.push(void 0),u++,e.resolve(t).then(function(t){a||(a=!0,n[c]=t,--u||r(n))},o)}),--u||r(n)});return i&&o(i.error),n.promise},race:function(t){var e=this,n=P(e),r=n.reject,o=E(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o&&r(o.error),n.promise}})},function(t,e,n){"use strict";var r=n(66)(!0);n(26)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){n(70);for(var r=n(2),o=n(5),i=n(7),u=n(1)("toStringTag"),c=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],a=0;a<5;a++){var s=c[a],f=r[s],l=f&&f.prototype;l&&!l[u]&&o(l,u,s),i[s]=i.Array}}])}); |
{ | ||
"name": "bh-mobile-sdk", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "wisedu mobile web sdk", | ||
@@ -11,3 +11,3 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"dev": "webpack-dev-server --config webpack.config.demo.js", | ||
"dev": "webpack-dev-server --config webpack.config.demo.js --inline --hot", | ||
"dist": "rm -rf lib && webpack", | ||
@@ -31,4 +31,6 @@ "prepublish": "npm run dist" | ||
"devDependencies": { | ||
"babel-runtime": "^6.0.0", | ||
"babel-core": "^6.17.0", | ||
"babel-loader": "^6.2.5", | ||
"babel-plugin-transform-runtime": "^6.15.0", | ||
"babel-preset-es2015": "^6.14.0", | ||
@@ -35,0 +37,0 @@ "babel-preset-stage-2": "^6.13.0", |
import whiteList from './whiteList' | ||
import ENV from './env' | ||
import * as wrap from './wrap' | ||
import * as mock from './mock' | ||
@@ -24,12 +25,16 @@ let SDK = null | ||
let wrapHandler = wrap[apiKey] | ||
let mockHandler = mock[apiKey] | ||
if (api) { | ||
if (!module[apiKey]) { | ||
sdk[moduleName][apiKey] = () => { | ||
if (ENV.wisedu) { | ||
console.error(`调用的${moduleName}.${apiKey}接口不存在`) | ||
} else { | ||
console.log(`你当前不在 Hybrid 环境, 或Hybrid 环境没有初始化, ${apiKey} 处于 mock 实现`) | ||
if (mockHandler) { | ||
sdk[moduleName][apiKey] = mockHandler | ||
} else { | ||
sdk[moduleName][apiKey] = () => { | ||
if (ENV.wisedu) { | ||
console.error(`调用的${moduleName}.${apiKey}接口不存在`) | ||
} else { | ||
console.log(`你当前不在 Hybrid 环境, 或Hybrid 环境没有初始化, ${apiKey} 处于 mock 实现`) | ||
} | ||
} | ||
} | ||
@@ -36,0 +41,0 @@ } else if (wrapHandler) { |
@@ -30,3 +30,8 @@ /** | ||
file: { | ||
filePreview: true, | ||
uploadToServer: true, | ||
}, | ||
wisedu: { | ||
uploadToEMAP: true | ||
}, | ||
social: { | ||
@@ -33,0 +38,0 @@ share: true |
@@ -15,1 +15,7 @@ export let webviewOnResume = (original) => { | ||
} | ||
export let uploadToServer = (original) => { | ||
return (server, filePaths, config, cb) => { | ||
original(server, filePaths, cb, config) | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31638
10
227
8