qcloud-iotexplorer-appdev-plugin-wificonf-core
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -1,4 +0,4 @@ | ||
export function reconnectWifi(wifiInfo: any, { onProgress, onError }: { | ||
export function reconnectWifi(wifiInfo: any, { onProgress, ignoreError, }: { | ||
onProgress: any; | ||
onError: any; | ||
}): Promise<any>; | ||
ignoreError?: boolean; | ||
}): 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"),wxApis_1=tslib_1.__importDefault(require("./wxApis")),constants_1=require("../constants");exports.reconnectWifi=function(e,t){var o=t.onProgress,r=t.onError;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var t,i;return tslib_1.__generator(this,(function(s){switch(s.label){case 0:t=Date.now(),s.label=1;case 1:return s.trys.push([1,5,,7]),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_START}),[4,wxApis_1.default.startWifi()];case 2:return s.sent(),[4,wxApis_1.default.connectWifi({SSID:e.SSID,password:e.password})];case 3:return s.sent(),[4,wxApis_1.default.getConnectedWifi()];case 4:if(s.sent().wifi.SSID!==e.SSID)throw{code:"BUSINESS_WIFI_RECONNECT_FAIL"};return o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{timeCost:Date.now()-t}}),[3,7];case 5:return i=s.sent(),console.error(i),qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.logger.error("softap-reconnect-wifi-fail",{error:i}),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.tips.confirm("手机连接目标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 6:return s.sent()?(o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{timeCost:Date.now()-t}}),[3,7]):[2,r({code:"BUSINESS_WIFI_RECONNECT_FAIL",detail:i})];case 7: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"),wxApis_1=tslib_1.__importDefault(require("./wxApis")),constants_1=require("../constants");exports.reconnectWifi=function(e,t){var o=t.onProgress,r=t.ignoreError,i=void 0!==r&&r;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var t,r;return tslib_1.__generator(this,(function(s){switch(s.label){case 0:t=Date.now(),s.label=1;case 1:return s.trys.push([1,5,,7]),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_START}),[4,wxApis_1.default.startWifi()];case 2:return s.sent(),[4,wxApis_1.default.connectWifi({SSID:e.SSID,password:e.password})];case 3:return s.sent(),[4,wxApis_1.default.getConnectedWifi()];case 4:if(s.sent().wifi.SSID!==e.SSID)throw{code:"BUSINESS_WIFI_RECONNECT_FAIL"};return o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{timeCost:Date.now()-t}}),[3,7];case 5:return r=s.sent(),console.error(r),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.confirm("手机连接目标Wi-Fi失败,请手动切换到能够正常访问的网络环境(移动网络或者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 6:return s.sent()||i?(o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{ignoreError:i,timeCost:Date.now()-t}}),[3,7]):[2,Promise.reject(tslib_1.__assign(tslib_1.__assign({},r),{code:"BUSINESS_WIFI_RECONNECT_FAIL"}))];case 7:return[2]}}))}))}; | ||
//# sourceMappingURL=reconnectWifi.js.map |
{ | ||
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-core", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
79351