修改了重置密码问题
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';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
class MinePersonInfoResetPasswordLogic extends BaseGetXController {
|
class MinePersonInfoResetPasswordLogic extends BaseGetXController {
|
||||||
final MinePersonInfoResetPasswordState state =
|
final MinePersonInfoResetPasswordState state = MinePersonInfoResetPasswordState();
|
||||||
MinePersonInfoResetPasswordState();
|
|
||||||
|
|
||||||
void changePasswordRequest() async {
|
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(
|
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) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast("重置成功");
|
showToast("重置成功");
|
||||||
Get.back();
|
Get.back();
|
||||||
|
|||||||
@ -1570,14 +1570,13 @@ class ApiProvider extends BaseProvider {
|
|||||||
|
|
||||||
//修改密码
|
//修改密码
|
||||||
Future<Response> changePassword(String date, String newPassword,
|
Future<Response> changePassword(String date, String newPassword,
|
||||||
String oldPassword, String operatorUid) =>
|
String oldPassword) =>
|
||||||
post(
|
post(
|
||||||
changePasswordURL.toUrl,
|
changePasswordURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
"date": date,
|
"date": date,
|
||||||
'newPassword': newPassword,
|
'newPassword': newPassword,
|
||||||
"oldPassword": oldPassword,
|
"oldPassword": oldPassword,
|
||||||
'operatorUid': operatorUid
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
//获取安全信息列表
|
//获取安全信息列表
|
||||||
|
|||||||
@ -1601,10 +1601,9 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//重置密码
|
//重置密码
|
||||||
Future<LoginEntity> changePassword(String date, String newPassword,
|
Future<LoginEntity> changePassword(String date, String newPassword, String oldPassword) async {
|
||||||
String oldPassword, String operatorUid) async {
|
|
||||||
final res = await apiProvider.changePassword(
|
final res = await apiProvider.changePassword(
|
||||||
date, newPassword, oldPassword, operatorUid);
|
date, newPassword, oldPassword);
|
||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user