qcloud-iotexplorer-appdev-plugin-wificonf-core
Advanced tools
Comparing version 2.3.22 to 2.3.23
@@ -1,5 +0,6 @@ | ||
export function reconnectWifi(wifiInfo: any, { onProgress, ignoreError, useTargetWifi, }: { | ||
export function reconnectWifi(wifiInfo: any, { onProgress, ignoreError, useTargetWifi, waitSystemNetworkChangeTime, }: { | ||
onProgress: any; | ||
ignoreError?: boolean; | ||
useTargetWifi?: boolean; | ||
waitSystemNetworkChangeTime?: number; | ||
}): Promise<never>; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.reconnectWifi=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),constants_1=require("../constants"),connectWifiBase_1=require("./connectWifiBase"),wxApis_1=tslib_1.__importDefault(require("./wxApis")),util_1=require("./util"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,onNetworkStatusChange=function(){return new Promise((function(e,t){var o=Date.now();console.log("onNetworkStatusChange",o);var n=setTimeout((function(){wxApis_1.default.offNetworkStatusChange(s),wxApis_1.default.getNetworkType().then((function(n){console.log("getNetworkType",n),"none"===n.networkType?t({code:"BUSINESS_WIFI_RECONNECT_STATE_CHANGE_TIMEOUT"}):e(tslib_1.__assign(tslib_1.__assign({},n),{timeCost:Date.now()-o}))}))}),13e3),s=function(t){var i=t.isConnected;if(console.log("onNetWorkStatusChange",t),i){clearTimeout(n),wxApis_1.default.offNetworkStatusChange(s);var r=5e3-(Date.now()-o);console.log("onNetWorkStatusChange is connected",r),r<=0?e(tslib_1.__assign(tslib_1.__assign({},t),{timeCost:Date.now()-o})):delay(r).then((function(){e(tslib_1.__assign(tslib_1.__assign({},t),{timeCost:Date.now()-o}))}))}};wxApis_1.default.onNetworkStatusChange(s)}))};exports.reconnectWifi=function(e,t){var o=t.onProgress,n=t.ignoreError,s=void 0!==n&&n,i=t.useTargetWifi,r=void 0!==i&&i;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var t,n,i,_,a;return tslib_1.__generator(this,(function(c){switch(c.label){case 0:t=util_1.checkIsIOS(),n=Date.now(),c.label=1;case 1:return c.trys.push([1,9,11,12]),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_START,reportEvents:["重连wifi"]}),i=void 0,r?[4,connectWifiBase_1.connectWifiBase(e)]:[3,3];case 2:return c.sent(),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{timeCost:Date.now()-n},reportEvents:["重连wifi"]}),[3,8];case 3:return c.trys.push([3,5,,8]),[4,onNetworkStatusChange()];case 4:return i=c.sent(),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{connectStatus:i,type:"SOFTAP_RECONNECT_TARGET_WIFI_USE_DEFAULT"},reportEvents:["重连wifi"]}),[3,8];case 5:return _=c.sent(),util_1.checkIsHuaWei()?[3,7]:(console.error(_),[4,connectWifiBase_1.connectWifiBase(e)]);case 6:c.sent(),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{timeCost:Date.now()-n},reportEvents:["重连wifi"]}),c.label=7;case 7:return[3,8];case 8:return[3,12];case 9:return a=c.sent(),console.error(a),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.confirm("手机连接目标Wi-Fi“"+e.SSID+"”失败,请手动切换到能够正常访问的网络环境(移动网络或者WI-FI)后继续配网操作","",{confirmText:"继续",confirmColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.primary,cancelText:"取消",cancelColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.danger,enforce:!0})];case 10:return c.sent()||s?(o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{ignoreError:s,timeCost:Date.now()-n}}),[3,12]):[2,Promise.reject(tslib_1.__assign(tslib_1.__assign({},a),{code:"BUSINESS_WIFI_RECONNECT_FAIL"}))];case 11:return t&&qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.hideLoading(),[7];case 12:return[2]}}))}))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.reconnectWifi=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),constants_1=require("../constants"),connectWifiBase_1=require("./connectWifiBase"),wxApis_1=tslib_1.__importDefault(require("./wxApis")),util_1=require("./util"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,onNetworkStatusChange=function(e){var t=e.waitSystemNetworkChangeTime,o=void 0===t?13e3:t;return new Promise((function(e,t){var n=Date.now();console.log("onNetworkStatusChange",n);var i=setTimeout((function(){wxApis_1.default.offNetworkStatusChange(s),wxApis_1.default.getNetworkType().then((function(o){console.log("getNetworkType",o),"none"===o.networkType?t({code:"BUSINESS_WIFI_RECONNECT_STATE_CHANGE_TIMEOUT"}):e(tslib_1.__assign(tslib_1.__assign({},o),{timeCost:Date.now()-n}))}))}),o),s=function(t){var o=t.isConnected;if(console.log("onNetWorkStatusChange",t),o){clearTimeout(i),wxApis_1.default.offNetworkStatusChange(s);var r=5e3-(Date.now()-n);console.log("onNetWorkStatusChange is connected",r),r<=0?e(tslib_1.__assign(tslib_1.__assign({},t),{timeCost:Date.now()-n})):delay(r).then((function(){e(tslib_1.__assign(tslib_1.__assign({},t),{timeCost:Date.now()-n}))}))}};wxApis_1.default.onNetworkStatusChange(s)}))};exports.reconnectWifi=function(e,t){var o=t.onProgress,n=t.ignoreError,i=void 0!==n&&n,s=t.useTargetWifi,r=void 0!==s&&s,a=t.waitSystemNetworkChangeTime,_=void 0===a?13e3:a;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var t,n,s,a,c;return tslib_1.__generator(this,(function(l){switch(l.label){case 0:t=util_1.checkIsIOS(),n=Date.now(),l.label=1;case 1:return l.trys.push([1,9,11,12]),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_START,reportEvents:["重连wifi"]}),s=void 0,r?[4,connectWifiBase_1.connectWifiBase(e)]:[3,3];case 2:return l.sent(),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{timeCost:Date.now()-n},reportEvents:["重连wifi"]}),[3,8];case 3:return l.trys.push([3,5,,8]),[4,onNetworkStatusChange({waitSystemNetworkChangeTime:_})];case 4:return s=l.sent(),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{connectStatus:s,type:"SOFTAP_RECONNECT_TARGET_WIFI_USE_DEFAULT"},reportEvents:["重连wifi"]}),[3,8];case 5:return a=l.sent(),util_1.checkIsHuaWei()?[3,7]:(console.error(a),[4,connectWifiBase_1.connectWifiBase(e)]);case 6:l.sent(),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{timeCost:Date.now()-n},reportEvents:["重连wifi"]}),l.label=7;case 7:return[3,8];case 8:return[3,12];case 9:return c=l.sent(),console.error(c),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.confirm("手机连接目标Wi-Fi“"+e.SSID+"”失败,请手动切换到能够正常访问的网络环境(移动网络或者WI-FI)后继续配网操作","",{confirmText:"继续",confirmColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.primary,cancelText:"取消",cancelColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.danger,enforce:!0})];case 10:return l.sent()||i?(o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{ignoreError:i,timeCost:Date.now()-n}}),[3,12]):[2,Promise.reject(tslib_1.__assign(tslib_1.__assign({},c),{code:"BUSINESS_WIFI_RECONNECT_FAIL"}))];case 11:return t&&qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.hideLoading(),[7];case 12:return[2]}}))}))}; | ||
//# sourceMappingURL=reconnectWifi.js.map |
@@ -30,2 +30,5 @@ import { WifiConfType } from 'iotexplorer-ui-dev-config'; | ||
newTokenVersion?: boolean; | ||
reconnectFamilyWifiOptions?: { | ||
waitSystemNetworkChangeTime: number; | ||
}; | ||
} | ||
@@ -32,0 +35,0 @@ export interface WifiInfo { |
{ | ||
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-core", | ||
"version": "2.3.22", | ||
"version": "2.3.23", | ||
"description": "", | ||
@@ -24,3 +24,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "32b3879aa17d7a469abb90c35a2a410eb6326445" | ||
"gitHead": "c9df97fac805dcf849583007aea6adc1099944f1" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
98064
958
0