flat:AI+
This commit is contained in:
34
App.vue
34
App.vue
@@ -1,20 +1,29 @@
|
||||
<script setup>
|
||||
import useUserStore from './stores/useUserStore';
|
||||
import { reactive, inject } from 'vue';
|
||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
|
||||
const userStore = useUserStore();
|
||||
onLaunch(() => {
|
||||
console.log('App Launch');
|
||||
let openId = uni.getStorageSync('openId') || ''; // 同步获取 缓存信息
|
||||
import useUserStore from './stores/useUserStore';
|
||||
import useDictStore from './stores/useDictStore';
|
||||
const { $api, navTo } = inject('globalFunction');
|
||||
|
||||
onLaunch((options) => {
|
||||
useDictStore().getDictData();
|
||||
uni.onTabBarMidButtonTap(() => {
|
||||
console.log(123);
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login',
|
||||
url: '/pages/chat/chat',
|
||||
});
|
||||
});
|
||||
if (openId) {
|
||||
console.log('有openid');
|
||||
|
||||
let token = uni.getStorageSync('token') || ''; // 同步获取 缓存信息
|
||||
if (token) {
|
||||
useUserStore()
|
||||
.loginSetToken(token)
|
||||
.then(() => {
|
||||
$api.msg('登录成功');
|
||||
});
|
||||
} else {
|
||||
console.log('没有openid');
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login',
|
||||
});
|
||||
}
|
||||
});
|
||||
onShow(() => {
|
||||
@@ -28,4 +37,9 @@ onHide(() => {
|
||||
<style>
|
||||
/*每个页面公共css */
|
||||
@import '@/common/common.css';
|
||||
/* 修改pages tabbar样式 H5有效 */
|
||||
.uni-tabbar .uni-tabbar__item:nth-child(4) .uni-tabbar__bd .uni-tabbar__icon {
|
||||
height: 100% !important;
|
||||
width: 80rpx !important;
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user