diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_logic.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_logic.dart index ec4d829c..b85ffffb 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_logic.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_logic.dart @@ -7,12 +7,28 @@ import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/tools/baseGetXController.dart'; class MinePersonInfoResetPasswordLogic extends BaseGetXController { - final MinePersonInfoResetPasswordState state = - MinePersonInfoResetPasswordState(); + final MinePersonInfoResetPasswordState state = MinePersonInfoResetPasswordState(); void changePasswordRequest() async { + if(state.newPwd.value.length < 8){ + showToast("新密码长度不足8位"); + return; + } + + if(state.surePwd.value.length < 8){ + showToast("确认长度不足8位"); + return; + } + + if(state.surePwd.value != state.newPwd.value){ + showToast("两次密码不一致"); + return; + } + var entity = await ApiRepository.to.changePassword( - state.date.value, state.surePwd.value, state.oldPwd.value, ""); + state.date.value, + state.surePwd.value, + state.oldPwd.value); if (entity.errorCode!.codeIsSuccessful) { showToast("重置成功"); Get.back(); diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index f7bc3285..bb7d7549 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -1570,14 +1570,13 @@ class ApiProvider extends BaseProvider { //修改密码 Future changePassword(String date, String newPassword, - String oldPassword, String operatorUid) => + String oldPassword) => post( changePasswordURL.toUrl, jsonEncode({ "date": date, 'newPassword': newPassword, "oldPassword": oldPassword, - 'operatorUid': operatorUid })); //获取安全信息列表 diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index cdd7bfdb..ab49239a 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -1601,10 +1601,9 @@ class ApiRepository { } //重置密码 - Future changePassword(String date, String newPassword, - String oldPassword, String operatorUid) async { + Future changePassword(String date, String newPassword, String oldPassword) async { final res = await apiProvider.changePassword( - date, newPassword, oldPassword, operatorUid); + date, newPassword, oldPassword); return LoginEntity.fromJson(res.body); }