Commit 71fb0fb2e17edf5952195922e69a55c3e8762c5d

Authored by liangchengyou
1 parent e3f2bf59

feat:首页未登陆状态下逻辑调整

Showing 1 changed file with 9 additions and 0 deletions
lib/pages/home/home_page.dart
... ... @@ -39,6 +39,7 @@ class _HomePageView extends StatelessWidget {
39 39 } else if (type == HeaderActionType.shop) {
40 40 pushNamed(AppRouteName.shop);
41 41 } else if (type == HeaderActionType.user) {
  42 + debugPrint(UserUtil.token);
42 43 if(UserUtil.token.isEmpty) {
43 44 pushNamed(AppRouteName.login);
44 45 } else {
... ... @@ -104,6 +105,10 @@ class _HomePageView extends StatelessWidget {
104 105 //彩蛋
105 106 return GestureDetector(
106 107 onTap: () {
  108 + if(UserUtil.token.isEmpty) {
  109 + pushNamed(AppRouteName.login);
  110 + return;
  111 + }
107 112 if (data!.lock!) {
108 113 showToast('当前课程暂未解锁');
109 114 return;
... ... @@ -117,6 +122,10 @@ class _HomePageView extends StatelessWidget {
117 122 } else {
118 123 return GestureDetector(
119 124 onTap: () {
  125 + if(UserUtil.token.isEmpty) {
  126 + pushNamed(AppRouteName.login);
  127 + return;
  128 + }
120 129 if (data!.lock!) {
121 130 showToast('当前课程暂未解锁');
122 131 return;
... ...