From f45f5ddb06d52b9da2cc027241cb071aa774234d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98=E2=80=98?= Date: Tue, 30 May 2023 09:47:49 +0800 Subject: [PATCH] hotfix:fixbug --- pages/ai/paint/loverPaint.vue | 6 +-- pages/ai/paint/paint.vue | 6 +-- pages/ai/paint/paintDetail.vue | 4 +- pages/atlas/atlas.vue | 4 +- pages/atlas/atlasList.vue | 6 +-- pages/atlas/hotSearch.vue | 8 ++-- pages/creator/creator.vue | 4 +- pages/creator/creatorDetail.vue | 2 +- pages/creator/imgDetail.vue | 39 +++++++------------- pages/index/choiceness.vue | 4 +- pages/index/index.vue | 6 +-- pages/index/indexProto.vue | 8 ++-- pages/userInfo/aiPaint/aiPaint.vue | 2 +- pages/userInfo/goldNum/goldNum.vue | 15 ++------ pages/userInfo/goldNum/goldNumLog.vue | 2 +- pages/userInfo/myCollection/myCollection.vue | 2 +- pages/userInfo/setting/setting.vue | 2 +- pages/userInfo/userInfo.vue | 6 +-- pages/userInfo/vip/vip.vue | 17 +++++---- utils/request.js | 2 +- 20 files changed, 65 insertions(+), 80 deletions(-) diff --git a/pages/ai/paint/loverPaint.vue b/pages/ai/paint/loverPaint.vue index 547f96b..252d716 100644 --- a/pages/ai/paint/loverPaint.vue +++ b/pages/ai/paint/loverPaint.vue @@ -99,7 +99,7 @@ //获取提示词列表 async getPrompt() { const res = await getPrompt("2"); - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.promptList = res.data.data //console.log('this.promptList',this.promptList) }else { @@ -140,7 +140,7 @@ } const res = await checkVip(data); console.log('res===', res); - if (res.data.code === 200) { + if (res && res.data.code === 200) { if(res.data.data.isVip == 1) { that.getDraw() } else { @@ -171,7 +171,7 @@ //获取绘画风格 async getPaintStyleList() { const res = await getPaintStyle(); - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.paintStyle = res.data.data //console.log('this.paintStyle',this.paintStyle) }else { diff --git a/pages/ai/paint/paint.vue b/pages/ai/paint/paint.vue index 5b16667..77998e6 100644 --- a/pages/ai/paint/paint.vue +++ b/pages/ai/paint/paint.vue @@ -260,7 +260,7 @@ let that = this; if (e.detail.value) { checkVip({userId: that.userInfo.id, userClientType: 10}).then(res => { - if (res.data.code === 200) { + if (res && res.data.code === 200) { if (res.data.data.isVip === "1") { that.advancedSetting = e.detail.value; } else { @@ -516,7 +516,7 @@ //获取绘画风格 async getPaintStyleList() { const res = await getPaintStyle(); - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.paintStyle = res.data.data //console.log('this.paintStyle',this.paintStyle) }else { @@ -530,7 +530,7 @@ //获取提示词列表 async getPrompt() { const res = await getPrompt("0"); - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.promptList = res.data.data //console.log('this.promptList',this.promptList) }else { diff --git a/pages/ai/paint/paintDetail.vue b/pages/ai/paint/paintDetail.vue index 50afacd..dc366f2 100644 --- a/pages/ai/paint/paintDetail.vue +++ b/pages/ai/paint/paintDetail.vue @@ -117,7 +117,7 @@ this.styleName = paintData.styleName; this.batchSize = paintData.batchSize; textToImg(paintData).then(res =>{ - if(res.data.code === 200){ + if(res && res.data.code === 200){ uni.hideLoading(); console.log('res',res); this.base64ToPath(res.data.data.images[0]); @@ -191,7 +191,7 @@ } // 用户授权登录 await loginTiktok(params).then(res => { - if (res.data.code === 200) { + if (res && res.data.code === 200) { uni.setStorage({ key: 'userInfo', data: res.data.data.userInfo, diff --git a/pages/atlas/atlas.vue b/pages/atlas/atlas.vue index 72caff2..8a4fd7e 100644 --- a/pages/atlas/atlas.vue +++ b/pages/atlas/atlas.vue @@ -84,7 +84,7 @@ this.arrList = [] this.arrListId = [] const res = await listType() - if (res.data.code === 200) { + if (res && res.data.code === 200) { res.data.data.forEach(item => { this.arrList.push(item.typeName) this.arrListId.push(item.id) @@ -107,7 +107,7 @@ typeId: this.arrListId[val] } const res = await signImgList(params) - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.$nextTick(() => { this.imgList.push(...res.data.rows) }) diff --git a/pages/atlas/atlasList.vue b/pages/atlas/atlasList.vue index d3d4d38..1fc77c9 100644 --- a/pages/atlas/atlasList.vue +++ b/pages/atlas/atlasList.vue @@ -84,7 +84,7 @@ scanCode }) console.log('creatorDetails', res) - if (res.data.code === 200) { + if (res && res.data.code === 200) { uni.setStorage({ key: 'creatorDetail', data: res.data.data, @@ -120,7 +120,7 @@ signId: that.checkId.signId, typeId: that.checkId.typeId }) - if (res.data.code === 200) { + if (res && res.data.code === 200) { that.$refs.waterfallRef.addData(res.data.rows); if(res.data.rows.length < that.pageSize){ //判断接口返回数据量小于请求数据量,则表示此为最后一页 that.isLoadMore = true @@ -146,7 +146,7 @@ signName: that.checkId.signName } const res = await querySignImgBySignName(params) - if (res.data.code === 200) { + if (res && res.data.code === 200) { that.$refs.waterfallRef.addData(res.data.rows); if(res.data.rows.length < that.pageSize){ //判断接口返回数据量小于请求数据量,则表示此为最后一页 that.isLoadMore = true diff --git a/pages/atlas/hotSearch.vue b/pages/atlas/hotSearch.vue index d9934ea..e6883c3 100644 --- a/pages/atlas/hotSearch.vue +++ b/pages/atlas/hotSearch.vue @@ -92,7 +92,7 @@ //保存热搜词 async insertHotKeyword(keyword){ const res = await insertHotKeyword(keyword); - if (res.data.code !== 200) { + if (res && res.data.code !== 200) { uni.showModal({ content: res.data.msg, showCancel: false @@ -103,7 +103,7 @@ //热搜词增加点击次数 async incrementHotKeywordScore(keyword){ const res = await incrementHotKeywordScore(keyword); - if (res.data.code !== 200) { + if (res && res.data.code !== 200) { uni.showModal({ content: res.data.msg, showCancel: false @@ -114,7 +114,7 @@ // 获取热搜词 async getHotKeywordList() { const res = await getHotKeywordList() - if (res.data.code === 200) { + if (res && res.data.code === 200) { for (let i = 0; i < res.data.data.length; i++) { let data = { value: i, @@ -141,7 +141,7 @@ signName: res.value } const response = await querySignImgBySignName(params) - if (response.data.code != 200) { + if (response && response.data.code != 200) { uni.showToast({ title: response.data.msg, icon: 'none', diff --git a/pages/creator/creator.vue b/pages/creator/creator.vue index 939ca62..70c1299 100644 --- a/pages/creator/creator.vue +++ b/pages/creator/creator.vue @@ -144,7 +144,7 @@ async getBanner() { const res = await getBannerList() - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.banner = res.data.data } else { uni.showModal({ @@ -161,7 +161,7 @@ pageNum: that.pageNum, pageSize: that.pageSize }) - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.creatorImgList.push(...res.data.rows) if(res.data.rows.length < that.pageSize){ //判断接口返回数据量小于请求数据量,则表示此为最后一页 that.isLoadMore = true diff --git a/pages/creator/creatorDetail.vue b/pages/creator/creatorDetail.vue index 0dfa50c..95dded6 100644 --- a/pages/creator/creatorDetail.vue +++ b/pages/creator/creatorDetail.vue @@ -161,7 +161,7 @@ pageSize: that.pageSize, } const res = await getTypeImgsPage(params) - if (res.data.code === 200) { + if (res && res.data.code === 200) { that.$refs.waterfallRef.addData(res.data.rows); if(res.data.rows.length < that.pageSize){ //判断接口返回数据量小于请求数据量,则表示此为最后一页 diff --git a/pages/creator/imgDetail.vue b/pages/creator/imgDetail.vue index e9092d9..522a50c 100644 --- a/pages/creator/imgDetail.vue +++ b/pages/creator/imgDetail.vue @@ -76,7 +76,6 @@ var videoAd = null; likeColor: '#ef223c', collectColor: '#dcaa04', urlParamId: undefined, - //isplayOver: false, downloadUrl: undefined, isVip: false, canDownloadNum: 0, //可下载图片次数 @@ -93,7 +92,6 @@ var videoAd = null; } //如果是非会员才做如下操作 if(this.isVip === false){ - //this.isplayOver = false; //随机选择一个激励视频广告初始化 //let num = Math.floor(Math.random() * this.adList.length + 1)-1; //console.log('随机激励视频id为:',this.adList[num]) @@ -107,7 +105,6 @@ var videoAd = null; onHide() { console.log('进入onHide') //切出小程序时,广告状态还原 - //this.isplayOver = false; }, created() { const detailId = uni.getStorageSync('detailId') @@ -157,7 +154,7 @@ var videoAd = null; } const res = await checkVip(data); console.log('res===', res); - if (res.data.code === 200) { + if (res && res.data.code === 200) { if(res.data.data.isVip == '1') { that.isVip = true; }else{ @@ -180,7 +177,7 @@ var videoAd = null; platform: '0' ,//此处0代表抖音 } const res = await getRestDownloadNum(params); - if (res.data.code === 200) { + if (res && res.data.code === 200) { console.log("当日非会员用户可下载结果为", res.data.data) //下载图片 this.canDownloadNum = res.data.data @@ -260,11 +257,8 @@ var videoAd = null; console.log('激励视频下图管理res',res) if (res && res.isEnded || res === undefined) { // 正常播放结束,可以下发游戏奖励 - //that.isplayOver = true; - //console.log('激励视频广告观看完毕',that.isplayOver) that.achieveSaveImg(); }else{ - //that.isplayOver = false; uni.showToast({ title: '您还没有看完视频,无法下载图片', icon: 'none' @@ -292,9 +286,8 @@ var videoAd = null; uni.showModal({ title: '图片下载失败', content: '请稍后重试', - showCancel: false, + showCancel: false // complete: function() { - // this.isplayOver = false; // } }) }) @@ -304,7 +297,7 @@ var videoAd = null; // 图片详情 async getImgDetail(id) { const res = await detailsTiktokImg(id) - if (res.data.code === 200) { + if (res && res.data.code === 200) { if (!res.data?.data){ uni.showToast({ title: '获取图片信息失败', @@ -345,7 +338,7 @@ var videoAd = null; userId: this.userInfo.id } const res = await judgeTiktokLike(params,token) - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.isLike = res.data.data } else { uni.showToast({ @@ -361,7 +354,7 @@ var videoAd = null; userId: this.userInfo.id } const res = await judgeTiktokCollect(params,token) - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.isCollect = res.data.data } else { uni.showToast({ @@ -380,7 +373,7 @@ var videoAd = null; if (!isLike) { //点赞 const res = await tiktokLike(params) - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.isLike = !isLike } else { uni.showToast({ @@ -391,7 +384,7 @@ var videoAd = null; } else { //取消点赞 const res = await tiktokUnLike(params) - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.isLike = !isLike } else { uni.showToast({ @@ -410,7 +403,7 @@ var videoAd = null; if (!isCollect) { //收藏 const res = await tiktokCollect(params) - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.isCollect = !isCollect } else { uni.showToast({ @@ -421,7 +414,7 @@ var videoAd = null; } else { //取消收藏 const res = await tiktokUnCollect(params) - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.isCollect = !isCollect } else { uni.showToast({ @@ -458,7 +451,7 @@ var videoAd = null; } // 用户授权登录 await loginTiktok(params).then(res => { - if (res.data.code === 200) { + if (res && res.data.code === 200) { uni.setStorage({ key: 'userInfo', data: res.data.data.userInfo, @@ -549,7 +542,7 @@ var videoAd = null; platform: '0' //此处0代表抖音 } const res = await insertOrUpdatePreAdProfit(params); - if (res.data.code === 200) { + if (res && res.data.code === 200) { console.log("写入广告收益成功!") } else { uni.showToast({ @@ -570,7 +563,7 @@ var videoAd = null; platform: '0' //此处0代表抖音 } const res = await insertOrUpdatePreInviteProfit(params) - if (res.data.code === 200) { + if (res && res.data.code === 200) { // console.log("写入邀请收益成功"); that.inviteResult = res.data.code; } else { @@ -590,7 +583,7 @@ var videoAd = null; adType: adType } const res = await checkUserCanDownload(params); - if (res.data.code === 200) { + if (res && res.data.code === 200) { console.log("当日非会员用户是否可下载/奖励结果为", res.data.data) this.canDownload = res.data.data; } else { @@ -761,8 +754,6 @@ var videoAd = null; //观看完广告,保存图片 achieveSaveImg(){ let that = this; - //console.log('广告状态',that.isplayOver) - // if(that.isplayOver){ //观看完广告,可下载图片 let url = that.downloadUrl; //console.log('that.downloadUrl观看完广告',that.downloadUrl); @@ -813,7 +804,6 @@ var videoAd = null; //下载成功写入下载收益、邀请收益 that.insertPreAdProfit(); that.insertPreInviteProfit(); - //that.isplayOver = false; //重置已下载状态 that.isDownload = false; } @@ -890,7 +880,6 @@ var videoAd = null; //下载成功写入下载收益、邀请收益 that.insertPreAdProfit(); that.insertPreInviteProfit(); - //that.isplayOver = false; //重置已下载状态 that.isDownload = false; } diff --git a/pages/index/choiceness.vue b/pages/index/choiceness.vue index c7f62a5..944fac3 100644 --- a/pages/index/choiceness.vue +++ b/pages/index/choiceness.vue @@ -77,7 +77,7 @@ scanCode }) console.log('creatorDetails', res) - if (res.data.code === 200) { + if (res && res.data.code === 200) { uni.setStorage({ key: 'creatorDetail', data: res.data.data, @@ -108,7 +108,7 @@ pageNum: this.pageNum, pageSize: this.pageSize }) - if (res.data.code === 200) { + if (res && res.data.code === 200) { for (let i = 0; i < res.data.rows.length; i++) { this.imgList.push(res.data.rows[i]) } diff --git a/pages/index/index.vue b/pages/index/index.vue index c118a78..5ba3857 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -259,7 +259,7 @@ } // 用户授权登录 loginTiktok(params).then(res => { - if (res.data.code === 200) { + if (res && res.data.code === 200) { uni.setStorage({ key: 'userInfo', data: res.data.data.userInfo, @@ -295,7 +295,7 @@ // 获取热门艺术家列表 async getHotCreatorList() { const res = await listHotCreator() - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.hotCreatorList = res.data.data } else { uni.showToast({ @@ -312,7 +312,7 @@ scanCode }) console.log('creatorDetails', res) - if (res.data.code === 200) { + if (res && res.data.code === 200) { uni.setStorage({ key: 'creatorDetail', data: res.data.data, diff --git a/pages/index/indexProto.vue b/pages/index/indexProto.vue index 655d5c6..4c45231 100644 --- a/pages/index/indexProto.vue +++ b/pages/index/indexProto.vue @@ -150,7 +150,7 @@ async getBanner() { let that = this; const res = await getListBanner() - if (res.data.code === 200) { + if (res && res.data.code === 200) { that.banner = res.data.data } else { uni.showModal({ @@ -163,7 +163,7 @@ async getHotCreatorList() { this.creatorLoading = true; const res = await listHotCreator() - if (res.data.code === 200) { + if (res && res.data.code === 200) { this.creatorLoading = false; this.hotCreatorList = res.data.data } else { @@ -182,7 +182,7 @@ pageNum: that.pageNum, pageSize: that.pageSize }) - if (res.data.code === 200) { + if (res && res.data.code === 200) { that.$refs.waterfallRef.addData(res.data.rows); if(res.data.rows.length < that.pageSize){ //判断接口返回数据量小于请求数据量,则表示此为最后一页 that.isLoadMore = true @@ -209,7 +209,7 @@ scanCode }) console.log('creatorDetails', res) - if (res.data.code === 200) { + if (res && res.data.code === 200) { uni.setStorage({ key: 'creatorDetail', data: res.data.data, diff --git a/pages/userInfo/aiPaint/aiPaint.vue b/pages/userInfo/aiPaint/aiPaint.vue index 3dbf2d1..888f531 100644 --- a/pages/userInfo/aiPaint/aiPaint.vue +++ b/pages/userInfo/aiPaint/aiPaint.vue @@ -81,7 +81,7 @@ pageSize: that.pageSize }) console.log('res',res) - if (res.data.code === 200) { + if (res && res.data.code === 200) { let imgData = res.data.rows?.map?.(item => { if (item.width == '1024' && item.height == '512') { item.typeId = 4; diff --git a/pages/userInfo/goldNum/goldNum.vue b/pages/userInfo/goldNum/goldNum.vue index c173d03..34bc5f5 100644 --- a/pages/userInfo/goldNum/goldNum.vue +++ b/pages/userInfo/goldNum/goldNum.vue @@ -25,7 +25,6 @@ export default { return { userInfo: {}, noClick:true, //防止重复提交 - //isplayOver: false, isWatch: false, canWatch: false, //false为可观看 canRewardNum: 0, @@ -39,10 +38,8 @@ export default { onHide() { console.log('进入onHide') //切出小程序时,广告状态还原 - //this.isplayOver = false; }, onLoad() { - //this.isplayOver = false; //随机选择一个激励视频广告初始化 // let num = Math.floor(Math.random() * this.adList.length + 1)-1; // console.log('随机激励视频id为:',this.adList[num]) @@ -59,7 +56,7 @@ export default { platform: '1' ,//此处1代表抖音 } const res = await checkUserCanGetGold(params); - if (res.data.code === 200) { + if (res && res.data.code === 200) { console.log("当日非会员用户是否可获取奖励结果为", res.data.data) this.canWatch = res.data.data; } else { @@ -142,11 +139,8 @@ export default { console.log('激励视频领取画意值管理res',res) if (res && res.isEnded || res === undefined) { // 正常播放结束,可以下发游戏奖励 - //that.isplayOver = true; - //console.log('激励视频广告观看完毕',that.isplayOver) that.watchAdGetGold(); }else{ - //that.isplayOver = false; uni.showToast({ title: '您还没有看完视频,无法下载图片', icon: 'none' @@ -174,7 +168,6 @@ export default { content: '请稍后重试', showCancel: false, // complete: function() { - // this.isplayOver = false; // } }) }) @@ -191,7 +184,7 @@ export default { } const res = await signGetGold(data); console.log('签到结果===', res); - if (res.data.code === 200) { + if (res && res.data.code === 200) { return uni.showToast({ title: "签到成功!", icon: 'none' @@ -214,7 +207,7 @@ export default { } const res = await watchAdGetGold(data); //console.log('观看广告结果===', res); - if (res.data.code === 200) { + if (res && res.data.code === 200) { return uni.showToast({ title: "画意值领取成功!", icon: 'none' @@ -235,7 +228,7 @@ export default { platform: '1' ,//此处1代表抖音 } const res = await getRestRewardNum(params); - if (res.data.code === 200) { + if (res && res.data.code === 200) { console.log("当日非会员用户可获得奖励结果为", res.data.data) //获取奖励 this.canRewardNum = res.data.data diff --git a/pages/userInfo/goldNum/goldNumLog.vue b/pages/userInfo/goldNum/goldNumLog.vue index f4aced5..2078567 100644 --- a/pages/userInfo/goldNum/goldNumLog.vue +++ b/pages/userInfo/goldNum/goldNumLog.vue @@ -68,7 +68,7 @@ export default { } const res = await queryGoldLogPage(data); console.log('画意值记录===', res); - if (res.data.code === 200) { + if (res && res.data.code === 200) { that.goldNumLog.push(...res.data.rows) if(res.data.rows.length < that.pageSize){ //判断接口返回数据量小于请求数据量,则表示此为最后一页 that.isLoadMore = true diff --git a/pages/userInfo/myCollection/myCollection.vue b/pages/userInfo/myCollection/myCollection.vue index 1489db5..3699133 100644 --- a/pages/userInfo/myCollection/myCollection.vue +++ b/pages/userInfo/myCollection/myCollection.vue @@ -67,7 +67,7 @@ pageNum: that.pageNum, pageSize: that.pageSize }) - if (res.data.code === 200) { + if (res && res.data.code === 200) { that.$refs.waterfallRef.addData(res.data.rows); if(res.data.rows.length < that.pageSize){ //判断接口返回数据量小于请求数据量,则表示此为最后一页 that.isLoadMore = true diff --git a/pages/userInfo/setting/setting.vue b/pages/userInfo/setting/setting.vue index 2f13178..ae1dccc 100644 --- a/pages/userInfo/setting/setting.vue +++ b/pages/userInfo/setting/setting.vue @@ -79,7 +79,7 @@ success: function(ress){ if(ress.confirm){ logout().then(res => { - if (res.data.code === 200) { + if (res && res.data.code === 200) { uni.reLaunch({ url: '/pages/index/indexProto', success() { diff --git a/pages/userInfo/userInfo.vue b/pages/userInfo/userInfo.vue index a4abc1a..3f337e4 100644 --- a/pages/userInfo/userInfo.vue +++ b/pages/userInfo/userInfo.vue @@ -146,7 +146,7 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons } const res = await checkVip(data); console.log('res===', res); - if (res.data.code === 200) { + if (res && res.data.code === 200) { if(res.data.data.isVip == '1') { that.isVip = true; }else{ @@ -165,7 +165,7 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons async queryGoldNum(){ let that = this; const res = await queryGoldNum(that.userInfo.id); - if (res.data.code === 200) { + if (res && res.data.code === 200) { that.goldNum = res.data.data; console.log(that.goldNum); } @@ -185,7 +185,7 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons } // 用户授权登录 loginTiktok(params).then(res => { - if (res.data.code === 200) { + if (res && res.data.code === 200) { uni.setStorage({ key: 'userInfo', data: res.data.data.userInfo, diff --git a/pages/userInfo/vip/vip.vue b/pages/userInfo/vip/vip.vue index a068fdf..fad6979 100644 --- a/pages/userInfo/vip/vip.vue +++ b/pages/userInfo/vip/vip.vue @@ -158,7 +158,7 @@ } const res = await checkVip(data); console.log('res===', res); - if (res.data.code === 200) { + if (res && res.data.code === 200) { that.vipInfo = res.data.data } // else { @@ -170,10 +170,12 @@ }, async getVipList() { - const { - data - } = await queryUserVipList(); - this.vipList = data.data + const res = await queryUserVipList(); + //console.log('vipRes',res); + if(res && res.data.code === 200){ + this.vipList = res.data.data + } + }, change(index) { this.active = index @@ -215,6 +217,7 @@ } }, tikPay(order_id, order_token) { + let that = this; tt.pay({ orderInfo: { order_id, @@ -226,11 +229,11 @@ } uni.hideLoading(); - this.disabled = false + that.disabled = false }, fail(res) { uni.hideLoading(); - this.disabled = false + that.disabled = false }, }) }, diff --git a/utils/request.js b/utils/request.js index 6b5bc41..e18af8d 100644 --- a/utils/request.js +++ b/utils/request.js @@ -17,7 +17,7 @@ const loginFunc = (res, userInfo) => { } // 用户授权登录 loginTiktok(params).then(res => { - if (res.data.code === 200) { + if (res && res.data.code === 200) { uni.setStorageSync({ key: 'token', data: res.data.data.access_token,