Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qcloud-iotexplorer-appdev-plugin-wificonf-core

Package Overview
Dependencies
Maintainers
2
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qcloud-iotexplorer-appdev-plugin-wificonf-core - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

2

lib/WifiConfProtocolBase/issueHandler.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.issueHandler=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),constants_1=require("../constants"),wxApis_1=tslib_1.__importDefault(require("../utils/wxApis")),utils_1=require("qcloud-iotexplorer-appdev-sdk/lib/utils"),UDP_ERROR_WAIT_RETRY_TIME=1500,WIFI_CONNECT_WAIT_RETRY_TIME=4e3,handleWifiIssue=function(e){var t=e.code,r=e.targetWifiInfo,s=e.onProgress;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var e,i,o;return tslib_1.__generator(this,(function(_){switch(_.label){case 0:s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_START,detail:{targetWifiInfo:r}}),_.label=1;case 1:return _.trys.push([1,6,,7]),[4,wxApis_1.default.getConnectedWifi()];case 2:return(e=_.sent().wifi)&&e.SSID===r.SSID?"UDP_ERROR"!==t&&"UDP_SEND_MSG_FAIL"!==t?[3,4]:[4,utils_1.delay(UDP_ERROR_WAIT_RETRY_TIME)]:[3,5];case 3:return _.sent(),s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_SUCCESS,detail:{msg:"UDP错误,或许是连接wifi的延迟,直接重试下"}}),[2,!0];case 4:return s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_CANCEL,detail:{msg:"当前连接的wifi正确,不需要处理"}}),[2,!1];case 5:return[3,7];case 6:return i=_.sent(),console.error("getConnectedWifi failed",i),i.errCode&&12010!==i.errCode?(s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_CANCEL,detail:tslib_1.__assign({msg:"获取当前连接的wifi出错"},i)}),[2,!1]):[3,7];case 7:return _.trys.push([7,11,,13]),[4,wxApis_1.default.startWifi()];case 8:return _.sent(),[4,wxApis_1.default.connectWifi({SSID:r.SSID,password:r.password})];case 9:return _.sent(),[4,utils_1.delay(WIFI_CONNECT_WAIT_RETRY_TIME)];case 10:return _.sent(),s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_SUCCESS,detail:{handled:!0}}),[2,!0];case 11:return o=_.sent(),console.error(o),qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.logger.debug("connectWifi fail",o),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showModal({title:"手机连接"+r.SSID+"失败,请在设置页面手动切换到"+r.SSID+"再继续",confirmText:"继续",confirmColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.primary,cancelText:"取消",cancelColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.danger})];case 12:return _.sent()?(s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_SUCCESS,detail:{msg:"自动连接的wifi错误,用户设置自动连接"}}),[2,!0]):(s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_CANCEL,detail:{msg:"自动连接的wifi错误,用户取消自动连接"}}),[2,!1]);case 13:return[2]}}))}))};exports.issueHandler=function(e){var t=e.error,r=e.targetWifiInfo,s=e.onProgress;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var e;return tslib_1.__generator(this,(function(i){switch(i.label){case 0:switch(e=!1,t.code){case"PROTOCOL_TIMEOUT":case"CONNECT_SMARTCONFIG_FAIL":case"UDP_ERROR":case"UDP_SEND_MSG_FAIL":return[3,1]}return[3,3];case 1:return[4,handleWifiIssue({code:t.code,targetWifiInfo:r,onProgress:s})];case 2:return e=i.sent(),[3,4];case 3:return[3,4];case 4:return[2,e]}}))}))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.issueHandler=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),constants_1=require("../constants"),wxApis_1=tslib_1.__importDefault(require("../utils/wxApis")),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,UDP_ERROR_WAIT_RETRY_TIME=1500,WIFI_CONNECT_WAIT_RETRY_TIME=4e3,handleWifiIssue=function(e){var t=e.code,r=e.targetWifiInfo,s=e.onProgress;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var e,i,o;return tslib_1.__generator(this,(function(_){switch(_.label){case 0:s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_START,detail:{targetWifiInfo:r}}),_.label=1;case 1:return _.trys.push([1,6,,7]),[4,wxApis_1.default.getConnectedWifi()];case 2:return(e=_.sent().wifi)&&e.SSID===r.SSID?"UDP_ERROR"!==t&&"UDP_SEND_MSG_FAIL"!==t?[3,4]:[4,delay(UDP_ERROR_WAIT_RETRY_TIME)]:[3,5];case 3:return _.sent(),s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_SUCCESS,detail:{msg:"UDP错误,或许是连接wifi的延迟,直接重试下"}}),[2,!0];case 4:return s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_CANCEL,detail:{msg:"当前连接的wifi正确,不需要处理"}}),[2,!1];case 5:return[3,7];case 6:return i=_.sent(),console.error("getConnectedWifi failed",i),i.errCode&&12010!==i.errCode?(s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_CANCEL,detail:tslib_1.__assign({msg:"获取当前连接的wifi出错"},i)}),[2,!1]):[3,7];case 7:return _.trys.push([7,11,,13]),[4,wxApis_1.default.startWifi()];case 8:return _.sent(),[4,wxApis_1.default.connectWifi({SSID:r.SSID,password:r.password})];case 9:return _.sent(),[4,delay(WIFI_CONNECT_WAIT_RETRY_TIME)];case 10:return _.sent(),s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_SUCCESS,detail:{handled:!0}}),[2,!0];case 11:return o=_.sent(),console.error(o),qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.logger.debug("connectWifi fail",o),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showModal({title:"手机连接"+r.SSID+"失败,请在设置页面手动切换到"+r.SSID+"再继续",confirmText:"继续",confirmColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.primary,cancelText:"取消",cancelColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.danger})];case 12:return _.sent()?(s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_SUCCESS,detail:{msg:"自动连接的wifi错误,用户设置自动连接"}}),[2,!0]):(s({code:constants_1.WifiConfStepCode.AUTO_HANDLE_WIFI_PROBLEM_CANCEL,detail:{msg:"自动连接的wifi错误,用户取消自动连接"}}),[2,!1]);case 13:return[2]}}))}))};exports.issueHandler=function(e){var t=e.error,r=e.targetWifiInfo,s=e.onProgress;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var e;return tslib_1.__generator(this,(function(i){switch(i.label){case 0:switch(e=!1,t.code){case"PROTOCOL_TIMEOUT":case"CONNECT_SMARTCONFIG_FAIL":case"UDP_ERROR":case"UDP_SEND_MSG_FAIL":return[3,1]}return[3,3];case 1:return[4,handleWifiIssue({code:t.code,targetWifiInfo:r,onProgress:s})];case 2:return e=i.sent(),[3,4];case 3:return[3,4];case 4:return[2,e]}}))}))};
//# sourceMappingURL=issueHandler.js.map
{
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-core",
"version": "1.0.7",
"version": "1.0.8",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc