|
@@ -77,7 +77,7 @@ class AdminUserService extends Service {
|
|
|
assert(oldpassword, '缺少原密码');
|
|
|
const user = await this.model.findOne({ _id: id });
|
|
|
if (!user) return { errcode: -1001, errmsg: '用户不存在', data: '' };
|
|
|
- oldpassword = sm3(`${password}:${user.salt}`);
|
|
|
+ oldpassword = sm3(`${oldpassword}:${user.salt}`);
|
|
|
if (user.password !== oldpassword) return { errcode: -1001, errmsg: '原密码不正确', data: '' };
|
|
|
password = sm3(`${password}:${user.salt}`);
|
|
|
try {
|