user.dart 574B

123456789101112131415161718192021222324
  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 })
  6. .then((value) {
  7. Fluttertoast.showToast(
  8. msg: '验证码发送成功!'
  9. );
  10. }).catchError((error) {
  11. Fluttertoast.showToast(
  12. msg: error.error['message']
  13. );
  14. });
  15. }
  16. Future getCurrent() async {
  17. return request('/person/current');
  18. }