feat(auth): 重构认证模块,添加OTP发送和登录功能
This commit is contained in:
@@ -2,6 +2,7 @@ package v1
|
||||
|
||||
import (
|
||||
"quyun/v2/app/middlewares"
|
||||
"quyun/v2/providers/storage"
|
||||
|
||||
"go.ipao.vip/atom"
|
||||
"go.ipao.vip/atom/container"
|
||||
@@ -10,13 +11,6 @@ import (
|
||||
)
|
||||
|
||||
func Provide(opts ...opt.Option) error {
|
||||
if err := container.Container.Provide(func() (*Auth, error) {
|
||||
obj := &Auth{}
|
||||
|
||||
return obj, nil
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := container.Container.Provide(func() (*Common, error) {
|
||||
obj := &Common{}
|
||||
|
||||
@@ -39,7 +33,6 @@ func Provide(opts ...opt.Option) error {
|
||||
return err
|
||||
}
|
||||
if err := container.Container.Provide(func(
|
||||
auth *Auth,
|
||||
common *Common,
|
||||
content *Content,
|
||||
creator *Creator,
|
||||
@@ -50,7 +43,6 @@ func Provide(opts ...opt.Option) error {
|
||||
user *User,
|
||||
) (contracts.HttpRoute, error) {
|
||||
obj := &Routes{
|
||||
auth: auth,
|
||||
common: common,
|
||||
content: content,
|
||||
creator: creator,
|
||||
@@ -68,8 +60,12 @@ func Provide(opts ...opt.Option) error {
|
||||
}, atom.GroupRoutes); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := container.Container.Provide(func() (*Storage, error) {
|
||||
obj := &Storage{}
|
||||
if err := container.Container.Provide(func(
|
||||
storage *storage.Storage,
|
||||
) (*Storage, error) {
|
||||
obj := &Storage{
|
||||
storage: storage,
|
||||
}
|
||||
|
||||
return obj, nil
|
||||
}); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user