123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //app.js
- App({
- onLaunch: function () {
- if (!wx.cloud) {
- console.error('请使用 2.2.3 或以上的基础库以使用云能力')
- } else {
- wx.cloud.init({
- // env 参数说明:
- // env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源
- // 此处请填入环境 ID, 环境 ID 可打开云控制台查看
- // 如不填则使用默认环境(第一个创建的环境)
- env: 'test-nxy',
- traceUser: true,
- })
- }
- // 小程序自动更新
- // 获取更新管理器对象
- const updateManager=wx.getUpdateManager()
- updateManager.onCheckForUpdate(function(res){
- // 检测更新结果
- if(res.hasUpdate){
- updateManager.onUpdateReady(function(){
- wx.showModal({
- title:'更新提示',
- content:'新版本已经准备好,点击确定重新启动',
- showCancel:false,
- success:res=>{
- if(res.confirm){
- updateManager.applyUpdate();
- }
- }
- })
- })
- updateManager.onUpdateFailed(function(){
- wx.showModal({
- title:'提示',
- content:'检查到有新版本,但是下载失败,请检查网络设置',
- showCancel:false
- })
- })
- }
- })
- },
- globalData: {
- // globalUrl: 'http://192.168.1.173:50009', //地址
- globalUrl: 'https://app.taxbk.cn:9443', //地址
- imgUrl: '', //图片地址
- systemInfo: null, //系统信息
- userInfo: null //用户信息
- }
- })
|