处理未登录情况
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
<script setup lang='ts'>
|
||||
import SkuDialog from '@/components/sku-dialog.vue';
|
||||
import { assetsUrl } from '@/utils/assets';
|
||||
import { goPath } from '@/utils';
|
||||
import { goLogin, goPath, isLogin } from '@/utils';
|
||||
import { getCategoryList, getGoodsList } from '@/api/goods';
|
||||
import { CategoryBean, GoodsBean } from '@/api/goods/types';
|
||||
import useShoppingCartStore from '@/store/modules/shoppingcart';
|
||||
@@ -54,6 +54,11 @@ const categorySelectedIndex = ref<number>(0);
|
||||
const goodsList = ref<GoodsBean[]>([]);
|
||||
|
||||
onLoad(() => {
|
||||
if(!isLogin()) {
|
||||
goLogin();
|
||||
return;
|
||||
}
|
||||
|
||||
fetchCategoryList();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user