fix: Fix the issue where the demo configuration takes effect (#9468)

This commit is contained in:
ssongliu
2025-07-09 02:10:49 +00:00
committed by GitHub
parent 383bdd5f15
commit 355e656caa
3 changed files with 7 additions and 1 deletions
+1
View File
@@ -1,6 +1,7 @@
base:
install_dir: /opt
mode: dev
is_demo: false
remote_url:
app_repo: https://apps-assets.fit2cloud.com
-1
View File
@@ -50,7 +50,6 @@ func Init() {
}
global.CONF = serverConfig
global.CONF.Base.IsDemo = v.GetBool("system.is_demo")
initBaseInfo()
global.Viper = v
+6
View File
@@ -276,6 +276,12 @@ func (b *BaseApi) WsSsh(c *gin.Context) {
}
defer wsConn.Close()
if global.CONF.Base.IsDemo {
if wshandleError(wsConn, errors.New(" demo server, prohibit this operation!")) {
return
}
}
id, err := strconv.Atoi(c.Query("id"))
if wshandleError(wsConn, errors.WithMessage(err, "invalid param id in request")) {
return