ruoyi-app/App.vue

33 lines
678 B
Vue
Raw Normal View History

2022-08-01 00:14:57 +00:00
<script>
import config from './config'
import store from '@/store'
import { getToken } from '@/utils/auth'
export default {
onLaunch: function() {
this.initApp()
},
methods: {
// 初始化应用
initApp() {
// 初始化应用配置
this.initConfig()
// 检查用户登录状态
this.checkLogin()
},
initConfig() {
this.globalData.config = config
},
checkLogin() {
if (!getToken()) {
uni.reLaunch({ url: '/pages/login' })
}
}
}
}
</script>
<style lang="scss">
@import '@/static/scss/index.scss'
</style>