处理未登录情况

This commit is contained in:
2024-03-31 19:10:00 +08:00
parent a06d74934f
commit 935d56227d
8 changed files with 78 additions and 48 deletions

View File

@@ -3,14 +3,14 @@
<view class='member-info-view'>
<image :src='assetsUrl("ic_crown.png")' />
<view class='flex flex-col'>
<text>{{ userInfo.levelName}}</text>
<text>{{ userInfo?.levelName }}</text>
<view />
</view>
</view>
<view class='qrcode-card'>
<view class='balance-view'>
<text class='balance-text'>账户余额{{ userInfo.balance || 0 }}</text>
<text class='balance-text'>账户余额{{ userInfo?.balance || 0 }}</text>
<view class='btn-recharge' @click.stop='goPath("/pages/mine/subs/recharge/index")'>
<text>去充值</text>
<image :src='assetsUrl("ic_arrow_right.png")' />
@@ -33,8 +33,8 @@
<text>卡信息</text>
</view>
<text>店铺名称{{userInfo.creatorName}}</text>
<text>{{ userInfo.storeId }}</text>
<text>店铺名称{{ userInfo?.creatorName }}</text>
<text>{{ userInfo?.storeId }}</text>
</view>
</view>
@@ -47,8 +47,7 @@ import { assetsUrl } from '@/utils/assets';
import { generateBarCode, generateQrCode } from '@/api/common';
import { getDynamicCode } from '@/api/user';
import { useUserStore } from '@/store';
import { goPath } from '@/utils';
import { use } from 'licia';
import { goLogin, goPath, isLogin } from '@/utils';
const store = useUserStore();
const { userInfo } = storeToRefs(store);
@@ -58,6 +57,10 @@ const codeContent = ref<string>('');
const codeRefreshInterval = ref(30);
onLoad(() => {
if(!isLogin()) {
goLogin();
return;
}
generateCode();
setInterval(() => {