mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-05-02 04:45:19 +08:00
单体应用初始化的时候自动进入修改用户名密码界面
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
"github.com/iwind/TeaGo/lists"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
@@ -121,6 +122,19 @@ func (this *IndexAction) RunGet(params struct {
|
||||
// 删除Cookie
|
||||
loginutils.UnsetCookie(this.Object())
|
||||
|
||||
// 检查单体实例是否已经被初始化
|
||||
{
|
||||
settingResp, err := this.RPC().SysSettingRPC().ReadSysSetting(this.AdminContext(), &pb.ReadSysSettingRequest{Code: systemconfigs.SettingCodeStandaloneInstanceInitialized})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
if string(settingResp.ValueJSON) == "0" {
|
||||
this.RedirectURL("/initPassword")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user