Blame view

lib/common/request/dao/user_dao.dart 966 Bytes
056970d8   Key   feat: api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  import '../../../models/user_entity.dart';
  import '../api_response/api_response_entity.dart';
  import '../apis.dart';
  import '../exception.dart';
  import '../request_client.dart';
  
  class UserDao {
    static loginByPassword(
      phoneNumber,
      password,
      Function(ApiResponse<UserEntity>)? onResponse,
      bool Function(ApiException)? onError,
    ) async {
      /*await DioUtil().requestData(
          HttpMethod.post,
          Api.login,
          data: {
            'phoneNum':phoneNumber,
            'type':'pwd',
            'password':password},
          successCallBack: (data){
            emitter(LoginResultChangeState(true));
          },
          errorCallBack: (error){
            emitter(LoginResultChangeState(false));
          });*/
      var params = {'phoneNum': phoneNumber, 'type': 'pwd', 'password': password};
      await requestClient.post(Apis.login, data: params, onResponse: onResponse, onError: onError);
    }
  
    static loginBySmsCode(phoneNumber, smsCode) {}
  }