<script>
|
import config from './config'
|
import store from '@/store'
|
import { getToken } from '@/utils/auth'
|
|
export default {
|
onLaunch: function() {
|
this.initApp()
|
},
|
methods: {
|
// 初始化应用
|
initApp() {
|
// 初始化应用配置
|
this.initConfig()
|
// 检查用户登录状态
|
//#ifdef H5
|
// this.checkLogin()
|
//#endif
|
},
|
initConfig() {
|
this.globalData.config = config
|
},
|
checkLogin() {
|
if (!getToken()) {
|
this.$tab.reLaunch('/pages/login')
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
@import '@/static/scss/index.scss';
|
@import "@/uni_modules/uview-ui/index.scss";
|
/* uni-app中的条件判断语句 */
|
/* #ifdef APP-PLUS || H5 */
|
uni-swiper .uni-swiper-dot {
|
width: 10rpx;
|
height: 4rpx;
|
}
|
uni-swiper .uni-swiper-dot-active {
|
width: 40rpx;
|
border-radius: 6rpx;
|
}
|
/* #endif */
|
|
/* #ifdef MP-WEIXIN */
|
wx-swiper .wx-swiper-dot {
|
width: 18rpx;
|
height: 4rpx;
|
border-radius: 1rpx;
|
position: relative;
|
top: 20rpx;
|
}
|
|
wx-swiper .wx-swiper-dot-active {
|
width: 18rpx;
|
height: 4rpx;
|
border-radius: 1rpx;
|
position: relative;
|
top: 20rpx;
|
}
|
wx-swiper {
|
height: 340rpx; /* 微信小程序使用 rpx */
|
}
|
/* #endif */
|
</style>
|