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'