From 7083c8d27e788854bea5ef6ba35c6a6548132b7f Mon Sep 17 00:00:00 2001 From: chenhao Date: Tue, 21 Jul 2026 16:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=8F=90=E7=8E=B0=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E3=80=81abort=20=E8=AF=B7=E6=B1=82=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E5=BC=B9=20toast=E3=80=81=E5=85=B6=E4=BB=96=E5=B0=8F=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 恢复 Cashout/CashoutRecord/CashoutAccount 路由及 My/Balance 提现入口,去掉 VIP 校验 - 请求被 abort 时保持 pending,不再触发 caller 的 catch 弹 toast - App.vue 未登录不请求微信分享配置 - ResetPwd 手机号校验改用 cellphone 字段并统一 showFailToast - Team 页 active=1 走 referrer 单条数据分支 - 忽略 AGENTS.md Co-Authored-By: Claude Opus 4.6 --- .gitignore | 1 + src/App.vue | 7 ++-- src/api/http.js | 2 +- src/router.js | 44 +++++++++++------------ src/styles/ch.less | 2 +- src/views/Account/ResetPwd.vue | 10 ++---- src/views/User/My.vue | 2 +- src/views/User/Team.vue | 4 +-- src/views/User/Wallet/Balance.vue | 16 ++++----- src/views/User/Wallet/Cashout/Cashout.vue | 6 ---- 10 files changed, 41 insertions(+), 53 deletions(-) diff --git a/.gitignore b/.gitignore index b2d1342..b824ff1 100644 --- a/.gitignore +++ b/.gitignore @@ -455,3 +455,4 @@ dist-ssr .vite claude.md +AGENTS.md diff --git a/src/App.vue b/src/App.vue index 9e1fb48..99deee3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -70,9 +70,10 @@ export default { }, init() { // 持久请求,避免被路由切换时的 abortAll() 取消 - this.$get('/v1/client/HWxinfoClient/share', undefined, undefined, undefined, true).then(res => { - this.wechatShareInfo = res.data || {} - }) + if (this.$isLogin()) + this.$get('/v1/client/HWxinfoClient/share', undefined, undefined, undefined, true).then(res => { + this.wechatShareInfo = res.data || {} + }) }, updateShare(title, desc, imgUrl) { if (wx && this.$isWechat()) { diff --git a/src/api/http.js b/src/api/http.js index a0134aa..96103de 100644 --- a/src/api/http.js +++ b/src/api/http.js @@ -174,7 +174,7 @@ function fetchWithTimeout(url, options, timeout = DEFAULT_TIMEOUT, persistent = .catch(err => { clearTimeout(timer); if (err.name === 'AbortError') { - reject({ status: 0, message: '请求已取消', data: null, aborted: true }); + // ponytail: 请求取消后保持 pending,让 catch 不触发(避免路由切换时集体弹 toast) return; } reject({ status: 0, message: '网络连接失败', data: null }); diff --git a/src/router.js b/src/router.js index b1d1d59..c1bd39a 100644 --- a/src/router.js +++ b/src/router.js @@ -89,28 +89,28 @@ const routes = [ component: () => import('./views/User/Team.vue'), meta: { title: '我的好友' } }, - // { - // path: '/Cashout', - // name: 'Cashout', - // component: () => import('./views/User/Wallet/Cashout/Cashout.vue'), - // meta: { - // title: '提现', - // } - // }, - // { - // path: '/CashoutRecord', - // name: 'CashoutRecord', - // component: () => import('./views/User/Wallet/Cashout/CashoutRecord.vue'), - // meta: { - // title: '提现记录', - // } - // }, - // { - // path: '/CashoutAccount', - // name: 'CashoutAccount', - // component: () => import('./views/User/Wallet/Cashout/CashoutAccount.vue'), - // meta: { title: '提现账号' } - // }, + { + path: '/Cashout', + name: 'Cashout', + component: () => import('./views/User/Wallet/Cashout/Cashout.vue'), + meta: { + title: '提现', + } + }, + { + path: '/CashoutRecord', + name: 'CashoutRecord', + component: () => import('./views/User/Wallet/Cashout/CashoutRecord.vue'), + meta: { + title: '提现记录', + } + }, + { + path: '/CashoutAccount', + name: 'CashoutAccount', + component: () => import('./views/User/Wallet/Cashout/CashoutAccount.vue'), + meta: { title: '提现账号' } + }, { path: '/Category', diff --git a/src/styles/ch.less b/src/styles/ch.less index 69bf742..e6d1116 100644 --- a/src/styles/ch.less +++ b/src/styles/ch.less @@ -1214,7 +1214,7 @@ .mall_page__goods { .box; .box-tb; - margin-bottom: 5vw; + // margin-bottom: 5vw; .van-tabs { font-size: 3.87vw; diff --git a/src/views/Account/ResetPwd.vue b/src/views/Account/ResetPwd.vue index bba5786..2980739 100644 --- a/src/views/Account/ResetPwd.vue +++ b/src/views/Account/ResetPwd.vue @@ -125,14 +125,8 @@ export default { }, sendCode() { if (this.isSend) return; - if ( - !this.data.Phone || - !/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.data.Phone) - ) { - this.$showToast({ - type: "fail", - message: "手机格式不正确,请检查手机号", - }); + if (!/^1[3-9]\d{9}$/.test(this.data.cellphone)) { + this.$showFailToast('手机格式不正确,请检查手机号'); return; } this.$post('/v1/client/AuthClient/sendcode', { diff --git a/src/views/User/My.vue b/src/views/User/My.vue index 9af8d81..7d7076c 100644 --- a/src/views/User/My.vue +++ b/src/views/User/My.vue @@ -228,7 +228,7 @@ export default { isSendCode: false, sendCodeTime: 0, FollowQRCode: '', - hide: true, + hide: false, } }, methods: { diff --git a/src/views/User/Team.vue b/src/views/User/Team.vue index dd1d426..6d5d956 100644 --- a/src/views/User/Team.vue +++ b/src/views/User/Team.vue @@ -127,7 +127,7 @@ export default { this.$refs.baseList.refresh() }, parseData(res) { - if (this.active === 2) { + if (this.active === 1) { return res.data ? [res.data] : [] } else { return res.data.items || [] @@ -145,8 +145,6 @@ export default { listUrl() { if (this.active === 0) { return '/v1/client/DUsersClient/friend' - } else if (this.active === 1) { - return '/v1/client/DUsersClient/shop' } else { return '/v1/client/DUsersClient/referrer' } diff --git a/src/views/User/Wallet/Balance.vue b/src/views/User/Wallet/Balance.vue index 15a0aca..0b78b5b 100644 --- a/src/views/User/Wallet/Balance.vue +++ b/src/views/User/Wallet/Balance.vue @@ -160,7 +160,7 @@ export default { showTerm: false, list: [], isVIP: '', - hide: true, + hide: false, } }, methods: { @@ -179,13 +179,13 @@ export default { // }) }, toCashout() { - if (this.isVIP === '会员') { - this.$showFailToast('您还未购买礼包产品成为VIP,暂不能提现!') - setTimeout(() => { - // this.$navigate('/My') - }, 1500); - return - } + // if (this.isVIP === '会员') { + // this.$showFailToast('您还未购买礼包产品成为VIP,暂不能提现!') + // setTimeout(() => { + // // this.$navigate('/My') + // }, 1500); + // return + // } this.$navigate('Cashout'); }, onconfirm(value) { diff --git a/src/views/User/Wallet/Cashout/Cashout.vue b/src/views/User/Wallet/Cashout/Cashout.vue index 7f1f80e..8038a58 100644 --- a/src/views/User/Wallet/Cashout/Cashout.vue +++ b/src/views/User/Wallet/Cashout/Cashout.vue @@ -88,12 +88,6 @@ export default { Promise.all([ this.$get('/v1/client/DUsersClient').then(data => { this.wallet.Balance = data.data.zijin; - // if (data.data.userlevelname === '会员') { - // this.$showFailToast('您还未购买礼包产品成为VIP,暂不能提现!') - // setTimeout(() => { - // this.$navigate('/My') - // }, 1500); - // } }).catch(err => { this.$showFailToast(err.message); }),