作者 yangfu

短信验证码 999512

... ... @@ -15,6 +15,7 @@ type Config struct {
MiniAuth config.Auth
Migrate bool `json:",optional,default=true"`
ApiAuth ApiService
DebugSmsCode string `json:",optional,default=999512"`
}
type ApiService struct {
... ...
... ... @@ -121,8 +121,12 @@ func (c WxClientLogin) PhoneSmsCodeLogin(phone string, code string) (*domain.Log
var (
users []*domain.User
err error
skipCheckSmsCode bool = false
)
if _, err = c.l.svcCtx.SmsService.CheckSmsCode(c.l.ctx, smslib.RequestCheckSmsCode{Phone: phone, Code: code}); err != nil {
if c.l.svcCtx.Config.DebugSmsCode != "" && c.l.svcCtx.Config.DebugSmsCode == code {
skipCheckSmsCode = true
}
if _, err = c.l.svcCtx.SmsService.CheckSmsCode(c.l.ctx, smslib.RequestCheckSmsCode{Phone: phone, Code: code}); err != nil && !skipCheckSmsCode {
return nil, xerr.NewErrMsgErr(err.Error(), err)
}
conn := c.l.svcCtx.DefaultDBConn()
... ...
-- 用户表
-- (公司ID)索引
CREATE INDEX IF NOT EXISTS idx_user_company_id ON "public"."user" USING btree(company_id);
-- (手机号)索引
CREATE INDEX IF NOT EXISTS idx_user_phone ON "public"."user" USING btree(phone);
-- 用户关注表
-- (发起人)索引
CREATE INDEX IF NOT EXISTS idx_user_follow_from_user_id on "public".user_follow USING btree(from_user_id);
-- 角色表
-- (公司ID)索引
CREATE INDEX IF NOT EXISTS idx_role_company_id ON "public"."role" USING btree(company_id);
\ No newline at end of file
... ...