2024-09-14 17:14:33 +08:00
|
|
|
|
<script>
|
2024-09-14 17:24:03 +08:00
|
|
|
|
import config from './config';
|
|
|
|
|
|
import store from '@/store';
|
|
|
|
|
|
import { getToken } from '@/utils/auth';
|
2024-09-14 17:14:33 +08:00
|
|
|
|
|
2024-09-14 17:24:03 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
onLaunch: function () {
|
|
|
|
|
|
this.initApp();
|
|
|
|
|
|
},
|
2025-05-05 12:22:33 +08:00
|
|
|
|
onUnload() {
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
},
|
2024-09-14 17:24:03 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
// 初始化应用
|
|
|
|
|
|
initApp() {
|
|
|
|
|
|
// 初始化应用配置
|
|
|
|
|
|
this.initConfig();
|
2024-09-18 17:39:34 +08:00
|
|
|
|
// 检查用户登录状态(H5 debug跳过)
|
2024-09-14 17:24:03 +08:00
|
|
|
|
//#ifdef H5
|
|
|
|
|
|
this.checkLogin();
|
|
|
|
|
|
//#endif
|
|
|
|
|
|
},
|
2025-05-05 12:22:33 +08:00
|
|
|
|
|
2024-09-14 17:24:03 +08:00
|
|
|
|
initConfig() {
|
|
|
|
|
|
this.globalData.config = config;
|
|
|
|
|
|
},
|
|
|
|
|
|
checkLogin() {
|
|
|
|
|
|
if (!getToken()) {
|
|
|
|
|
|
this.$tab.reLaunch('/pages/login');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2024-09-14 17:14:33 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
2025-05-05 12:22:33 +08:00
|
|
|
|
|
2024-09-14 17:14:33 +08:00
|
|
|
|
<style lang="scss">
|
2024-09-14 17:24:03 +08:00
|
|
|
|
@import '@/static/scss/index.scss';
|
2024-09-18 17:39:34 +08:00
|
|
|
|
.border {
|
|
|
|
|
|
border: 1px solid #000000;
|
|
|
|
|
|
}
|
2024-09-20 15:13:18 +08:00
|
|
|
|
.bottom-box {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
padding: 10px;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
}
|
2024-09-14 17:14:33 +08:00
|
|
|
|
</style>
|