...
|
...
|
@@ -7,34 +7,44 @@ import accountModel from '../models/account/index'; |
|
|
* 用户未授权-发送验证码
|
|
|
* @param mobile 手机号
|
|
|
* @param area 国家码
|
|
|
* @param degrees 验证码
|
|
|
*/
|
|
|
function sendVerifyCode(area, mobile) {
|
|
|
return accountModel.sendSms(area, mobile);
|
|
|
function sendVerifyCode(area, mobile, degrees) {
|
|
|
return accountModel.sendSms(area, mobile, degrees);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 用户已授权-发送验证码
|
|
|
* @param mobile 手机号
|
|
|
* @param area 国家码
|
|
|
* @param degrees 验证码
|
|
|
*/
|
|
|
function sendVerifyCodeWithUnionId(area, mobile) {
|
|
|
return accountModel.sendCodeByMiniApp(area, mobile, getApp().getOpenID());
|
|
|
function sendVerifyCodeWithUnionId(area, mobile, degrees) {
|
|
|
return accountModel.sendCodeByMiniApp(area, mobile, getApp().getOpenID(), degrees);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 是否需要验证码
|
|
|
*/
|
|
|
function isNeedImgCheck() {
|
|
|
return accountModel.isNeedImgCheck();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取验证码按钮
|
|
|
* @param area
|
|
|
* @param mobile
|
|
|
* @param degrees 验证码
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
function getVerifyCode(area, mobile) {
|
|
|
function getVerifyCode(area, mobile, degrees) {
|
|
|
let app = getApp();
|
|
|
|
|
|
if (!app.globalData.unionID) {
|
|
|
return sendVerifyCode(area, mobile);
|
|
|
return sendVerifyCode(area, mobile, degrees);
|
|
|
}
|
|
|
|
|
|
return sendVerifyCodeWithUnionId(area, mobile);
|
|
|
return sendVerifyCodeWithUnionId(area, mobile, degrees);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -338,6 +348,7 @@ function getPhoneNumber(e) { |
|
|
|
|
|
export {
|
|
|
wechatAuthLogin,
|
|
|
isNeedImgCheck,
|
|
|
getVerifyCode,
|
|
|
bindMobileAction,
|
|
|
tapToLogin,
|
...
|
...
|
|