This commit is contained in:
wangjiahai
2023-11-21 16:04:02 +08:00
2 changed files with 11 additions and 23 deletions

30
App.vue
View File

@@ -1,29 +1,13 @@
<script>
import config from "common/config.js";
export default {
globalData: {
wxSilentLoginURL: config.baseUrl+"/v1/app/wxuser/wxSilentLogin",
},
onLaunch: function() {
// console.log('App Launch', option)
// wx.showToast({
// title: '成功>>>>>' + option,
// icon: 'none',
// duration: 5000 //持续的时间
// })
// setTimeout(function() {
// uni.navigateTo({
// url: 'pages/index/enterpriseRisk'
// });
// }, 1500);
if (!wx.cloud) {
console.error('请使用 2.2.3 或以上的基础库以使用云能力')
} else {
wx.cloud.init({
// env 参数说明:
// env 参数决定接下来小程序发起的云开发调用 (wx.cloud.xxx) 会默认请求到哪个云环境的资源
// 此处请填入环境 ID环境 ID 可打开云控制台查看
//如不填则使用默认环境 (第一个创建的环境)
// env: 'my-env-id
traceUser: true,
})
}
this.WxSilentLogin()
},
onShow: function() {
console.log('App Show')

View File

@@ -4,12 +4,16 @@ import Vue from 'vue'
// vuex
import store from './store'
import wxSilentLogin from './common/wxSilentLogin.js'
import mixin from './common/mixin'
Vue.mixin(mixin)
import api from '@/common/request.api.js'
Vue.prototype.$api = api
Vue.prototype.WxSilentLogin = wxSilentLogin
Vue.config.productionTip = false
App.mpType = 'app'