小程序编译0.0.0
This commit is contained in:
37
App.vue
37
App.vue
@@ -1,8 +1,45 @@
|
||||
<script>
|
||||
import Api from '@/common/js/api.js'
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.cache.set('menuInfo', uni.getMenuButtonBoundingClientRect());
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
uni.cache.set('weixincode', data.code);
|
||||
let res = await Api.getminiuserinfo({
|
||||
code: uni.cache.get('weixincode') //临时登录凭证
|
||||
})
|
||||
uni.cache.set('open_id', res.data.openid)
|
||||
this.$isResolve()
|
||||
},
|
||||
})
|
||||
// #endif
|
||||
// 异步获取系统信息
|
||||
// uni.getSystemInfo({
|
||||
// success: function(info) {
|
||||
// console.log(info)
|
||||
// if (info.platform === 'h5') {
|
||||
// // H5环境
|
||||
// if (uni.getStorageSync('navigationStyle') === 'custom') {
|
||||
// // 全局原生导航栏被隐藏
|
||||
// uni.hideNavigationBarLoading();
|
||||
// } else {
|
||||
// // 显示全局原生导航栏
|
||||
// }
|
||||
// } else {
|
||||
// // 非H5环境
|
||||
// if (uni.getStorageSync('navigationStyle') === 'custom') {
|
||||
// // 自定义导航
|
||||
// } else {
|
||||
// // 非自定义导航
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// #ifndef MP-WEIXIN
|
||||
this.$isResolve()
|
||||
// #endif
|
||||
},
|
||||
onShow: function() {
|
||||
|
||||
Reference in New Issue
Block a user