feat: 未登录时,跳转到单独的登录页
This commit is contained in:
@@ -62,7 +62,15 @@
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
||||
<button v-if="!isLogin" class="ss-reset-button type-btn" @tap="showAuthModal('accountLogin')">
|
||||
<button
|
||||
v-if="!isLogin"
|
||||
class="ss-reset-button type-btn"
|
||||
@tap="
|
||||
() => {
|
||||
sheep.$router.go('/pages/login/index', {}, { redirect: true });
|
||||
}
|
||||
"
|
||||
>
|
||||
返回登录
|
||||
</button>
|
||||
</view>
|
||||
@@ -110,7 +118,7 @@
|
||||
return;
|
||||
}
|
||||
// 成功后,用户重新登录
|
||||
showAuthModal('accountLogin')
|
||||
sheep.$router.go('/pages/login/index', {}, { redirect: true });
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
<view>
|
||||
<su-popup :show="state.showShareGuide" :showClose="false" @close="onCloseGuide" />
|
||||
<view v-if="state.showShareGuide" class="guide-wrap">
|
||||
<image class="guide-image" :src="sheep.$url.static('/static/img/shop/share/share_guide.png')" />
|
||||
<image
|
||||
class="guide-image"
|
||||
:src="sheep.$url.static('/static/img/shop/share/share_guide.png')"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<su-popup :show="show" round="10" :showClose="false" @close="closeShareModal">
|
||||
@@ -17,7 +20,11 @@
|
||||
open-type="share"
|
||||
@tap="onShareByForward"
|
||||
>
|
||||
<image class="share-img" :src="sheep.$url.static('/static/img/shop/share/share_wx.png')" mode="" />
|
||||
<image
|
||||
class="share-img"
|
||||
:src="sheep.$url.static('/static/img/shop/share/share_wx.png')"
|
||||
mode=""
|
||||
/>
|
||||
<text class="share-title">微信好友</text>
|
||||
</button>
|
||||
|
||||
@@ -41,7 +48,11 @@
|
||||
class="share-item share-btn ss-flex-col ss-col-center"
|
||||
@tap="onShareByCopyLink"
|
||||
>
|
||||
<image class="share-img" :src="sheep.$url.static('/static/img/shop/share/share_link.png')" mode="" />
|
||||
<image
|
||||
class="share-img"
|
||||
:src="sheep.$url.static('/static/img/shop/share/share_link.png')"
|
||||
mode=""
|
||||
/>
|
||||
<text class="share-title">复制链接</text>
|
||||
</button>
|
||||
</view>
|
||||
@@ -89,7 +100,8 @@
|
||||
const onShareByPoster = () => {
|
||||
closeShareModal();
|
||||
if (!sheep.$store('user').isLogin) {
|
||||
showAuthModal();
|
||||
// showAuthModal();
|
||||
sheep.$router.go('/pages/login/index', {}, { redirect: true });
|
||||
return;
|
||||
}
|
||||
unref(SharePosterRef).getPoster();
|
||||
|
||||
@@ -12,7 +12,7 @@ if (process.env.NODE_ENV === 'development') {
|
||||
if (typeof baseUrl === 'undefined') {
|
||||
console.error('请检查.env配置文件是否存在');
|
||||
} else {
|
||||
console.log(`[芋道商城 ${version}] https://doc.iocoder.cn`);
|
||||
|
||||
}
|
||||
|
||||
export const apiPath = import.meta.env.SHOPRO_API_PATH;
|
||||
|
||||
@@ -10,6 +10,7 @@ import $platform from '@/sheep/platform';
|
||||
import { showAuthModal } from '@/sheep/hooks/useModal';
|
||||
import AuthUtil from '@/sheep/api/member/auth';
|
||||
import { getTerminal } from '@/sheep/helper/const';
|
||||
import sheep from '@/sheep';
|
||||
|
||||
const options = {
|
||||
// 显示操作成功消息 默认不显示
|
||||
@@ -73,7 +74,8 @@ http.interceptors.request.use(
|
||||
(config) => {
|
||||
// 自定义处理【auth 授权】:必须登录的接口,则跳出 AuthModal 登录弹窗
|
||||
if (config.custom.auth && !$store('user').isLogin) {
|
||||
showAuthModal();
|
||||
// showAuthModal();
|
||||
sheep.$router.go('/pages/login/index', {}, { redirect: true });
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
@@ -280,7 +282,7 @@ const refreshToken = async (config) => {
|
||||
const handleAuthorized = () => {
|
||||
const userStore = $store('user');
|
||||
userStore.logout(true);
|
||||
showAuthModal();
|
||||
sheep.$router.go('/pages/login/index', {}, { redirect: true });
|
||||
// 登录超时
|
||||
return Promise.reject({
|
||||
code: 401,
|
||||
|
||||
@@ -59,7 +59,8 @@ const _go = (
|
||||
|
||||
// 页面登录拦截
|
||||
if (nextRoute.meta?.auth && !$store('user').isLogin) {
|
||||
showAuthModal();
|
||||
// showAuthModal();
|
||||
sheep.$router.go('/pages/login/index', {}, { redirect: true });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ const app = defineStore({
|
||||
// TODO 芋艿:【初始化优化】未来支持管理后台可配;对应 https://api.shopro.sheepjs.com/shop/api/init
|
||||
if (true) {
|
||||
this.info = {
|
||||
name: '芋道商城',
|
||||
name: '商城',
|
||||
logo: 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png',
|
||||
version: '2025.09',
|
||||
copyright: '全部开源,个人与企业可 100% 免费使用',
|
||||
|
||||
Reference in New Issue
Block a user