feat(user): 后台用户管理增加重置密码功能,并将部署流程默认调整为纯代码部署(不同步数据库)
这个提交包含在:
@@ -57,9 +57,7 @@ function api(route, data, token) { return new Promise((resolve, reject) => {
|
||||
assert.strictEqual(r.data.enterprise_cert.verify_status, 'pending');
|
||||
r = await api('/auth/profile', null, newToken);
|
||||
assert.strictEqual(r.data.user_type, 'personal', 'enterprise certification must not change user type');
|
||||
r = await api('/security/setPaymentPassword', { login_password: 'wrong', new_password: '123456' }, newToken);
|
||||
assert.notStrictEqual(r.code, 1);
|
||||
r = await api('/security/setPaymentPassword', { login_password: 'Changed123!', new_password: '123456' }, newToken);
|
||||
r = await api('/security/setPaymentPassword', { new_password: '123456' }, newToken);
|
||||
assert.strictEqual(r.code, 1, r.msg);
|
||||
r = await api('/order/pay', { order_id: orderId, pay_type: 'balance', payment_password: '000000' }, newToken);
|
||||
assert.notStrictEqual(r.code, 1, 'wrong payment password cannot debit balance');
|
||||
@@ -106,6 +104,13 @@ function api(route, data, token) { return new Promise((resolve, reject) => {
|
||||
r = await api('/security/changePaymentPassword', { old_password: '654321', new_password: '111111' }, newToken);
|
||||
assert.notStrictEqual(r.code, 1, 'payment password remains locked after repeated failures');
|
||||
assert.match(r.msg, /15分钟/);
|
||||
sql(`UPDATE fa_user SET password='', salt='' WHERE id=${uid}`);
|
||||
r = await api('/security/status', null, newToken);
|
||||
assert.strictEqual(r.data.has_login_password, false, 'cleared login password reports false');
|
||||
r = await api('/security/changeLoginPassword', { new_password: 'ResetDirect123!' }, newToken);
|
||||
assert.strictEqual(r.code, 1, r.msg);
|
||||
r = await api('/auth/login', { mobile, password: 'ResetDirect123!' });
|
||||
assert.strictEqual(r.code, 1, 'login works after direct first-time login password setup');
|
||||
console.log('account security API tests passed');
|
||||
} finally {
|
||||
if (uid) sql(`DELETE FROM fa_master WHERE user_id=${Number(uid)} AND realname='Security Test'`);
|
||||
|
||||
在新工单中引用
屏蔽一个用户