mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-12-03 20:38:25 +08:00
fix: 解决密码过期仍能正常跳转的问题
This commit is contained in:
parent
9d65d2f4d6
commit
f24821abc8
@ -39,7 +39,7 @@ var AddTableHost = &gormigrate.Migration{
|
||||
return err
|
||||
}
|
||||
host := model.Host{
|
||||
Name: "localhost", Addr: "127.0.0.1", User: "root", Port: 22, GroupID: group.ID,
|
||||
Name: "localhost", Addr: "127.0.0.1", User: "root", Port: 22, AuthMode: "password", GroupID: group.ID,
|
||||
}
|
||||
if err := tx.Create(&host).Error; err != nil {
|
||||
return err
|
||||
|
@ -11,7 +11,7 @@ type AppRouter struct {
|
||||
|
||||
func (a *AppRouter) InitAppRouter(Router *gin.RouterGroup) {
|
||||
appRouter := Router.Group("apps")
|
||||
appRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
|
||||
appRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
||||
|
||||
baseApi := v1.ApiGroupApp.BaseApi
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ type NginxRouter struct {
|
||||
|
||||
func (a *NginxRouter) InitNginxRouter(Router *gin.RouterGroup) {
|
||||
groupRouter := Router.Group("openresty")
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
||||
|
||||
baseApi := v1.ApiGroupApp.BaseApi
|
||||
{
|
||||
|
@ -9,13 +9,16 @@ import (
|
||||
type SettingRouter struct{}
|
||||
|
||||
func (s *SettingRouter) InitSettingRouter(Router *gin.RouterGroup) {
|
||||
router := Router.Group("settings").
|
||||
Use(middleware.JwtAuth()).
|
||||
Use(middleware.SessionAuth())
|
||||
settingRouter := Router.Group("settings").
|
||||
Use(middleware.JwtAuth()).
|
||||
Use(middleware.SessionAuth()).
|
||||
Use(middleware.PasswordExpired())
|
||||
baseApi := v1.ApiGroupApp.BaseApi
|
||||
{
|
||||
settingRouter.POST("/search", baseApi.GetSettingInfo)
|
||||
router.POST("/search", baseApi.GetSettingInfo)
|
||||
settingRouter.GET("/search/available", baseApi.GetSystemAvailable)
|
||||
settingRouter.POST("/expired/handle", baseApi.HandlePasswordExpired)
|
||||
settingRouter.POST("/update", baseApi.UpdateSetting)
|
||||
|
@ -11,7 +11,7 @@ type WebsiteRouter struct {
|
||||
|
||||
func (a *WebsiteRouter) InitWebsiteRouter(Router *gin.RouterGroup) {
|
||||
groupRouter := Router.Group("websites")
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
||||
|
||||
baseApi := v1.ApiGroupApp.BaseApi
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ type WebsiteAcmeAccountRouter struct {
|
||||
|
||||
func (a *WebsiteAcmeAccountRouter) InitWebsiteAcmeAccountRouter(Router *gin.RouterGroup) {
|
||||
groupRouter := Router.Group("websites/acme")
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
||||
|
||||
baseApi := v1.ApiGroupApp.BaseApi
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ type WebsiteDnsAccountRouter struct {
|
||||
|
||||
func (a *WebsiteDnsAccountRouter) InitWebsiteDnsAccountRouter(Router *gin.RouterGroup) {
|
||||
groupRouter := Router.Group("websites/dns")
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
||||
|
||||
baseApi := v1.ApiGroupApp.BaseApi
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ type WebsiteGroupRouter struct {
|
||||
|
||||
func (a *WebsiteGroupRouter) InitWebsiteGroupRouter(Router *gin.RouterGroup) {
|
||||
groupRouter := Router.Group("websites/groups")
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
||||
|
||||
baseApi := v1.ApiGroupApp.BaseApi
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ type WebsiteSSLRouter struct {
|
||||
|
||||
func (a *WebsiteSSLRouter) InitWebsiteSSLRouter(Router *gin.RouterGroup) {
|
||||
groupRouter := Router.Group("websites/ssl")
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
|
||||
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
||||
|
||||
baseApi := v1.ApiGroupApp.BaseApi
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user