作者 yangfu

短信验证码 999512

... ... @@ -10,11 +10,12 @@ import (
type Config struct {
rest.RestConf
config.Config
Redis redis.RedisConf `json:",optional"`
SystemAuth config.Auth
MiniAuth config.Auth
Migrate bool `json:",optional,default=true"`
ApiAuth ApiService
Redis redis.RedisConf `json:",optional"`
SystemAuth config.Auth
MiniAuth config.Auth
Migrate bool `json:",optional,default=true"`
ApiAuth ApiService
DebugSmsCode string `json:",optional,default=999512"`
}
type ApiService struct {
... ...
... ... @@ -119,10 +119,14 @@ func (c WxClientLogin) PhonePasswordLogin(phone string, password string) (*domai
func (c WxClientLogin) PhoneSmsCodeLogin(phone string, code string) (*domain.LoginInfo, error) {
var (
users []*domain.User
err error
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
... ...