mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
🔒 内核接口 api/system/getConf 脱敏处理 Fix https://github.com/siyuan-note/siyuan/issues/6088
This commit is contained in:
parent
2fa3944459
commit
c048bde330
2 changed files with 35 additions and 1 deletions
|
|
@ -146,8 +146,15 @@ func getConf(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
maskedConf, err := model.GetMaskedConf()
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = "get conf failed: " + err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"conf": model.Conf,
|
||||
"conf": maskedConf,
|
||||
"start": start,
|
||||
}
|
||||
|
||||
|
|
@ -193,6 +200,10 @@ func setAccessAuthCode(c *gin.Context) {
|
|||
}
|
||||
|
||||
aac := arg["accessAuthCode"].(string)
|
||||
if model.MaskedAccessAuthCode == aac {
|
||||
aac = model.Conf.AccessAuthCode
|
||||
}
|
||||
|
||||
model.Conf.AccessAuthCode = aac
|
||||
model.Conf.Save()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue