| | |
| | | return null; |
| | | } |
| | | |
| | | ///登录 |
| | | static Future<Map<String, dynamic>?> loginByWX( |
| | | BuildContext context, String code) async { |
| | | Map<String, dynamic> params = {}; |
| | | params["code"] = code; |
| | | |
| | | var result = |
| | | await HttpUtil.baseRequest(context, "/api/v1/user/loginWX", params, () { |
| | | showLoading(context); |
| | | }, notifyError: true); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | static Future<Map<String, dynamic>?> loginByEmail( |
| | | BuildContext context, String email, String pwd) async { |
| | | Map<String, dynamic> params = {}; |
| | |
| | | return null; |
| | | } |
| | | |
| | | ///绑定微信 |
| | | static Future<Map<String, dynamic>?> bindWX( |
| | | BuildContext context, String code) async { |
| | | Map<String, dynamic> params = {}; |
| | | params["code"] = code; |
| | | params["uid"] = await UserUtil.getUid(); |
| | | var result = |
| | | await HttpUtil.baseRequest(context, "/api/v1/user/bindWX", params, () { |
| | | showLoading(context); |
| | | }, notifyError: true); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | ///绑定电话 |
| | | static Future<Map<String, dynamic>?> bindPhone( |
| | | BuildContext context, String? phone, String? vcode, String? token) async { |
| | | Map<String, dynamic> params = {}; |
| | | if (phone != null) { |
| | | params["phone"] = phone; |
| | | } |
| | | |
| | | if (vcode != null) { |
| | | params["vcode"] = vcode; |
| | | } |
| | | |
| | | if (token != null) { |
| | | params["token"] = token; |
| | | } |
| | | |
| | | params["uid"] = await UserUtil.getUid(); |
| | | var result = await HttpUtil.baseRequest( |
| | | context, "/api/v1/user/bindPhone", params, () { |
| | | showLoading(context); |
| | | }, notifyError: true); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | ///获取用户信息 |
| | | static Future<Map<String, dynamic>?> getUserInfo( |
| | | BuildContext context, String uid) async { |