微信小程序之permission字段


最近查看我發布的小程序出了問題,沒有顯示天氣,打開文件查看,出現如下提示

 

 

 

 

那么如何解決呢

在 app.json 里面增加 permission 屬性配置
然后在app.json中
添加代碼

 整個app.json:

"permission": {
    "scope.userLocation": {
        "desc": "你的位置信息將用於小程序位置接口的效果展示"
    }
}

應該是小程序更新過之后需要用戶自己允許是否獲取地址

 

 

{
 "pages": [
  "pages/index/index",
  "pages/home/home",
  "pages/logs/logs",
  "pages/test/test"
 ],
 "window": {
  "backgroundTextStyle": "light",
  "navigationBarBackgroundColor": "#405f80",
  "navigationBarTitleText": "這是標題",
  "navigationBarTextStyle": "black",
  "enablePullDownRefresh ": "true"
 },
 "tabBar": {
  "borderStyle": "white",
  "position": "bottom",
  "list": [
   {
    "pagePath": "pages/home/home",
    "text": "首頁",
    "iconPath": "images/tab/paidui.png",
    "selectedIconPath": "images/tab/paidui1.png"
   },
   {
    "pagePath": "pages/test/test",
    "text": "記錄",
    "iconPath": "images/tab/jilu.png",
    "selectedIconPath": "images/tab/jilu2.png"
   }
  ]
 },
 "permission": {
  "scope.userLocation": {
   "desc": "你的位置信息將用於小程序位置接口的效果展示"
  }
 }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM