正在显示
1 个修改的文件
包含
8 行增加
和
4 行删除
| 1 | 1 | from app.util.component.ApiTemplate import ApiTemplate |
| 2 | 2 | from app.models import SM3 |
| 3 | 3 | from .models import * |
| 4 | +from app.models import AESHelper | |
| 4 | 5 | |
| 5 | 6 | |
| 6 | 7 | class Api(ApiTemplate): |
| ... | ... | @@ -25,9 +26,12 @@ class Api(ApiTemplate): |
| 25 | 26 | else: |
| 26 | 27 | # 更新密码要求同时输入pwd/newPwd/reNewPwd |
| 27 | 28 | if self.para.__contains__("pwd") or self.para.__contains__("newPwd") or self.para.__contains__("reNewPwd"): |
| 28 | - password = SM3.encode(self.para.get("pwd")) | |
| 29 | - new_password = SM3.encode(self.para.get("newPwd")) | |
| 30 | - re_new_password = SM3.encode(self.para.get("reNewPwd")) | |
| 29 | + password = SM3.encode( | |
| 30 | + AESHelper.decode(self.para.get("pwd"))) | |
| 31 | + new_password = SM3.encode( | |
| 32 | + AESHelper.decode(self.para.get("newPwd"))) | |
| 33 | + re_new_password = SM3.encode( | |
| 34 | + AESHelper.decode(self.para.get("reNewPwd"))) | |
| 31 | 35 | |
| 32 | 36 | # validate pwd |
| 33 | 37 | if not password: |
| ... | ... | @@ -49,7 +53,7 @@ class Api(ApiTemplate): |
| 49 | 53 | # 更新用户基本信息 |
| 50 | 54 | for key in obj_value: |
| 51 | 55 | if self.para.__contains__(obj_value[key]): |
| 52 | - value = self.para.get(obj_value[key]) | |
| 56 | + value = self.para.get(AESHelper.decode(obj_value[key])) | |
| 53 | 57 | value = "" if value == "None" or value == "none" else value |
| 54 | 58 | userinfo.update({key: value}) |
| 55 | 59 | ... | ... |
请
注册
或
登录
后发表评论