hrsass-native-mobile 1.1.21 → 1.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -564,11 +564,12 @@ var WeCore = {
564
564
  callback({ hasError: true, msg: "暂不支持预览" });
565
565
  }
566
566
  },
567
- getPunchLog: function getPunchLog(json) {
567
+ getPunchLog: function getPunchLog(json, type) {
568
568
  var user = localStorage.getItem('userInfo');
569
569
  var data = _extends({
570
570
  punchTime: new Date() + '',
571
- empId: JSON.parse(user).empId
571
+ empId: JSON.parse(user).empId,
572
+ type: type || 'WECHAT_ERROR'
572
573
  }, json);
573
574
  axios.post('/business/wkf/app/punch/logLatitudeLongitude', data).then(function (res) {
574
575
  console.log('getPunchLog', res);
@@ -592,12 +593,12 @@ var WeCore = {
592
593
  callback && callback(res);
593
594
  },
594
595
  fail: function fail(res) {
596
+ _this5.getPunchLog(res);
595
597
  Native.log(res && res.errMsg || res, {
596
598
  method: "wx.getLocation",
597
599
  type: type
598
600
  });
599
601
  console.log("GPS fail", res);
600
- _this5.getPunchLog(res);
601
602
  callback && callback(null);
602
603
  }
603
604
  });
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var uuid=require("uuid"),cookiePrefix="NATIVE_LOGIN_",getQueryString=function(e){var t=null,o=location.hash?-1!==location.hash.indexOf("?")?"?"+location.hash.split("?")[1]:location.hash:location.search;if(-1!=(o=decodeURIComponent(o)).indexOf("?"))for(var n=o.substr(1).split("&"),i=0;i<n.length;i++)if(n[i].split("=")[0]==e){t=unescape(n[i].split("=")[1]);break}return t},getCookie=function(e){var t,o=new RegExp("(^| )"+cookiePrefix+e+"=([^;]*)(;|$)");if(t=document.cookie.match(o)){var n=null;try{n=decodeURIComponent(t[2])}catch(e){n=t[2]}try{n=JSON.parse(n)}catch(e){}return n}return null},setCookie=function(e,t,o){var n="";if(0!=(o=o||0)){var i=new Date;i.setTime(i.getTime()+1e3*o),n="; expires="+i.toGMTString()}document.cookie=cookiePrefix+e+"="+escape(t)+n+"; path=/"},getOS=function(){var e="",t=navigator.userAgent;return-1<t.indexOf("Android")?e="android":t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)&&(e="ios"),e},DdCore={url:"",getCustomerCode:function(){return getCookie("customerCode")},getCode:function(){return getCookie("code")},getCoprId:function(){return getCookie("corpid")},getOpenId:function(){return getCookie("openId")},isAutoLogin:function(t){var o=this,e=getQueryString("customerCode");e&&setCookie("customerCode",e);var n=getQueryString("code");n&&setCookie("code",n),this.getConfig(function(e){o.getAuthCode(e,function(e){o.checkAutoLogin(function(e){t(e)})})})},getConfig:function(t){var e={type:"4",url:this.initUrl?this.initUrl:this.initUrl=location.href.split("#")[0]};e.customerCode=this.getCustomerCode(),axios.post("/platform/wechat/wechatSign.nolog",e).then(function(e){t&&t(e)})},getAuthCode:function(e,o){var t=e.corpId;dd.config({agentId:e.agentId,corpId:e.corpId,timeStamp:e.timestamp,nonceStr:e.nonceStr,signature:e.signature,jsApiList:["device.base.getUUID","device.base.getInterface","device.geolocation.get","runtime.info","runtime.permission.requestAuthCode","biz.contact.choose","device.notification.confirm","device.notification.alert","device.notification.prompt","biz.ding.post","biz.util.openLink"]}),dd.ready(function(){dd.runtime.permission.requestAuthCode({corpId:t,onSuccess:function(e){var t=e.code;setCookie("code",t),o&&o()},onFail:function(e){o&&o(),console.log("requestAuthCode fail",e)}})}),dd.error(function(e){console.log("dd error: "+JSON.stringify(e))})},checkAutoLogin:function(t){var e={type:"4"};e.code=this.getCode(),e.customerCode=this.getCustomerCode(),axios.post("/platform/wechat/wechatCheckLogin.nolog",e).then(function(e){console.log("wechatCheckLogin.nolog",e),e&&e.user&&e.user.openId&&setCookie("openId",e.user.openId),t(e)})},getGPS:function(t,o){var n=this;this.getConfig(function(e){n.getAuthCode(e,function(e){dd.ready(function(){dd.device.geolocation.get({targetAccuracy:200,coordinate:1,withReGeocode:t,onSuccess:function(e){o&&o(e)},onFail:function(e){console.log(JSON.stringify(e))}})})})})},logOut:function(t){var e={openId:this.getOpenId(),type:"4",customerCode:this.getCustomerCode()};axios.post("/platform/wechat/wechatLogOut.nolog",e).then(function(e){t&&t(e)})},getWiFi:function(t){dd.ready(function(){dd.device.base.getInterface({onSuccess:function(e){t&&t(e)},onFail:function(e){console.log(JSON.stringify(e))}})})},getUUID:function(t){dd.ready(function(){dd.device.base.getUUID({onSuccess:function(e){t&&t(e)},onFail:function(){t&&t()}})})}},DdUI={setTitle:function(e){dd.biz.navigation.setTitle({title:e})},setEvent:function(t){dd.ready(function(){-1<navigator.userAgent.indexOf("Android")?document.addEventListener("backbutton",function(e){e.preventDefault(),t()},!1):dd.biz.navigation.setLeft({show:!0,control:!0,showIcon:!0,onSuccess:function(){t()}})})},close:function(){dd.biz.navigation.close()}},_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},WeCore={url:"",isAutoLogin:function(t){var o=this;"2"===getQueryString("type")&&setCookie("wechatType","corp");var e=getQueryString("customerCode");e&&setCookie("customerCode",e);var n=getQueryString("code");n&&setCookie("code",n),this.getSign(function(e){o.setConfig(_extends({},e,{jsApiList:["onHistoryBack","closeWindow"]}),function(){o.checkAutoLogin(t,e)})})},getCustomerCode:function(){return getCookie("customerCode")},getWechatType:function(){return getCookie("wechatType")},getWechatCode:function(){return getCookie("code")},getOpenId:function(){return getCookie("openId")},getLocale:function(){return getCookie("locale")},getSign:function(t){"android"===getOS()||"corp"===this.getWechatType()?this.initUrl=location.href.split("#")[0]:this.initUrl||(this.initUrl=location.href.split("#")[0]);var e={url:this.initUrl},o=this.getWechatType();e.customerCode=this.getCustomerCode(),e.type="corp"===o?"2":"1",axios.post("/platform/wechat/wechatSign.nolog",e).then(function(e){t&&t(e)})},initPermission:function(t){var o=this;this.getSign(function(e){o.setConfig(e,function(){t&&t()})})},setConfig:function(e,t){wx.config({debug:!!e.debug,appId:e.appId,timestamp:e.timestamp,nonceStr:e.nonceStr,signature:e.signature,jsApiList:e.jsApiList||["getLocation","openBluetoothAdapter","closeBluetoothAdapter","startBeaconDiscovery","stopBeaconDiscovery","onBeaconUpdate","onHistoryBack","closeWindow","getBeacons"]}),wx.ready(function(){setTimeout(function(){t&&t()},200)})},checkAutoLogin:function(t){var e={code:this.getWechatCode(),locale:this.getLocale()};console.log("paras===",this.getLocale());var o=getQueryString("mobile"),n=this.getWechatType();e.customerCode=this.getCustomerCode(),e.type="corp"===n?"2":"1",o&&(e.mobile=o),axios.post("/platform/wechat/wechatCheckLogin.nolog",e).then(function(e){e&&e.customerCode&&setCookie("customerCode",e.customerCode),e&&e.user&&e.user.openId&&setCookie("openId",e.user.openId),t(e)})},logOut:function(t){this.getOpenId()&&this.getCustomerCode()||this.checkAutoLogin(t);var e={openId:this.getOpenId(),type:"corp"===this.getWechatType()?"2":"1",customerCode:this.getCustomerCode()};axios.post("/platform/wechat/wechatLogOut.nolog",e).then(function(e){t&&t(e)})},previewFile:function(t,e){var o=this;"corp"===this.getWechatType()?(this.getSign(function(e){o.setConfig(e,function(){wx.previewFile(t)})}),e({hasError:!1})):e({hasError:!0,msg:"暂不支持预览"})},getPunchLog:function(e){var t=localStorage.getItem("userInfo"),o=_extends({punchTime:new Date+"",empId:JSON.parse(t).empId},e);axios.post("/business/wkf/app/punch/logLatitudeLongitude",o).then(function(e){console.log("getPunchLog",e)})},getGPS:function(o){var n=this;this.getSign(function(e){var t=n.getWechatType();n.setConfig(e,function(){wx.getLocation({type:"gcj02",success:function(e){o&&o(e)},fail:function(e){Native.log(e&&e.errMsg||e,{method:"wx.getLocation",type:t}),console.log("GPS fail",e),n.getPunchLog(e),o&&o(null)}})})})},openBluetoothAdapter:function(t){wx.openBluetoothAdapter({success:function(e){console.info("openBluetoothAdapter success",e),t(_extends({},e,{isSuccess:!0}))},fail:function(e){t(_extends({},e,{isSuccess:!1}))}})},getWifi:function(t){var o=this.getWechatType();if("corp"===o){var n=this;n.getSign(function(e){e.jsApiList=["startWifi","getConnectedWifi"],n.setConfig(e,function(){wx.startWifi({success:function(e){console.info("startWifi success",e),wx.getConnectedWifi({success:function(e){console.log("getConnectedWifi success",e),t(e.wifi)},fail:function(e){Native.log(e&&e.errMsg||e,{method:"wx.getConnectedWifi",type:o}),console.log("getConnectedWifi fail",e),t({})}})},fail:function(e){Native.log(e&&e.errMsg||e,{method:"wx.startWifi",type:o}),console.log("startWifi fail",e),t({})}})})})}else t({})},destoryBlutooth:function(e,t){e.isBluetoothStoped=!0,e.isBluetoothStopping=!1,e.bluetoothTimeout&&(clearTimeout(e.bluetoothTimeout),e.bluetoothTimeout=null),"corp"===this.getWechatType()&&wx.closeBluetoothAdapter({success:function(){t&&t()}})},setBluetoothTimeout:function(t,o,n){t.bluetoothTimeout||(t.bluetoothTimeout=setTimeout(function(){t.isBluetoothStoped||wx.stopBeaconDiscovery({complete:function(){var e=o.loadCount||3;t.getBluetoothCount>=e?(t.destoryBlutooth(t),n({success:!1,error:"蓝牙获取失败"})):t.destoryBlutooth(t,function(){t.getWechatBluetooth(t,o,n)})}}),t.bluetoothTimeout&&(clearTimeout(t.bluetoothTimeout),t.bluetoothTimeout=null)},o.timeout||1e4))},initConfig:function(){var n=this;return new Promise(function(t,o){try{n.getSign(function(e){n.setConfig(e,function(){t()})})}catch(e){o(e)}})},getBluetooth:function(t,o){var n=this;"corp"===this.getWechatType()?(this.getBluetoothCount=0,this.getSign(function(e){n.setConfig(e,function(){console.log("load Bluetooth"),n.getWechatBluetooth2(t,o)})})):o([])},getBeacons:function(o,n,i){if(o<1)i({success:!1});else{var c=this;setTimeout(function(){wx.getBeacons({success:function(e){console.log("getBeacons success",e);var t=e.beacons.find(function(e,t){var o=e.uuid.toLowerCase();return-1<n.uuids.indexOf(o)});t?i({success:!0,list:[t]}):c.getBeacons(--o,n,i)},fail:function(e){o==n.loadCount&&wx.onBeaconUpdate(function(e){console.log("onBeaconUpdate",JSON.stringify(e.beacons));var t=e.beacons.find(function(e,t){var o=e.uuid.toLowerCase();return-1<n.uuids.indexOf(o)});t&&i({success:!0,list:[t]})}),Native.log(e&&e.errMsg||e,{method:"wx.getBeacons",type:c.getWechatType()}),console.log("getBeacons fail",e),c.getBeacons(--o,n,i)}})},o===n.loadCount?0:n.timeout||1e3)}},getWechatBluetooth2:function(e,o){console.log("param",e);var n,t=this;wx.startBeaconDiscovery({uuids:e.uuids,success:function(){console.log("startBeaconDiscovery success"),t.getBeacons(e.loadCount,e,function(t){wx.stopBeaconDiscovery({complete:function(e){n&&clearTimeout(n),console.log("stopBeaconDiscovery",e),console.log(t),o(t)}})}),n=setTimeout(function(){wx.stopBeaconDiscovery({complete:function(){console.log("未搜索到"),Native.log("未搜索到蓝牙,耗时:"+e.loadCount*e.timeout+1e3,{method:"wx.startBeaconDiscovery",type:t.getWechatType()}),o({success:!1,list:[],code:"003"})}})},e.loadCount*e.timeout+1e3)},fail:function(e){n&&clearTimeout(n),Native.log(e&&e.errMsg||e,{method:"wx.startBeaconDiscovery",type:t.getWechatType()}),console.log("startBeaconDiscovery fail",e),o({success:!1})}})},getWechatBluetooth:function(t,o,n){t.openBluetoothAdapter(function(e){console.log("openBluetoothAdapter",e),e.isSuccess?(console.log(t.getBluetoothCount,t.isBluetoothStopping,t.isBluetoothStoped,t.bluetoothTimeout),t.getBluetoothCount++,t.isBluetoothStopping=!1,t.isBluetoothStoped=!1,t.bluetoothTimeout&&(clearTimeout(t.bluetoothTimeout),t.bluetoothTimeout=null),wx.startBeaconDiscovery({uuids:o.uuids,success:function(){t.setBluetoothTimeout(t,o,n),wx.onBeaconUpdate(function(e){console.log("onBeaconUpdate",JSON.stringify(e.beacons)),t.beacons=e.beacons,t.isBluetoothStopping||(t.isBluetoothStopping=!0,wx.stopBeaconDiscovery({complete:function(){n({success:!0,list:t.beacons}),t.destoryBlutooth(t)}}))})},complete:function(){t.setBluetoothTimeout(t,o,n)},fail:function(e){Native.log(e&&e.errMsg||e,{method:"wx.startBeaconDiscovery",type:t.getWechatType()}),console.log("startBeaconDiscovery fail",e),wx.stopBeaconDiscovery({complete:function(){n({success:!1,error:e}),t.destoryBlutooth(t)}})}})):n({success:!1,error:"请开启蓝牙"})})},setEvent:function(e){wx.ready(function(){try{wx.onHistoryBack(function(){return e&&e(),!1})}catch(e){console.warn(e+", 请使用企业微信平台登录")}})},close:function(){wx.closeWindow()}},LxCore={url:"",getSign:function(t){var e={url:location.href.split("#")[0]};e.customerCode=this.getCustomerCode(),e.type="3",axios.post("/platform/wechat/wechatSign.nolog",e).then(function(e){t&&t(e)})},setConfig:function(e,t){lx.config({debug:!!e.debug,appId:e.appId,timestamp:e.timestamp,nonceStr:e.nonceStr,signature:e.signature,jsApiList:e.jsApiList||["getLocation"]}),lx.ready(function(){t&&t()})},isAutoLogin:function(e){var t=getQueryString("customerCode"),o=getQueryString("code");t&&setCookie("customerCode",t),o&&setCookie("code",o),this.checkAutoLogin(e)},checkAutoLogin:function(t){var e={code:this.getLanxinCode(),customerCode:this.getCustomerCode(),type:"3"};axios.post("/platform/wechat/wechatCheckLogin.nolog",e).then(function(e){e&&e.user&&e.user.openId&&setCookie("openId",e.user.openId),t(e)})},logOut:function(t){var e={openId:this.getOpenId(),customerCode:this.getCustomerCode(),type:"3"};axios.post("/platform/wechat/wechatLogOut.nolog",e).then(function(e){t&&t(e)})},initConfig:function(){var n=this;return new Promise(function(t,o){try{n.getSign(function(e){n.setConfig(e,function(){t()})})}catch(e){o(e)}})},getGPS:function(t){lx.device.getLocation({coordinateType:"gcj02",success:function(e){return t&&t(e)},fail:function(e){Native.log(e&&e.errMsg,{method:"lx.device.getLocation",err:e}),t&&t(null)}})},getWifi:function(t){lx.wifiDeviceInfo({success:function(e){return t(e)},fail:function(){return t({})}})},getCustomerCode:function(){return getQueryString("customerCode")||getCookie("customerCode")},getLanxinCode:function(){return getQueryString("code")||getCookie("code")},getOpenId:function(){return getCookie("openId")}},MapCore={getGPS:function(t){var e=void 0,o=void 0;(e=new AMap.Map("")).plugin("AMap.Geolocation",function(){o=new AMap.Geolocation({enableHighAccuracy:!0,timeout:1e4}),e.addControl(o),o.getCurrentPosition(),AMap.event.addListener(o,"complete",function(e){console.log("AMap complete",e),t&&t({longitude:e.position.getLng(),latitude:e.position.getLat()})}),AMap.event.addListener(o,"error",function(e){console.log("AMap error",e),Native.log(e&&e.message,{method:"AMap.Geolocation",type:"h5"}),t&&t()})})}},getOS$1=function(){var e={},t=navigator.userAgent;return-1<t.indexOf("DingTalk")?e.type="dd":-1<t.indexOf("miniProgram")?e.type="miniprogram":-1<t.indexOf("MicroMessenger")?e.type="wechat":-1<t.indexOf("Feishu")?e.type="feishu":-1<t.indexOf("WandaOA")?e.type="wanxin":-1<t.indexOf("Lanxin")||-1<t.indexOf("es360messenger")?e.type="lanxin":-1<t.indexOf("Android")||-1<t.indexOf("Adr")?e.type=_isNativeAndroid()?"android":"h5":t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?e.type=_isNativeIos()?"ios":"h5":e.type="windows",e},_isNativeAndroid=function(){var t=!0;try{android.callWithDict(JSON.stringify({method:"test"}))}catch(e){t=!1}return t},_isNativeIos=function(){var t=!0;try{ios.callWithDict({method:"test"})}catch(e){t=!1}return t},Native$1={getQueryString:getQueryString,getCookie:getCookie,setCookie:setCookie,OS:getOS$1(),callbackMap:new Map,isNativeAndroid:function(){return _isNativeAndroid()},isNativeIos:function(){return _isNativeIos()},getNavigation:function(e){var t=1;switch(this.OS.type){case"dd":t=e?3==e?2:e:4;break;default:e&&(t=e)}return t},setDingTalkMenu:function(e,t){switch(this.OS.type){case"dd":DdUI.setEvent(function(){0<=t.indexOf(e.location.pathname)?DdUI.close():e.goBack()});break;case"wechat":"corp"===WeCore.wechatType&&WeCore.setEvent(function(){0<=t.indexOf(e.location.pathname)?WeCore.close():e.goBack()})}},setTitle:function(e){switch(this.OS.type){case"dd":DdUI.setTitle(e)}},getCache:function(e,t){var o="";switch(this.OS.type){case"android":this.callNative({method:"getCache",key:e},function(e){t?t(e):o=e});break;default:o=window.localStorage.getItem(e)}return o},setCache:function(e,t){switch(this.OS.type){case"android":this.callNative({method:"setCache",key:e,value:t});break;default:window.localStorage.setItem(e,t)}},removeCache:function(e){switch(this.OS.type){case"android":this.callNative({method:"removeCache",key:e});break;default:window.localStorage.removeItem(e)}},login:function(e,t){switch(this.OS.type){case"dd":e.dingTalkLogin(t);break;case"wechat":t.wechatType=WeCore.getWechatType(),e.weChatLogin(t);break;case"lanxin":e.lanXinLogin(t);break;default:e.login(t)}},initPermission:function(e){switch(this.OS.type){case"wechat":WeCore.initPermission(e);break;default:e&&e()}},isLogin:function(t){switch(console.warn("this.OS.type:",this.OS.type),this.OS.type){case"dd":DdCore.isAutoLogin(function(e){t(e)});break;case"wechat":WeCore.isAutoLogin(function(e){t(e)});break;case"lanxin":LxCore.isAutoLogin(function(e){return t(e)});break;case"android":this.getCache("",function(e){t(e)});break;default:t({user:JSON.parse(this.getCache("userInfo")),token:this.getCache("token")})}},exit:function(e){switch(this.OS.type){case"dd":DdCore.logOut(e);break;case"wechat":WeCore.logOut(e);break;case"lanxin":LxCore.logOut(e);break;default:e&&e()}},callNative:function(e,t){var o=uuid.v4(),n={_callback_key_:o};for(var i in"string"==typeof e&&(e={method:e}),e)n[i]=e[i];switch(this.callbackMap.set(o,t),this.OS.type){case"ios":ios.callWithDict(n);break;case"android":android.callWithDict(JSON.stringify(n))}},callFront:function(e,t){var o=JSON.parse(t);this.callbackMap.has(e)&&(this.callbackMap.get(e)(o),this.callbackMap.delete(e))},getValidateList:function(e,t,o){var n=this,i=[],c=o||{num:"密码解锁",hand:"手势解锁",finger:"指纹解锁"};switch(this.OS.type){case"dd":case"android":i=1==e?[{pwd_type:"num",label:c.num},{pwd_type:"hand",label:c.hand}]:t.filter(function(e){return"1"==e.enable&&("hand"==e.pwd_type||"num"==e.pwd_type)});break;case"ios":1==e?(i=[{pwd_type:"num",label:c.num},{pwd_type:"hand",label:c.hand}],this.OS.fingerAllow&&i.push({pwd_type:"finger",label:c.finger})):i=t.filter(function(e){return"finger"==e.pwd_type?n.OS.fingerAllow&&"1"==e.enable:"1"==e.enable});break;default:i=1==e?[{pwd_type:"num",label:c.num},{pwd_type:"hand",label:c.hand}]:t.filter(function(e){return"1"==e.enable&&("hand"==e.pwd_type||"num"==e.pwd_type)})}return i},log:function(e,t){var o=1<arguments.length&&void 0!==t?t:{};window.PerformanceAddError&&window.PerformanceAddError({msg:e||"",n:"native",method:o.type||this.OS.type,sendData:o.sendData,resourceUrl:o.method})},getSystemInfo:function(t){var e={success:!0,device:""};switch(this.OS.type){case"dd":t&&t(e);break;case"wechat":var o=this.getCache("openId");e.device=o,t&&t(e);break;case"lanxin":t&&t({device:this.getCache("openId")});break;case"android":case"ios":this.callNative("getSystemInfo",function(e){t&&t(e)});break;default:t&&t(e)}},previewFile:function(e,t){switch(this.OS.type){case"wechat":WeCore.previewFile(e,t);break;default:t({hasError:!0,msg:"暂不支持预览"})}},getGPS:function(e,o){var t=Object.assign({},{method:"getGPS"},e);switch(e.type||this.OS.type){case"dd":var n=e.recode;DdCore.getGPS(n,function(e){var t=Object.assign({},{success:!0},e);o&&o(t)});break;case"wechat":WeCore.getGPS(function(e){var t={success:!1};null!=e&&(t=Object.assign({},{success:!0},e)),o&&o(t)});break;case"lanxin":LxCore.getGPS(function(e){var t={success:!1};null!=e&&(t=Object.assign({},{success:!0},e)),o&&o(t)});break;case"android":case"ios":this.callNative(t,function(e){o&&o(e)});break;case"h5":MapCore.getGPS(function(e){var t=Object.assign({},{success:!0},e);o&&o(t)})}},getWiFi:function(i){switch(this.OS.type){case"dd":DdCore.getWiFi(function(e){var t={mac:e.macIp,name:e.ssid};i&&i(t)});break;case"wechat":WeCore.getWifi(function(e){var t={};e.BSSID&&(t.mac=e.BSSID.toLowerCase(),t.name=e.SSID),i&&i(t)});break;case"lanxin":LxCore.getWifi(function(e){var t={};e.bssid&&(t.mac=e.bssid.toLowerCase(),t.name=e.ssid),i&&i(t)});break;case"android":case"ios":this.callNative({method:"getWiFi"},function(e){if(e.mac){var t=[],o=e.mac.split(":");for(var n in o)1==o[n].length&&(o[n]="0"+o[n]),t.push(o[n]);e.mac=t.join(":")}i&&i(e)})}},initConfig:function(){switch(console.log("初始化授权",this.OS.type),this.OS.type){case"lanxin":return LxCore.initConfig();default:return Promise.resolve()}},getBlueTooth:function(e,t){switch(this.OS.type){case"wechat":WeCore.getBluetooth(e,function(e){t&&t(e)});break;case"android":case"ios":this.callNative({method:"getBlueTooth"},function(e){t&&t(e)});break;default:t&&t({success:!0,list:[]})}},destoryBlutooth:function(t){switch(this.OS.type){case"wechat":WeCore.destoryBlutooth(WeCore,function(e){t&&t(e)});break;case"android":case"ios":this.callNative({method:"destoryBlutooth"},function(e){t&&t(e)});break;default:t&&t()}}};void 0===window.Native&&(window.Native=Native$1);var index=window.Native;exports.Native=index;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var uuid=require("uuid"),cookiePrefix="NATIVE_LOGIN_",getQueryString=function(e){var t=null,o=location.hash?-1!==location.hash.indexOf("?")?"?"+location.hash.split("?")[1]:location.hash:location.search;if(-1!=(o=decodeURIComponent(o)).indexOf("?"))for(var n=o.substr(1).split("&"),i=0;i<n.length;i++)if(n[i].split("=")[0]==e){t=unescape(n[i].split("=")[1]);break}return t},getCookie=function(e){var t,o=new RegExp("(^| )"+cookiePrefix+e+"=([^;]*)(;|$)");if(t=document.cookie.match(o)){var n=null;try{n=decodeURIComponent(t[2])}catch(e){n=t[2]}try{n=JSON.parse(n)}catch(e){}return n}return null},setCookie=function(e,t,o){var n="";if(0!=(o=o||0)){var i=new Date;i.setTime(i.getTime()+1e3*o),n="; expires="+i.toGMTString()}document.cookie=cookiePrefix+e+"="+escape(t)+n+"; path=/"},getOS=function(){var e="",t=navigator.userAgent;return-1<t.indexOf("Android")?e="android":t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)&&(e="ios"),e},DdCore={url:"",getCustomerCode:function(){return getCookie("customerCode")},getCode:function(){return getCookie("code")},getCoprId:function(){return getCookie("corpid")},getOpenId:function(){return getCookie("openId")},isAutoLogin:function(t){var o=this,e=getQueryString("customerCode");e&&setCookie("customerCode",e);var n=getQueryString("code");n&&setCookie("code",n),this.getConfig(function(e){o.getAuthCode(e,function(e){o.checkAutoLogin(function(e){t(e)})})})},getConfig:function(t){var e={type:"4",url:this.initUrl?this.initUrl:this.initUrl=location.href.split("#")[0]};e.customerCode=this.getCustomerCode(),axios.post("/platform/wechat/wechatSign.nolog",e).then(function(e){t&&t(e)})},getAuthCode:function(e,o){var t=e.corpId;dd.config({agentId:e.agentId,corpId:e.corpId,timeStamp:e.timestamp,nonceStr:e.nonceStr,signature:e.signature,jsApiList:["device.base.getUUID","device.base.getInterface","device.geolocation.get","runtime.info","runtime.permission.requestAuthCode","biz.contact.choose","device.notification.confirm","device.notification.alert","device.notification.prompt","biz.ding.post","biz.util.openLink"]}),dd.ready(function(){dd.runtime.permission.requestAuthCode({corpId:t,onSuccess:function(e){var t=e.code;setCookie("code",t),o&&o()},onFail:function(e){o&&o(),console.log("requestAuthCode fail",e)}})}),dd.error(function(e){console.log("dd error: "+JSON.stringify(e))})},checkAutoLogin:function(t){var e={type:"4"};e.code=this.getCode(),e.customerCode=this.getCustomerCode(),axios.post("/platform/wechat/wechatCheckLogin.nolog",e).then(function(e){console.log("wechatCheckLogin.nolog",e),e&&e.user&&e.user.openId&&setCookie("openId",e.user.openId),t(e)})},getGPS:function(t,o){var n=this;this.getConfig(function(e){n.getAuthCode(e,function(e){dd.ready(function(){dd.device.geolocation.get({targetAccuracy:200,coordinate:1,withReGeocode:t,onSuccess:function(e){o&&o(e)},onFail:function(e){console.log(JSON.stringify(e))}})})})})},logOut:function(t){var e={openId:this.getOpenId(),type:"4",customerCode:this.getCustomerCode()};axios.post("/platform/wechat/wechatLogOut.nolog",e).then(function(e){t&&t(e)})},getWiFi:function(t){dd.ready(function(){dd.device.base.getInterface({onSuccess:function(e){t&&t(e)},onFail:function(e){console.log(JSON.stringify(e))}})})},getUUID:function(t){dd.ready(function(){dd.device.base.getUUID({onSuccess:function(e){t&&t(e)},onFail:function(){t&&t()}})})}},DdUI={setTitle:function(e){dd.biz.navigation.setTitle({title:e})},setEvent:function(t){dd.ready(function(){-1<navigator.userAgent.indexOf("Android")?document.addEventListener("backbutton",function(e){e.preventDefault(),t()},!1):dd.biz.navigation.setLeft({show:!0,control:!0,showIcon:!0,onSuccess:function(){t()}})})},close:function(){dd.biz.navigation.close()}},_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},WeCore={url:"",isAutoLogin:function(t){var o=this;"2"===getQueryString("type")&&setCookie("wechatType","corp");var e=getQueryString("customerCode");e&&setCookie("customerCode",e);var n=getQueryString("code");n&&setCookie("code",n),this.getSign(function(e){o.setConfig(_extends({},e,{jsApiList:["onHistoryBack","closeWindow"]}),function(){o.checkAutoLogin(t,e)})})},getCustomerCode:function(){return getCookie("customerCode")},getWechatType:function(){return getCookie("wechatType")},getWechatCode:function(){return getCookie("code")},getOpenId:function(){return getCookie("openId")},getLocale:function(){return getCookie("locale")},getSign:function(t){"android"===getOS()||"corp"===this.getWechatType()?this.initUrl=location.href.split("#")[0]:this.initUrl||(this.initUrl=location.href.split("#")[0]);var e={url:this.initUrl},o=this.getWechatType();e.customerCode=this.getCustomerCode(),e.type="corp"===o?"2":"1",axios.post("/platform/wechat/wechatSign.nolog",e).then(function(e){t&&t(e)})},initPermission:function(t){var o=this;this.getSign(function(e){o.setConfig(e,function(){t&&t()})})},setConfig:function(e,t){wx.config({debug:!!e.debug,appId:e.appId,timestamp:e.timestamp,nonceStr:e.nonceStr,signature:e.signature,jsApiList:e.jsApiList||["getLocation","openBluetoothAdapter","closeBluetoothAdapter","startBeaconDiscovery","stopBeaconDiscovery","onBeaconUpdate","onHistoryBack","closeWindow","getBeacons"]}),wx.ready(function(){setTimeout(function(){t&&t()},200)})},checkAutoLogin:function(t){var e={code:this.getWechatCode(),locale:this.getLocale()};console.log("paras===",this.getLocale());var o=getQueryString("mobile"),n=this.getWechatType();e.customerCode=this.getCustomerCode(),e.type="corp"===n?"2":"1",o&&(e.mobile=o),axios.post("/platform/wechat/wechatCheckLogin.nolog",e).then(function(e){e&&e.customerCode&&setCookie("customerCode",e.customerCode),e&&e.user&&e.user.openId&&setCookie("openId",e.user.openId),t(e)})},logOut:function(t){this.getOpenId()&&this.getCustomerCode()||this.checkAutoLogin(t);var e={openId:this.getOpenId(),type:"corp"===this.getWechatType()?"2":"1",customerCode:this.getCustomerCode()};axios.post("/platform/wechat/wechatLogOut.nolog",e).then(function(e){t&&t(e)})},previewFile:function(t,e){var o=this;"corp"===this.getWechatType()?(this.getSign(function(e){o.setConfig(e,function(){wx.previewFile(t)})}),e({hasError:!1})):e({hasError:!0,msg:"暂不支持预览"})},getPunchLog:function(e,t){var o=localStorage.getItem("userInfo"),n=_extends({punchTime:new Date+"",empId:JSON.parse(o).empId,type:t||"WECHAT_ERROR"},e);axios.post("/business/wkf/app/punch/logLatitudeLongitude",n).then(function(e){console.log("getPunchLog",e)})},getGPS:function(o){var n=this;this.getSign(function(e){var t=n.getWechatType();n.setConfig(e,function(){wx.getLocation({type:"gcj02",success:function(e){o&&o(e)},fail:function(e){n.getPunchLog(e),Native.log(e&&e.errMsg||e,{method:"wx.getLocation",type:t}),console.log("GPS fail",e),o&&o(null)}})})})},openBluetoothAdapter:function(t){wx.openBluetoothAdapter({success:function(e){console.info("openBluetoothAdapter success",e),t(_extends({},e,{isSuccess:!0}))},fail:function(e){t(_extends({},e,{isSuccess:!1}))}})},getWifi:function(t){var o=this.getWechatType();if("corp"===o){var n=this;n.getSign(function(e){e.jsApiList=["startWifi","getConnectedWifi"],n.setConfig(e,function(){wx.startWifi({success:function(e){console.info("startWifi success",e),wx.getConnectedWifi({success:function(e){console.log("getConnectedWifi success",e),t(e.wifi)},fail:function(e){Native.log(e&&e.errMsg||e,{method:"wx.getConnectedWifi",type:o}),console.log("getConnectedWifi fail",e),t({})}})},fail:function(e){Native.log(e&&e.errMsg||e,{method:"wx.startWifi",type:o}),console.log("startWifi fail",e),t({})}})})})}else t({})},destoryBlutooth:function(e,t){e.isBluetoothStoped=!0,e.isBluetoothStopping=!1,e.bluetoothTimeout&&(clearTimeout(e.bluetoothTimeout),e.bluetoothTimeout=null),"corp"===this.getWechatType()&&wx.closeBluetoothAdapter({success:function(){t&&t()}})},setBluetoothTimeout:function(t,o,n){t.bluetoothTimeout||(t.bluetoothTimeout=setTimeout(function(){t.isBluetoothStoped||wx.stopBeaconDiscovery({complete:function(){var e=o.loadCount||3;t.getBluetoothCount>=e?(t.destoryBlutooth(t),n({success:!1,error:"蓝牙获取失败"})):t.destoryBlutooth(t,function(){t.getWechatBluetooth(t,o,n)})}}),t.bluetoothTimeout&&(clearTimeout(t.bluetoothTimeout),t.bluetoothTimeout=null)},o.timeout||1e4))},initConfig:function(){var n=this;return new Promise(function(t,o){try{n.getSign(function(e){n.setConfig(e,function(){t()})})}catch(e){o(e)}})},getBluetooth:function(t,o){var n=this;"corp"===this.getWechatType()?(this.getBluetoothCount=0,this.getSign(function(e){n.setConfig(e,function(){console.log("load Bluetooth"),n.getWechatBluetooth2(t,o)})})):o([])},getBeacons:function(o,n,i){if(o<1)i({success:!1});else{var c=this;setTimeout(function(){wx.getBeacons({success:function(e){console.log("getBeacons success",e);var t=e.beacons.find(function(e,t){var o=e.uuid.toLowerCase();return-1<n.uuids.indexOf(o)});t?i({success:!0,list:[t]}):c.getBeacons(--o,n,i)},fail:function(e){o==n.loadCount&&wx.onBeaconUpdate(function(e){console.log("onBeaconUpdate",JSON.stringify(e.beacons));var t=e.beacons.find(function(e,t){var o=e.uuid.toLowerCase();return-1<n.uuids.indexOf(o)});t&&i({success:!0,list:[t]})}),Native.log(e&&e.errMsg||e,{method:"wx.getBeacons",type:c.getWechatType()}),console.log("getBeacons fail",e),c.getBeacons(--o,n,i)}})},o===n.loadCount?0:n.timeout||1e3)}},getWechatBluetooth2:function(e,o){console.log("param",e);var n,t=this;wx.startBeaconDiscovery({uuids:e.uuids,success:function(){console.log("startBeaconDiscovery success"),t.getBeacons(e.loadCount,e,function(t){wx.stopBeaconDiscovery({complete:function(e){n&&clearTimeout(n),console.log("stopBeaconDiscovery",e),console.log(t),o(t)}})}),n=setTimeout(function(){wx.stopBeaconDiscovery({complete:function(){console.log("未搜索到"),Native.log("未搜索到蓝牙,耗时:"+e.loadCount*e.timeout+1e3,{method:"wx.startBeaconDiscovery",type:t.getWechatType()}),o({success:!1,list:[],code:"003"})}})},e.loadCount*e.timeout+1e3)},fail:function(e){n&&clearTimeout(n),Native.log(e&&e.errMsg||e,{method:"wx.startBeaconDiscovery",type:t.getWechatType()}),console.log("startBeaconDiscovery fail",e),o({success:!1})}})},getWechatBluetooth:function(t,o,n){t.openBluetoothAdapter(function(e){console.log("openBluetoothAdapter",e),e.isSuccess?(console.log(t.getBluetoothCount,t.isBluetoothStopping,t.isBluetoothStoped,t.bluetoothTimeout),t.getBluetoothCount++,t.isBluetoothStopping=!1,t.isBluetoothStoped=!1,t.bluetoothTimeout&&(clearTimeout(t.bluetoothTimeout),t.bluetoothTimeout=null),wx.startBeaconDiscovery({uuids:o.uuids,success:function(){t.setBluetoothTimeout(t,o,n),wx.onBeaconUpdate(function(e){console.log("onBeaconUpdate",JSON.stringify(e.beacons)),t.beacons=e.beacons,t.isBluetoothStopping||(t.isBluetoothStopping=!0,wx.stopBeaconDiscovery({complete:function(){n({success:!0,list:t.beacons}),t.destoryBlutooth(t)}}))})},complete:function(){t.setBluetoothTimeout(t,o,n)},fail:function(e){Native.log(e&&e.errMsg||e,{method:"wx.startBeaconDiscovery",type:t.getWechatType()}),console.log("startBeaconDiscovery fail",e),wx.stopBeaconDiscovery({complete:function(){n({success:!1,error:e}),t.destoryBlutooth(t)}})}})):n({success:!1,error:"请开启蓝牙"})})},setEvent:function(e){wx.ready(function(){try{wx.onHistoryBack(function(){return e&&e(),!1})}catch(e){console.warn(e+", 请使用企业微信平台登录")}})},close:function(){wx.closeWindow()}},LxCore={url:"",getSign:function(t){var e={url:location.href.split("#")[0]};e.customerCode=this.getCustomerCode(),e.type="3",axios.post("/platform/wechat/wechatSign.nolog",e).then(function(e){t&&t(e)})},setConfig:function(e,t){lx.config({debug:!!e.debug,appId:e.appId,timestamp:e.timestamp,nonceStr:e.nonceStr,signature:e.signature,jsApiList:e.jsApiList||["getLocation"]}),lx.ready(function(){t&&t()})},isAutoLogin:function(e){var t=getQueryString("customerCode"),o=getQueryString("code");t&&setCookie("customerCode",t),o&&setCookie("code",o),this.checkAutoLogin(e)},checkAutoLogin:function(t){var e={code:this.getLanxinCode(),customerCode:this.getCustomerCode(),type:"3"};axios.post("/platform/wechat/wechatCheckLogin.nolog",e).then(function(e){e&&e.user&&e.user.openId&&setCookie("openId",e.user.openId),t(e)})},logOut:function(t){var e={openId:this.getOpenId(),customerCode:this.getCustomerCode(),type:"3"};axios.post("/platform/wechat/wechatLogOut.nolog",e).then(function(e){t&&t(e)})},initConfig:function(){var n=this;return new Promise(function(t,o){try{n.getSign(function(e){n.setConfig(e,function(){t()})})}catch(e){o(e)}})},getGPS:function(t){lx.device.getLocation({coordinateType:"gcj02",success:function(e){return t&&t(e)},fail:function(e){Native.log(e&&e.errMsg,{method:"lx.device.getLocation",err:e}),t&&t(null)}})},getWifi:function(t){lx.wifiDeviceInfo({success:function(e){return t(e)},fail:function(){return t({})}})},getCustomerCode:function(){return getQueryString("customerCode")||getCookie("customerCode")},getLanxinCode:function(){return getQueryString("code")||getCookie("code")},getOpenId:function(){return getCookie("openId")}},MapCore={getGPS:function(t){var e=void 0,o=void 0;(e=new AMap.Map("")).plugin("AMap.Geolocation",function(){o=new AMap.Geolocation({enableHighAccuracy:!0,timeout:1e4}),e.addControl(o),o.getCurrentPosition(),AMap.event.addListener(o,"complete",function(e){console.log("AMap complete",e),t&&t({longitude:e.position.getLng(),latitude:e.position.getLat()})}),AMap.event.addListener(o,"error",function(e){console.log("AMap error",e),Native.log(e&&e.message,{method:"AMap.Geolocation",type:"h5"}),t&&t()})})}},getOS$1=function(){var e={},t=navigator.userAgent;return-1<t.indexOf("DingTalk")?e.type="dd":-1<t.indexOf("miniProgram")?e.type="miniprogram":-1<t.indexOf("MicroMessenger")?e.type="wechat":-1<t.indexOf("Feishu")?e.type="feishu":-1<t.indexOf("WandaOA")?e.type="wanxin":-1<t.indexOf("Lanxin")||-1<t.indexOf("es360messenger")?e.type="lanxin":-1<t.indexOf("Android")||-1<t.indexOf("Adr")?e.type=_isNativeAndroid()?"android":"h5":t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?e.type=_isNativeIos()?"ios":"h5":e.type="windows",e},_isNativeAndroid=function(){var t=!0;try{android.callWithDict(JSON.stringify({method:"test"}))}catch(e){t=!1}return t},_isNativeIos=function(){var t=!0;try{ios.callWithDict({method:"test"})}catch(e){t=!1}return t},Native$1={getQueryString:getQueryString,getCookie:getCookie,setCookie:setCookie,OS:getOS$1(),callbackMap:new Map,isNativeAndroid:function(){return _isNativeAndroid()},isNativeIos:function(){return _isNativeIos()},getNavigation:function(e){var t=1;switch(this.OS.type){case"dd":t=e?3==e?2:e:4;break;default:e&&(t=e)}return t},setDingTalkMenu:function(e,t){switch(this.OS.type){case"dd":DdUI.setEvent(function(){0<=t.indexOf(e.location.pathname)?DdUI.close():e.goBack()});break;case"wechat":"corp"===WeCore.wechatType&&WeCore.setEvent(function(){0<=t.indexOf(e.location.pathname)?WeCore.close():e.goBack()})}},setTitle:function(e){switch(this.OS.type){case"dd":DdUI.setTitle(e)}},getCache:function(e,t){var o="";switch(this.OS.type){case"android":this.callNative({method:"getCache",key:e},function(e){t?t(e):o=e});break;default:o=window.localStorage.getItem(e)}return o},setCache:function(e,t){switch(this.OS.type){case"android":this.callNative({method:"setCache",key:e,value:t});break;default:window.localStorage.setItem(e,t)}},removeCache:function(e){switch(this.OS.type){case"android":this.callNative({method:"removeCache",key:e});break;default:window.localStorage.removeItem(e)}},login:function(e,t){switch(this.OS.type){case"dd":e.dingTalkLogin(t);break;case"wechat":t.wechatType=WeCore.getWechatType(),e.weChatLogin(t);break;case"lanxin":e.lanXinLogin(t);break;default:e.login(t)}},initPermission:function(e){switch(this.OS.type){case"wechat":WeCore.initPermission(e);break;default:e&&e()}},isLogin:function(t){switch(console.warn("this.OS.type:",this.OS.type),this.OS.type){case"dd":DdCore.isAutoLogin(function(e){t(e)});break;case"wechat":WeCore.isAutoLogin(function(e){t(e)});break;case"lanxin":LxCore.isAutoLogin(function(e){return t(e)});break;case"android":this.getCache("",function(e){t(e)});break;default:t({user:JSON.parse(this.getCache("userInfo")),token:this.getCache("token")})}},exit:function(e){switch(this.OS.type){case"dd":DdCore.logOut(e);break;case"wechat":WeCore.logOut(e);break;case"lanxin":LxCore.logOut(e);break;default:e&&e()}},callNative:function(e,t){var o=uuid.v4(),n={_callback_key_:o};for(var i in"string"==typeof e&&(e={method:e}),e)n[i]=e[i];switch(this.callbackMap.set(o,t),this.OS.type){case"ios":ios.callWithDict(n);break;case"android":android.callWithDict(JSON.stringify(n))}},callFront:function(e,t){var o=JSON.parse(t);this.callbackMap.has(e)&&(this.callbackMap.get(e)(o),this.callbackMap.delete(e))},getValidateList:function(e,t,o){var n=this,i=[],c=o||{num:"密码解锁",hand:"手势解锁",finger:"指纹解锁"};switch(this.OS.type){case"dd":case"android":i=1==e?[{pwd_type:"num",label:c.num},{pwd_type:"hand",label:c.hand}]:t.filter(function(e){return"1"==e.enable&&("hand"==e.pwd_type||"num"==e.pwd_type)});break;case"ios":1==e?(i=[{pwd_type:"num",label:c.num},{pwd_type:"hand",label:c.hand}],this.OS.fingerAllow&&i.push({pwd_type:"finger",label:c.finger})):i=t.filter(function(e){return"finger"==e.pwd_type?n.OS.fingerAllow&&"1"==e.enable:"1"==e.enable});break;default:i=1==e?[{pwd_type:"num",label:c.num},{pwd_type:"hand",label:c.hand}]:t.filter(function(e){return"1"==e.enable&&("hand"==e.pwd_type||"num"==e.pwd_type)})}return i},log:function(e,t){var o=1<arguments.length&&void 0!==t?t:{};window.PerformanceAddError&&window.PerformanceAddError({msg:e||"",n:"native",method:o.type||this.OS.type,sendData:o.sendData,resourceUrl:o.method})},getSystemInfo:function(t){var e={success:!0,device:""};switch(this.OS.type){case"dd":t&&t(e);break;case"wechat":var o=this.getCache("openId");e.device=o,t&&t(e);break;case"lanxin":t&&t({device:this.getCache("openId")});break;case"android":case"ios":this.callNative("getSystemInfo",function(e){t&&t(e)});break;default:t&&t(e)}},previewFile:function(e,t){switch(this.OS.type){case"wechat":WeCore.previewFile(e,t);break;default:t({hasError:!0,msg:"暂不支持预览"})}},getGPS:function(e,o){var t=Object.assign({},{method:"getGPS"},e);switch(e.type||this.OS.type){case"dd":var n=e.recode;DdCore.getGPS(n,function(e){var t=Object.assign({},{success:!0},e);o&&o(t)});break;case"wechat":WeCore.getGPS(function(e){var t={success:!1};null!=e&&(t=Object.assign({},{success:!0},e)),o&&o(t)});break;case"lanxin":LxCore.getGPS(function(e){var t={success:!1};null!=e&&(t=Object.assign({},{success:!0},e)),o&&o(t)});break;case"android":case"ios":this.callNative(t,function(e){o&&o(e)});break;case"h5":MapCore.getGPS(function(e){var t=Object.assign({},{success:!0},e);o&&o(t)})}},getWiFi:function(i){switch(this.OS.type){case"dd":DdCore.getWiFi(function(e){var t={mac:e.macIp,name:e.ssid};i&&i(t)});break;case"wechat":WeCore.getWifi(function(e){var t={};e.BSSID&&(t.mac=e.BSSID.toLowerCase(),t.name=e.SSID),i&&i(t)});break;case"lanxin":LxCore.getWifi(function(e){var t={};e.bssid&&(t.mac=e.bssid.toLowerCase(),t.name=e.ssid),i&&i(t)});break;case"android":case"ios":this.callNative({method:"getWiFi"},function(e){if(e.mac){var t=[],o=e.mac.split(":");for(var n in o)1==o[n].length&&(o[n]="0"+o[n]),t.push(o[n]);e.mac=t.join(":")}i&&i(e)})}},initConfig:function(){switch(console.log("初始化授权",this.OS.type),this.OS.type){case"lanxin":return LxCore.initConfig();default:return Promise.resolve()}},getBlueTooth:function(e,t){switch(this.OS.type){case"wechat":WeCore.getBluetooth(e,function(e){t&&t(e)});break;case"android":case"ios":this.callNative({method:"getBlueTooth"},function(e){t&&t(e)});break;default:t&&t({success:!0,list:[]})}},destoryBlutooth:function(t){switch(this.OS.type){case"wechat":WeCore.destoryBlutooth(WeCore,function(e){t&&t(e)});break;case"android":case"ios":this.callNative({method:"destoryBlutooth"},function(e){t&&t(e)});break;default:t&&t()}}};void 0===window.Native&&(window.Native=Native$1);var index=window.Native;exports.Native=index;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hrsass-native-mobile",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "connect h5 to android and ios",
5
5
  "main": "index.js",
6
6
  "scripts": {