updateUserPassword static method

Future<DataResult> updateUserPassword(
  1. String? oldPwd,
  2. String? newPwd
)

修改密码

Implementation

static Future<DataResult> updateUserPassword(
    String? oldPwd, String? newPwd) async {
  String? encode =
      await BaseDao.encryptToBase64(oldPwd!, NetConfig.encryptDesPass);
  String? encodeNew =
      await BaseDao.encryptToBase64(newPwd!, NetConfig.encryptDesPass);
  Map other = {'oldPwd': encode, 'newPwd': encodeNew};
  var res = await BaseDao.fromBaseJson(other, Address.updateUserPassword());
  if (res.result) {
    var entity = TokenEntity.fromJson(res.data);
    return DataResult(entity, true);
  }
  return res;
}