提交 4d88aae7 编写于 作者: lizhongyi_'s avatar lizhongyi_

fix: 添加文件路径

上级 cf715825
......@@ -114,6 +114,15 @@
"enablePullDownRefresh": false
}
},
{
"path" : "pages/SystemAPI/WifiInfomation/wifiInfomation",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
......
<template>
<page-head :title="title"></page-head>
<page-head :title="获取当前连接wifi信息" accordion></page-head>
<view class="uni-padding-wrap uni-common-mt">
<button @tap="getLocationPromise">获取定位权限</button>
<button @tap="getWifiInfo">获取WiFi信息</button>
......@@ -7,43 +7,37 @@
</template>
<script>
import { getCurrentWifiInfo, requestLocationPromise } from '../../../uni_modules/uni-wifiinformation/utssdk/app-ios/index.uts'
// import { getCurrentWifiInfo, requestLocationPromise } from '@/uni_modules/uni-wifiinformation/utssdk/app-ios/index.uts';
export default {
data() {
return {
title:"获取当前连接wifi信息"
}
},
methods:{
getLocationPromise() {
requestLocationPromise((res):void => {
console.log(res)
uni.showToast({
title: res["message"],
icon: 'none'
})
})
// requestLocationPromise((res):void => {
// console.log(res)
// uni.showToast({
// title: res["message"],
// icon: 'none'
// })
// })
},
getWifiInfo() {
/* iOS12之后获取wifi信息需要获取系统定位权限,否则获取到的wifi信息为空 */
requestLocationPromise((res):void => {
if (res["success"] == true) {
let wifiInfo = getCurrentWifiInfo()
if (wifiInfo != null) {
console.log(wifiInfo)
uni.showToast({
title: "当前wifi信息获取成功",
icon: 'none'
})
}
}
})
}
// requestLocationPromise((res):void => {
// if (res["success"] == true) {
// let wifiInfo = getCurrentWifiInfo()
// if (wifiInfo != null) {
// console.log(wifiInfo)
// uni.showToast({
// title: "当前wifi信息获取成功",
// icon: 'none'
// })
// }
// }
// })
},
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册