diff --git a/pages/index/index.vue b/pages/index/index.vue index a22e3ea6f45097bfbe3d3ff8fd78c28a5c53ad59..5bac7fa26c03e80a1a6ab1a38d537d4d717a10ab 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -36,23 +36,15 @@ }, testConnnectWifi(){ - // uni.connectWifi({ - // maunal:false, - // SSID:"Xiaomi_20D0", - // password:"BBBB", - // complete:(res)=>{ - // console.log(res); - // } - // }); uni.connectWifi({ maunal:false, - partialInfo:false, SSID:"Xiaomi_20D0", - password:"streamApp!2016", + password:"BBBB", complete:(res)=>{ console.log(res); } }); + }, testGetConnnectWifi(){ uni.getConnectedWifi({ @@ -190,6 +182,7 @@ testGetBatteryInfo() { uni.getBatteryInfo({ success(res) { + console.log(res); uni.showToast({ title: "当前电量:" + res.level + '%', icon: 'none' diff --git a/uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts b/uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts index bde4e50a613c8df52b065d6e3b66698637129b1c..1f734f056cb69f148202b908834b5f93a0e97877 100644 --- a/uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts +++ b/uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts @@ -19,6 +19,8 @@ export default function getBatteryInfo(options: GetBatteryInfoOptions) { BatteryManager.BATTERY_PROPERTY_CAPACITY ); const res = { + errSubject: "uni-getBatteryInfo", + errCode: 0, errMsg: 'getBatteryInfo:ok', level, isCharging: manager.isCharging() @@ -27,6 +29,8 @@ export default function getBatteryInfo(options: GetBatteryInfoOptions) { options.complete?.(res) } else { const res = { + errSubject: "uni-getBatteryInfo", + errCode: 1001, errMsg: 'getBatteryInfo:fail getAppContext is null' } options.fail?.(res)