update vue3

master
RuoYi 8 months ago
parent 03e023cbc4
commit 0ecc627938

@ -1,30 +1,33 @@
<script> <script setup>
import { onLaunch } from '@dcloudio/uni-app'
import config from './config' import config from './config'
import store from '@/store' import store from '@/store'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import { getCurrentInstance } from "vue"
const { proxy } = getCurrentInstance()
onLaunch(() => {
initApp()
})
export default {
onLaunch: function() {
this.initApp()
},
methods: {
// //
initApp() { function initApp() {
// //
this.initConfig() initConfig()
// //
//#ifdef H5 //#ifdef H5
this.checkLogin() checkLogin()
//#endif //#endif
},
initConfig() {
this.globalData.config = config
},
checkLogin() {
if (!getToken()) {
this.$tab.reLaunch('/pages/login')
} }
function initConfig() {
getApp().globalData.config = config
} }
function checkLogin() {
if (!getToken()) {
proxy.$tab.reLaunch('/pages/login')
} }
} }
</script> </script>

Loading…
Cancel
Save