diff --git a/pages-shop/shop/detail.vue b/pages-shop/shop/detail.vue index d137ac6..11f96c9 100644 --- a/pages-shop/shop/detail.vue +++ b/pages-shop/shop/detail.vue @@ -121,9 +121,10 @@ async function onRedeem() { const token = uni.getStorageSync('token') if (!token) { uni.showModal({ - title: '提示', - content: '请先登录', + title: '温馨提示', + content: '兑换商品需要先登录哦', confirmText: '去登录', + cancelText: '暂不登录', success: (res) => { if (res.confirm) uni.navigateTo({ url: '/pages/login/index' }) } }) return diff --git a/pages/shop/index.vue b/pages/shop/index.vue index bd8ddb4..ab979b8 100644 --- a/pages/shop/index.vue +++ b/pages/shop/index.vue @@ -436,9 +436,10 @@ async function onRedeemTap(item) { const token = uni.getStorageSync('token') if (!token) { uni.showModal({ - title: '提示', - content: '请先登录', + title: '温馨提示', + content: '兑换商品需要先登录哦', confirmText: '去登录', + cancelText: '暂不登录', success: (res) => { if (res.confirm) uni.navigateTo({ url: '/pages/login/index' }) } }) return diff --git a/utils/request.js b/utils/request.js index 39b7254..c130501 100644 --- a/utils/request.js +++ b/utils/request.js @@ -9,8 +9,12 @@ function handleAuthExpired() { uni.showModal({ title: '提示', content: '账号登录已过期,请重新登录', - showCancel: false, - success: () => { + showCancel: true, + success: (res) => { + if (res.cancel) { + console.log('用户点击取消'); + return + } authModalShown = false uni.navigateTo({ url: '/pages/login/index' }) }