更改接口名称

master
戴余标 2 years ago
parent e0012622d8
commit aa69683161

@ -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';
}

@ -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 {

@ -128,7 +128,7 @@ class _LoginPageState extends State<LoginPage> {
}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<LoginPage> {
onTap: !_getCodeEnable
? () {}
: () async {
await apiClient.request(API.manager.captcha, data: {
await apiClient.request(API.app.captcha, data: {
'phone': _phoneController.text,
});
_beginCountDown();

@ -63,7 +63,7 @@ class _UserPageState extends State<UserPage> {
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());

Loading…
Cancel
Save