Browse Source

feature-tiktok-1.0:解决绘画兑换次数BUG;进入绘画页面不提示登录的BUG

feature-1.0
‘‘ 3 years ago
parent
commit
03157b6c43
  1. 34
      pages/ai/paint/paint.vue
  2. 2
      pages/atlas/hotSearch.vue
  3. 5
      pages/userInfo/userInfo.vue
  4. 3
      utils/request.js

34
pages/ai/paint/paint.vue

@ -165,23 +165,23 @@
let token = uni.getStorageSync('token'); let token = uni.getStorageSync('token');
if((Object.keys(that.userInfo).length==0) && (Object.keys(token).length==0)){ if((Object.keys(that.userInfo).length==0) && (Object.keys(token).length==0)){
console.error('尚未登录!'); console.error('尚未登录!');
// uni.showModal({ uni.showModal({
// title:'', title:'提示',
// content:'!', content:'您还没有登录!点击确定跳转登录界面以体验服务',
// success(res) { success(res) {
// if (res.confirm) { if (res.confirm) {
// // //
// uni.switchTab({ uni.switchTab({
// url: '/pages/userInfo/userInfo' url: '/pages/userInfo/userInfo'
// }); });
// }else if(res.cancel){ }else if(res.cancel){
// uni.showToast({ uni.showToast({
// title:'!', title:'登录获取更好的服务体验哟!',
// duration: 2000 duration: 2000
// }); });
// } }
// } }
// }); });
} }
}, },
// //

2
pages/atlas/hotSearch.vue

@ -164,7 +164,7 @@
}else{ }else{
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '这是一个模态弹窗!', content: '抱歉没有找到想要的图片。不如试试意境绘画!',
success(res){ success(res){
if(res.confirm){ if(res.confirm){
uni.switchTab({ uni.switchTab({

5
pages/userInfo/userInfo.vue

@ -223,6 +223,8 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
placeholderText:'请输入兑换cdk', placeholderText:'请输入兑换cdk',
success(response) { success(response) {
console.log('response',response); console.log('response',response);
if(response.confirm){
//
//使cdk //使cdk
const data = { const data = {
cdk: response.content, cdk: response.content,
@ -243,7 +245,8 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
icon: 'none' icon: 'none'
}) })
} }
}) });
}
}, },
fail(res) { fail(res) {
uni.showToast({ uni.showToast({

3
utils/request.js

@ -146,6 +146,9 @@ service.interceptors.response.use(res => {
content:'您还没有登录!点击确定跳转登录界面以体验服务', content:'您还没有登录!点击确定跳转登录界面以体验服务',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
//清理缓存,解决一进入页面未登录但有头像的情况
uni.clearStorage();
uni.clearStorageSync();
//跳转登录界面 //跳转登录界面
uni.switchTab({ uni.switchTab({
url: '/pages/userInfo/userInfo' url: '/pages/userInfo/userInfo'

Loading…
Cancel
Save