Commit 210d15e0116e7ae0438695b946cc847c05dc3c10
1 parent
bb0406fb
fixed: 账户注销接口
修改splash跳转:直接到home
Showing
4 changed files
with
15 additions
and
25 deletions
lib/app/splash_page.dart
| @@ -57,11 +57,12 @@ class _TransitionViewState extends State<TransitionView> { | @@ -57,11 +57,12 @@ class _TransitionViewState extends State<TransitionView> { | ||
| 57 | Log.d('Splash getUserInfo 耗时:${apartInMilliseconds}ms'); | 57 | Log.d('Splash getUserInfo 耗时:${apartInMilliseconds}ms'); |
| 58 | int duration = max(2000 - apartInMilliseconds, 0); | 58 | int duration = max(2000 - apartInMilliseconds, 0); |
| 59 | Timer(Duration(milliseconds: duration), () { | 59 | Timer(Duration(milliseconds: duration), () { |
| 60 | - if (userEntity != null) { | 60 | + /*if (userEntity != null) { |
| 61 | pushNamedAndRemoveUntil(AppRouteName.home, (route) => false); | 61 | pushNamedAndRemoveUntil(AppRouteName.home, (route) => false); |
| 62 | } else { | 62 | } else { |
| 63 | pushNamedAndRemoveUntil(AppRouteName.login, (route) => false); | 63 | pushNamedAndRemoveUntil(AppRouteName.login, (route) => false); |
| 64 | - } | 64 | + }*/ |
| 65 | + pushNamedAndRemoveUntil(AppRouteName.home, (route) => false); | ||
| 65 | }); | 66 | }); |
| 66 | } | 67 | } |
| 67 | 68 |
lib/common/dialogs/show_dialog.dart
| @@ -3,33 +3,22 @@ import 'package:wow_english/route/route.dart'; | @@ -3,33 +3,22 @@ import 'package:wow_english/route/route.dart'; | ||
| 3 | 3 | ||
| 4 | import 'customer_dialog.dart'; | 4 | import 'customer_dialog.dart'; |
| 5 | 5 | ||
| 6 | -void showOneActionDialog( | ||
| 7 | - String title, | ||
| 8 | - String ensureTitle, | ||
| 9 | - String content, | ||
| 10 | - GestureTapCallback ensureTap,{ | ||
| 11 | - bool? barrierDismissible | ||
| 12 | - }) { | 6 | +void showOneActionDialog(String title, String ensureTitle, String content, GestureTapCallback ensureTap, |
| 7 | + {bool? barrierDismissible}) { | ||
| 13 | showDialog<CustomerOneActionDialog>( | 8 | showDialog<CustomerOneActionDialog>( |
| 14 | context: AppRouter.context, | 9 | context: AppRouter.context, |
| 15 | - barrierDismissible: barrierDismissible??true, | ||
| 16 | - builder: (BuildContext context){ | 10 | + barrierDismissible: barrierDismissible ?? true, |
| 11 | + builder: (BuildContext context) { | ||
| 17 | return CustomerOneActionDialog(title, ensureTitle, content, ensureTap); | 12 | return CustomerOneActionDialog(title, ensureTitle, content, ensureTap); |
| 18 | }); | 13 | }); |
| 19 | } | 14 | } |
| 20 | 15 | ||
| 21 | -void showTwoActionDialog( | ||
| 22 | - String title, | ||
| 23 | - String leftTitle, | ||
| 24 | - String rightTitle, | ||
| 25 | - String content, | ||
| 26 | - GestureTapCallback leftTap, | ||
| 27 | - GestureTapCallback rightTap,{ | ||
| 28 | - bool? barrierDismissible | ||
| 29 | - }) { | 16 | +void showTwoActionDialog(String title, String leftTitle, String rightTitle, String content, GestureTapCallback leftTap, |
| 17 | + GestureTapCallback rightTap, | ||
| 18 | + {bool? barrierDismissible}) { | ||
| 30 | showDialog<CustomerTwoActionDialog>( | 19 | showDialog<CustomerTwoActionDialog>( |
| 31 | context: AppRouter.context, | 20 | context: AppRouter.context, |
| 32 | - builder: (BuildContext context){ | ||
| 33 | - return CustomerTwoActionDialog(title,leftTitle,rightTitle,content,leftTap,rightTap); | 21 | + builder: (BuildContext context) { |
| 22 | + return CustomerTwoActionDialog(title, leftTitle, rightTitle, content, leftTap, rightTap); | ||
| 34 | }); | 23 | }); |
| 35 | -} | ||
| 36 | \ No newline at end of file | 24 | \ No newline at end of file |
| 25 | +} |
lib/common/request/apis.dart
| @@ -13,7 +13,7 @@ class Apis { | @@ -13,7 +13,7 @@ class Apis { | ||
| 13 | static const String logout = 'logout'; | 13 | static const String logout = 'logout'; |
| 14 | 14 | ||
| 15 | /// 注销账号 | 15 | /// 注销账号 |
| 16 | - static const String deleteAccount = 'logout'; | 16 | + static const String deleteAccount = 'student/cancel/account'; |
| 17 | 17 | ||
| 18 | /// 获取用户信息 | 18 | /// 获取用户信息 |
| 19 | /// get | 19 | /// get |
lib/common/request/dao/user_dao.dart
| @@ -29,7 +29,7 @@ class UserDao { | @@ -29,7 +29,7 @@ class UserDao { | ||
| 29 | 29 | ||
| 30 | /// 注销账号 | 30 | /// 注销账号 |
| 31 | static Future deleteAccount() async { | 31 | static Future deleteAccount() async { |
| 32 | - var result = await requestClient.post(Apis.deleteAccount); | 32 | + var result = await requestClient.put(Apis.deleteAccount); |
| 33 | UserUtil.logout(); | 33 | UserUtil.logout(); |
| 34 | return result; | 34 | return result; |
| 35 | } | 35 | } |