user_dao.dart 966 Bytes
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) {}
}