You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
737 B

3 weeks ago
<script setup>
import config from './config';
import { getToken } from '@/utils/auth';
import { useConfigStore } from '@/store';
import { getCurrentInstance } from 'vue';
import { onLaunch } from '@dcloudio/uni-app';
3 weeks ago
const { proxy } = getCurrentInstance();
3 weeks ago
onLaunch(() => {
initApp();
});
3 weeks ago
// 初始化应用
function initApp() {
// 初始化应用配置
initConfig();
// 检查用户登录状态
//#ifdef H5
checkLogin();
//#endif
}
3 weeks ago
function initConfig() {
useConfigStore().setConfig(config);
}
3 weeks ago
function checkLogin() {
if (!getToken()) {
proxy.$tab.reLaunch('/pages/login');
}
}
3 weeks ago
</script>
<style lang="scss">
@import '@/static/scss/index.scss';
@import 'leaflet/dist/leaflet.css';
@import 'mars2d/mars2d.css';
3 weeks ago
</style>