发短信 支持native
This commit is contained in:
parent
69a8732908
commit
ebf3210c8f
|
|
@ -1036,7 +1036,7 @@ export async function syncUserInfoWechatMp({ nickname, avatarUrl, encryptedData,
|
|||
}
|
||||
export async function sendCaptcha({ mobile, env, type: type2 }, context) {
|
||||
const { type } = env;
|
||||
assert(type === 'web');
|
||||
assert(type === 'web' || type === 'native');
|
||||
let { visitorId } = env;
|
||||
const application = context.getApplication();
|
||||
const { system } = application;
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ async function syncUserInfoWechatMp({ nickname, avatarUrl, encryptedData, iv, si
|
|||
exports.syncUserInfoWechatMp = syncUserInfoWechatMp;
|
||||
async function sendCaptcha({ mobile, env, type: type2 }, context) {
|
||||
const { type } = env;
|
||||
(0, assert_1.assert)(type === 'web');
|
||||
(0, assert_1.assert)(type === 'web' || type === 'native');
|
||||
let { visitorId } = env;
|
||||
const application = context.getApplication();
|
||||
const { system } = application;
|
||||
|
|
|
|||
|
|
@ -1509,17 +1509,17 @@ export async function sendCaptcha<
|
|||
{
|
||||
mobile,
|
||||
env,
|
||||
type: type2
|
||||
type: type2,
|
||||
}: {
|
||||
mobile: string;
|
||||
env: WechatMpEnv | WebEnv;
|
||||
env: WechatMpEnv | WebEnv | NativeEnv;
|
||||
type: 'login' | 'changePassword' | 'confirm';
|
||||
},
|
||||
context: Cxt
|
||||
): Promise<string> {
|
||||
const { type } = env;
|
||||
|
||||
assert(type === 'web');
|
||||
assert(type === 'web' || type === 'native');
|
||||
let { visitorId } = env;
|
||||
const application = context.getApplication();
|
||||
const { system } = application!;
|
||||
|
|
@ -1591,8 +1591,7 @@ export async function sendCaptcha<
|
|||
if (process.env.NODE_ENV !== 'production' || mockSend) {
|
||||
closeRootMode();
|
||||
return `验证码[${code}]已创建`;
|
||||
}
|
||||
else if (captcha.$$createAt$$! as number - now < 60000) {
|
||||
} else if ((captcha.$$createAt$$! as number) - now < 60000) {
|
||||
closeRootMode();
|
||||
throw new OakUserException('您的操作太迅捷啦,请稍等再点吧');
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue