Files
xl-mobile/src/App.vue

38 lines
1.0 KiB
Vue
Raw Normal View History

2025-03-24 15:01:39 +08:00
<script>
2025-03-26 19:10:41 +08:00
import {useUserStore} from "./pinia/UserStore/index.js";
import {toPage} from "./utils/uils.js";
2025-07-24 11:00:48 +08:00
import {useSystemStore} from "./pinia/SystemStore/index.js";
2025-03-26 19:10:41 +08:00
2025-03-24 15:01:39 +08:00
export default {
2025-03-26 19:10:41 +08:00
onLaunch: function () {
},
onShow: function () {
2025-05-07 08:50:01 +08:00
// #ifndef MP-WEIXIN
2025-09-17 21:52:42 +08:00
const ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("micromessenger") !== -1) {
toPage('/pages/notSupported/index');
return;
}
2025-03-26 19:10:41 +08:00
const UserStore = useUserStore();
2025-06-26 20:25:32 +08:00
if (!UserStore.isLogin && window.location.href.indexOf('/pages/register/index') < 0 && window.location.href.indexOf('/pages/fastInput/index') < 0) {
2025-03-26 19:10:41 +08:00
toPage('/pages/login/index');
}
2025-08-25 13:22:50 +08:00
if (UserStore.isLogin) {
const SystemStore = useSystemStore();
SystemStore.getMessageCount();
}
2025-07-28 18:08:42 +08:00
// #endif
2025-03-26 19:10:41 +08:00
},
onHide: function () {
},
2025-03-24 15:01:39 +08:00
}
</script>
<style>
2025-05-07 10:49:08 +08:00
/* #ifdef MP-WEIXIN */
@import "weapp-tailwindcss/css";
@source not "dist";
/* #endif */
2025-03-24 15:01:39 +08:00
</style>