From 045186b3c8370e1f4da0280959834b44023762e8 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 3 Feb 2024 00:33:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?mod:=20=E8=A7=86=E9=A2=91=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E5=93=8D=E5=BA=94status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/video.dart | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/http/video.dart b/lib/http/video.dart index 0e869512..6ffbde21 100644 --- a/lib/http/video.dart +++ b/lib/http/video.dart @@ -361,7 +361,7 @@ class VideoHttp { if (res.data['code'] == 0) { return {'status': true, 'data': res.data['data']}; } else { - return {'status': true, 'data': []}; + return {'status': false, 'data': []}; } } @@ -377,7 +377,7 @@ class VideoHttp { if (res.data['code'] == 0) { return {'status': true, 'data': res.data['data']}; } else { - return {'status': true, 'data': []}; + return {'status': false, 'data': []}; } } @@ -455,10 +455,7 @@ class VideoHttp { 'data': AiConclusionModel.fromJson(res.data['data']), }; } else { - return { - 'status': false, - 'data': [] - }; + return {'status': false, 'data': []}; } } } From 18bb58d293ed48bf84f5590d540ec92328b35142 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 3 Feb 2024 00:43:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?mod:=20=E6=8A=95=E5=B8=81=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=93=8D=E5=BA=94status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/video.dart | 3 ++- lib/pages/video/detail/introduction/controller.dart | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/http/video.dart b/lib/http/video.dart index 6ffbde21..eaa131f3 100644 --- a/lib/http/video.dart +++ b/lib/http/video.dart @@ -224,10 +224,11 @@ class VideoHttp { // 获取投币状态 static Future hasCoinVideo({required String bvid}) async { var res = await Request().get(Api.hasCoinVideo, data: {'bvid': bvid}); + print('res: $res'); if (res.data['code'] == 0) { return {'status': true, 'data': res.data['data']}; } else { - return {'status': true, 'data': []}; + return {'status': false, 'data': []}; } } diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 1deadb07..b1b02420 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -148,7 +148,9 @@ class VideoIntroController extends GetxController { // 获取投币状态 Future queryHasCoinVideo() async { var result = await VideoHttp.hasCoinVideo(bvid: bvid); - hasCoin.value = result["data"]['multiply'] == 0 ? false : true; + if (result['status']) { + hasCoin.value = result["data"]['multiply'] == 0 ? false : true; + } } // 获取收藏状态 From 6a844da259cb707696282fe398f80289891da4fc Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 3 Feb 2024 00:53:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?mod:=20=E7=82=B9=E8=B5=9E=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/introduction/controller.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index b1b02420..d1298fcc 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -210,6 +210,10 @@ class VideoIntroController extends GetxController { // (取消)点赞 Future actionLikeVideo() async { + if (userInfo == null) { + SmartDialog.showToast('账号未登录'); + return; + } var result = await VideoHttp.likeVideo(bvid: bvid, type: !hasLike.value); if (result['status']) { // hasLike.value = result["data"] == 1 ? true : false;