|
|
@@ -1,5 +1,7 @@
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
+import 'package:crypto/crypto.dart';
|
|
|
+import 'dart:convert';
|
|
|
import '../../util/session.dart';
|
|
|
import '../../showAlert.dart';
|
|
|
import '../../util/api.dart';
|
|
|
@@ -104,8 +106,10 @@ class _RevisePasswordPageState extends State < RevisePasswordPage > {
|
|
|
if (oldPassword == '' || newPassword == '') {
|
|
|
return;
|
|
|
}
|
|
|
+ String tempString = sha1.convert(utf8.encode(oldPassword)).toString();
|
|
|
+ String newTempString = sha1.convert(utf8.encode(newPassword)).toString();
|
|
|
getKey('password').then((value) {
|
|
|
- if (value != oldPassword) {
|
|
|
+ if (value != tempString) {
|
|
|
showDialog < Null > (
|
|
|
context: context, //BuildContext对象
|
|
|
barrierDismissible: false,
|
|
|
@@ -118,9 +122,9 @@ class _RevisePasswordPageState extends State < RevisePasswordPage > {
|
|
|
setState(() {
|
|
|
loginStatus = false;
|
|
|
});
|
|
|
- updataPasswrod(oldPassword, newPassword).then((resp) {
|
|
|
+ updataPasswrod(tempString, newTempString).then((resp) {
|
|
|
if (isNotError(context, resp) && this.mounted) {
|
|
|
- setKey('password', newPassword);
|
|
|
+ setKey('password', newTempString);
|
|
|
showDialog < Null > (
|
|
|
context: context, //BuildContext对象
|
|
|
barrierDismissible: false,
|