diff --git a/lib/constants/api.dart b/lib/constants/api.dart index 4f06a4d..5a76179 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -23,19 +23,19 @@ class API { static String get baseURL => '$host'; - static _Manager manager = _Manager(); + static _App app = _App(); static _Pay pay = _Pay(); } -class _Manager { - String get login => '/manage/login'; - String get logout => '/manage/login/logout'; - String get captcha => '/manage/captcha'; - String get info => '/manage/user/info'; +class _App { + String get login => '/app/login'; + String get logout => '/app/login/logout'; + String get captcha => '/app/captcha'; + String get info => '/app/user/info'; } class _Pay { - String get wxpay => '/manage/pay/wxpay'; - String get alipay => '/manage/pay/alipay'; + String get wxpay => '/app/pay/wxpay'; + String get alipay => '/app/pay/alipay'; String get wxCallback => '/callback/wxpay/notify'; String get aliCallback => '/callback/alipay/notify'; } \ No newline at end of file diff --git a/lib/providers/user_provider.dart b/lib/providers/user_provider.dart index e4c63dc..c171227 100644 --- a/lib/providers/user_provider.dart +++ b/lib/providers/user_provider.dart @@ -44,7 +44,7 @@ class UserProvider extends ChangeNotifier { } Future updateUserInfo() async { - var base = await apiClient.request(API.manager.info); + var base = await apiClient.request(API.app.info); if (base.code == 0) { _userInfo = UserInfoModel.fromJson(base.data); } else { diff --git a/lib/ui/login/login_page.dart b/lib/ui/login/login_page.dart index 50d6aa0..b6113a9 100644 --- a/lib/ui/login/login_page.dart +++ b/lib/ui/login/login_page.dart @@ -128,7 +128,7 @@ class _LoginPageState extends State { }else if(!_chooseAgreement){ BotToast.showText(text: "请同意并勾选隐私政策"); }else{ - var base = await apiClient.request(API.manager.login, + var base = await apiClient.request(API.app.login, data: {'phone': _phoneController.text, 'code': _smsCodeController.text}); if (base.code == 0) { await UserTool.userProvider.setToken(base.data['token']); @@ -208,7 +208,7 @@ class _LoginPageState extends State { onTap: !_getCodeEnable ? () {} : () async { - await apiClient.request(API.manager.captcha, data: { + await apiClient.request(API.app.captcha, data: { 'phone': _phoneController.text, }); _beginCountDown(); diff --git a/lib/ui/user/user_page.dart b/lib/ui/user/user_page.dart index 39a6270..68617c1 100644 --- a/lib/ui/user/user_page.dart +++ b/lib/ui/user/user_page.dart @@ -63,7 +63,7 @@ class _UserPageState extends State { border: false, onTap: () async{ var cancel = CloudToast.loading; - var base = await apiClient.request(API.manager.logout, showMessage: true); + var base = await apiClient.request(API.app.logout, showMessage: true); if (base.code == 0) { UserTool.userProvider.logout(); Get.offAll(const HomePage());