feat: add resetpwd cmd -- fix init useless process
This commit is contained in:
@@ -23,7 +23,7 @@ func Run(args []string) {
|
||||
}
|
||||
|
||||
// 必须初始化环境与数据库才能修改密码
|
||||
bootstrap.New()
|
||||
bootstrap.InitBasic()
|
||||
|
||||
userService := services.NewUserService()
|
||||
adminUser := userService.GetUserByUsername("admin")
|
||||
|
||||
@@ -21,10 +21,16 @@ type App struct {
|
||||
}
|
||||
|
||||
func New() *App {
|
||||
app := InitBasic()
|
||||
app.initRouter()
|
||||
return app
|
||||
}
|
||||
|
||||
// InitBasic 初始化基础环境(配置和数据库),不启动后台服务和路由
|
||||
func InitBasic() *App {
|
||||
app := &App{}
|
||||
app.initConfig()
|
||||
app.initDatabase()
|
||||
app.initRouter()
|
||||
return app
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user