修改了重置密码问题
This commit is contained in:
parent
87aa689380
commit
09985bd206
@ -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();
|
||||
|
||||
@ -1570,14 +1570,13 @@ class ApiProvider extends BaseProvider {
|
||||
|
||||
//修改密码
|
||||
Future<Response> changePassword(String date, String newPassword,
|
||||
String oldPassword, String operatorUid) =>
|
||||
String oldPassword) =>
|
||||
post(
|
||||
changePasswordURL.toUrl,
|
||||
jsonEncode({
|
||||
"date": date,
|
||||
'newPassword': newPassword,
|
||||
"oldPassword": oldPassword,
|
||||
'operatorUid': operatorUid
|
||||
}));
|
||||
|
||||
//获取安全信息列表
|
||||
|
||||
@ -1601,10 +1601,9 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
//重置密码
|
||||
Future<LoginEntity> changePassword(String date, String newPassword,
|
||||
String oldPassword, String operatorUid) async {
|
||||
Future<LoginEntity> 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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user