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

fix: 添加文件路径

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