webadmin系统设置
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { loginWithSms, resolveSmsCode } from './sms-test-helper.mjs';
|
||||
|
||||
const API = 'http://localhost:3000/api/v1';
|
||||
const MOCK_SMS_CODE = process.env.MOCK_SMS_CODE ?? '123456';
|
||||
|
||||
async function req(clientApp, path, options = {}) {
|
||||
const headers = {
|
||||
@@ -21,11 +22,7 @@ async function sendSms(clientApp, phone, scene, sendPath = '/auth/sms/send') {
|
||||
}
|
||||
|
||||
async function loginSms(clientApp, phone, scene, loginPath = '/auth/login/sms', sendPath = '/auth/sms/send') {
|
||||
await sendSms(clientApp, phone, scene, sendPath);
|
||||
return req(clientApp, loginPath, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ phone, code: MOCK_SMS_CODE }),
|
||||
});
|
||||
return loginWithSms(clientApp, phone, scene, loginPath, sendPath);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
|
||||
Reference in New Issue
Block a user