hideLogin static method

Future<DataResult> hideLogin(
  1. UserProvider userProvider
)

获取自己用户信息

Implementation

static Future<DataResult> hideLogin(UserProvider userProvider) async {
  var res = await BaseDao.fromBaseEncrypt({}, Address.hideLogin());
  if (res.result) {
    var entity = UserEntity.fromJson(res.data);
    Address.baseToken = entity.token ?? '';
    SpUtil.putString(AppConfig.appToken, entity.token!);
    UserEntity userEntityPro = await updateUserInfo(entity, update: true);
    userProvider.setUserEntity(userEntityPro);
    return DataResult(entity, true);
  }
  return res;
}