From 03157b6c4350c1c931d977dce39df42a382e141e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98=E2=80=98?= Date: Sun, 30 Apr 2023 20:38:14 +0800 Subject: [PATCH] =?UTF-8?q?feature-tiktok-1.0:=E8=A7=A3=E5=86=B3=E7=BB=98?= =?UTF-8?q?=E7=94=BB=E5=85=91=E6=8D=A2=E6=AC=A1=E6=95=B0BUG=EF=BC=9B?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E7=BB=98=E7=94=BB=E9=A1=B5=E9=9D=A2=E4=B8=8D?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=99=BB=E5=BD=95=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/ai/paint/paint.vue | 34 ++++++++++++++--------------- pages/atlas/hotSearch.vue | 2 +- pages/userInfo/userInfo.vue | 43 ++++++++++++++++++++----------------- utils/request.js | 3 +++ 4 files changed, 44 insertions(+), 38 deletions(-) diff --git a/pages/ai/paint/paint.vue b/pages/ai/paint/paint.vue index a435993..88f99e9 100644 --- a/pages/ai/paint/paint.vue +++ b/pages/ai/paint/paint.vue @@ -165,23 +165,23 @@ let token = uni.getStorageSync('token'); if((Object.keys(that.userInfo).length==0) && (Object.keys(token).length==0)){ console.error('尚未登录!'); - // uni.showModal({ - // title:'提示', - // content:'您还没有登录!点击确定跳转登录界面以体验服务', - // success(res) { - // if (res.confirm) { - // //跳转登录界面 - // uni.switchTab({ - // url: '/pages/userInfo/userInfo' - // }); - // }else if(res.cancel){ - // uni.showToast({ - // title:'登录获取更好的服务体验哟!', - // duration: 2000 - // }); - // } - // } - // }); + uni.showModal({ + title:'提示', + content:'您还没有登录!点击确定跳转登录界面以体验服务', + success(res) { + if (res.confirm) { + //跳转登录界面 + uni.switchTab({ + url: '/pages/userInfo/userInfo' + }); + }else if(res.cancel){ + uni.showToast({ + title:'登录获取更好的服务体验哟!', + duration: 2000 + }); + } + } + }); } }, //传递参数到下个界面开始绘图 diff --git a/pages/atlas/hotSearch.vue b/pages/atlas/hotSearch.vue index 26dbcbb..d9934ea 100644 --- a/pages/atlas/hotSearch.vue +++ b/pages/atlas/hotSearch.vue @@ -164,7 +164,7 @@ }else{ uni.showModal({ title: '提示', - content: '这是一个模态弹窗!', + content: '抱歉没有找到想要的图片。不如试试意境绘画!', success(res){ if(res.confirm){ uni.switchTab({ diff --git a/pages/userInfo/userInfo.vue b/pages/userInfo/userInfo.vue index d86e8ff..ab76fe1 100644 --- a/pages/userInfo/userInfo.vue +++ b/pages/userInfo/userInfo.vue @@ -223,27 +223,30 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons placeholderText:'请输入兑换cdk', success(response) { console.log('response',response); - //调用使用cdk方法 - const data = { - cdk: response.content, - userId: that.userInfo.id, - source: '1', - appType: '0' - } - useCdk(data).then(res =>{ - console.log('res',res); - if(res.data.code != 200){ - uni.showToast({ - title: res.data.msg, - icon: 'none' - }) - }else{ - uni.showToast({ - title: '兑换成功!', - icon: 'none' - }) + if(response.confirm){ + //点击确定 + //调用使用cdk方法 + const data = { + cdk: response.content, + userId: that.userInfo.id, + source: '1', + appType: '0' } - }) + useCdk(data).then(res =>{ + console.log('res',res); + if(res.data.code != 200){ + uni.showToast({ + title: res.data.msg, + icon: 'none' + }) + }else{ + uni.showToast({ + title: '兑换成功!', + icon: 'none' + }) + } + }); + } }, fail(res) { uni.showToast({ diff --git a/utils/request.js b/utils/request.js index 1f7f2a0..a1bacd4 100644 --- a/utils/request.js +++ b/utils/request.js @@ -146,6 +146,9 @@ service.interceptors.response.use(res => { content:'您还没有登录!点击确定跳转登录界面以体验服务', success(res) { if (res.confirm) { + //清理缓存,解决一进入页面未登录但有头像的情况 + uni.clearStorage(); + uni.clearStorageSync(); //跳转登录界面 uni.switchTab({ url: '/pages/userInfo/userInfo'