dl_uniapp/App.vue

36 lines
605 B
Vue
Raw Normal View History

2025-03-18 17:41:45 +08:00
<script>
2025-03-21 17:57:53 +08:00
import config from './config'
import store from '@/store'
import {
getToken
} from '@/utils/auth'
2025-03-18 17:41:45 +08:00
2025-03-21 17:57:53 +08:00
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')
}
}
}
}
2025-03-18 17:41:45 +08:00
</script>
<style lang="scss">
2025-04-02 15:17:19 +08:00
@import '@/static/scss/index.scss';
2025-03-21 17:57:53 +08:00
</style>