解决项目第一次进去默认需要登录而不是去往主程序首页问题
This commit is contained in:
parent
ab511f863e
commit
32556723bb
@ -48,11 +48,14 @@ router.beforeEach(async (to, from, next) => {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next();
|
||||
} else {
|
||||
next(`/login?redirect=${to.path}`);
|
||||
}
|
||||
|
||||
next();
|
||||
|
||||
// if (whiteList.indexOf(to.path) !== -1) {
|
||||
// next();
|
||||
// } else {
|
||||
// next(`/login?redirect=${to.path}`);
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -42,14 +42,17 @@ router.beforeEach(async (to, from, next) => {
|
||||
} else {
|
||||
NProgress.done();
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next();
|
||||
// next();
|
||||
window.location.href = `/login?redirect=${encodeURIComponent(to.fullPath)}`;
|
||||
} else {
|
||||
if (qiankunWindow.__POWERED_BY_QIANKUN__) {
|
||||
window.location.href = VITE_APP_MIAN_URL;
|
||||
return;
|
||||
}
|
||||
next(`/login?redirect=${to.path}`);
|
||||
// if (qiankunWindow.__POWERED_BY_QIANKUN__) {
|
||||
// window.location.href = VITE_APP_MIAN_URL;
|
||||
// return;
|
||||
// }
|
||||
// next(`/login?redirect=${to.path}`);
|
||||
window.location.href = `/login?redirect=${encodeURIComponent(to.fullPath)}`;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
<el-badge :hidden="goodNum < 1" :value="goodNum" :max="99" class="item" :offset="[-3, 10]">
|
||||
<div style="display: flex" @click="toCart">
|
||||
<div class="iconfont icon-shopcar" style="font-size: 14px; margin: 0 5px; color: #25bf82; font-weight: bold"></div>
|
||||
<div>购物车</div>
|
||||
<div>采购车</div>
|
||||
</div>
|
||||
</el-badge>
|
||||
<el-badge :hidden="true" :value="0" :max="99" class="item" :offset="[-3, 10]">
|
||||
|
@ -48,7 +48,8 @@ router.beforeEach(async (to, from, next) => {
|
||||
}
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next();
|
||||
// next();
|
||||
window.location.href = `/login?redirect=${encodeURIComponent(to.fullPath)}`;
|
||||
} else {
|
||||
next(`/login?redirect=${to.path}`);
|
||||
}
|
||||
|
@ -26,6 +26,34 @@
|
||||
</div>
|
||||
<div class="tips-list">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="24">
|
||||
<div style="display: flex; justify-content: flex-start">
|
||||
<div>价 格:</div>
|
||||
<div style="display: flex; justify-content: flex-start">
|
||||
<div style="margin-right: 16px">
|
||||
<p style="width: 100%; line-height: 20px">
|
||||
<span>¥</span>
|
||||
<span style="font-size: 24px; font-weight: bold">{{ currentGood.priceRange?.[0] }}</span>
|
||||
</p>
|
||||
<p style="width: 100%; line-height: 20px; font-size: 12px; color: #ccc">{{ currentGood.numberRange?.[0] }}</p>
|
||||
</div>
|
||||
<div style="margin-right: 16px">
|
||||
<p style="width: 100%; line-height: 20px">
|
||||
<span>¥</span>
|
||||
<span style="font-size: 24px; font-weight: bold">{{ currentGood.priceRange?.[1] }}</span>
|
||||
</p>
|
||||
<p style="width: 100%; line-height: 20px; font-size: 12px; color: #ccc">{{ currentGood.numberRange?.[1] }}</p>
|
||||
</div>
|
||||
<div style="margin-right: 16px">
|
||||
<p style="width: 100%; line-height: 20px">
|
||||
<span>¥</span>
|
||||
<span style="font-size: 24px; font-weight: bold">{{ currentGood.priceRange?.[2] }}</span>
|
||||
</p>
|
||||
<p style="width: 100%; line-height: 20px; font-size: 12px; color: #ccc">{{ currentGood.numberRange?.[2] }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="24">发货地址:{{ currentGood.detailAddress }}</el-col>
|
||||
<el-col :span="24"
|
||||
>保 障:{{
|
||||
@ -35,7 +63,7 @@
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="spu-sku-list">
|
||||
<div class="spu-title">规格:</div>
|
||||
<div class="spu-title">规 格:</div>
|
||||
<div class="spu-sku-warp">
|
||||
<div
|
||||
v-for="(item, index) in currentGood.netWeight"
|
||||
@ -58,10 +86,10 @@
|
||||
</div>
|
||||
<div class="top-btn">
|
||||
<div class="item-btn sign" @click="buyGood">
|
||||
<span>立即购买</span>
|
||||
<span>立即订购</span>
|
||||
</div>
|
||||
<div class="item-btn reservation" @click="addGoodToCart">
|
||||
<span>加入购物车</span>
|
||||
<span>加采购车</span>
|
||||
</div>
|
||||
<div class="contact" @click="showPhone = true">
|
||||
<div><img :src="getAssetsFile('images/ecommerce/contact.png')" alt="" width="15" /></div>
|
||||
|
@ -8,9 +8,9 @@
|
||||
<div class="goods-name txt-ellipsis clamp2">{{ data.goodName }}</div>
|
||||
<div class="goods-do">
|
||||
<div class="price txt-ellipsis clamp">{{ data.goodPrice }}</div>
|
||||
<div class="do" @click.stop="openDialog(data)">
|
||||
<!-- <div class="do" @click.stop="openDialog(data)">
|
||||
<div class="iconfont icon-cart"></div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="centerDialogVisible" title="Warning" width="80%" align-center :show-close="false" style="border-radius: 16px">
|
||||
|
Loading…
x
Reference in New Issue
Block a user