代码拉取完成,页面将自动刷新
<script>
import {
base
} from "./api/index.js"
export default {
onLaunch: function() {
console.log('App Launch');
base.config().then(res => {
console.log(res);
// 系统的基本配置项
this.globalData.user_protocol = res.user_protocol;
this.globalData.user_private_protocol = res.user_private_protocol;
this.globalData.aboutus = res.aboutus;
this.globalData.player_cover = res.player.cover;
console.log(this.globalData)
})
// 小程序 seesion
uni.login({
success: (res) => {
base.wxLogin({
code: res.code
}).then(res => {
uni.setStorageSync("openid", res.openid);
})
}
})
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
globalData: {
AppName: "MyEdu",
Version: "1.0",
user_protocol: "",
user_private_protocol: "",
aboutus: "",
player_cover: ""
}
}
</script>
<style>
/*每个页面公共css */
/* @import '../../assets/fonts/iconfont.wxss'; */
@import url("@/static/assets/fonts/iconfont.css");
/* #ifdef MP-WEIXIN */
view,
page,
navigator,
button,
swiper,
swiper-item {
padding: 0;
margin: 0;
box-sizing: border-box;
}
page {
background-color: #f2f2f2;
}
/* #endif */
*{
padding:0;
margin:0;
box-sizing: border-box;
}
</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。