1234567891011121314151617181920212223242526272829303132
  1. import 'package:dio/dio.dart';
  2. import 'package:farmer_client/utils/Request.dart';
  3. import 'package:fluttertoast/fluttertoast.dart';
  4. Future getSMSCaptch(String phone) async {
  5. return request('/sms-captcha', options: Options(method: 'POST'), queryParameters: { 'phone': phone }).then((value) {
  6. Fluttertoast.showToast(
  7. msg: '验证码发送成功!'
  8. );
  9. }).catchError((error) {
  10. Fluttertoast.showToast(
  11. msg: error.error['message']
  12. );
  13. });
  14. }
  15. <<<<<<< HEAD
  16. //登陆
  17. Future userLogin(String userName,String password) async {
  18. return request('/login', options: Options(method: 'POST'), data: { 'userName': userName,'password':password }, ).catchError((error)=>{ Fluttertoast.showToast(
  19. msg: error.error['message']
  20. ),});
  21. =======
  22. Future getCurrent() async {
  23. return request('/person/current');
  24. >>>>>>> aab895cc95471d4dfd7cb90d05a35ccceb52c4e0
  25. }