兼容vue3模式获取config

master
RuoYi 8 months ago
parent 0ecc627938
commit fd97380edb

@ -1,7 +1,5 @@
<script setup>
import { onLaunch } from '@dcloudio/uni-app'
import config from './config'
import store from '@/store'
import { getToken } from '@/utils/auth'
import { getCurrentInstance } from "vue"
@ -13,18 +11,12 @@
//
function initApp() {
//
initConfig()
//
//#ifdef H5
checkLogin()
//#endif
}
function initConfig() {
getApp().globalData.config = config
}
function checkLogin() {
if (!getToken()) {
proxy.$tab.reLaunch('/pages/login')
@ -32,6 +24,16 @@
}
</script>
<script>
import config from './config'
export default {
onLaunch: function() {
this.globalData.config = config
}
}
</script>
<style lang="scss">
@import '@/static/scss/index.scss'
</style>

Loading…
Cancel
Save