Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-10-19 09:46:55 +08:00
parent 163c91ffbe
commit 0ffa864c8f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 3 additions and 7 deletions

View file

@ -181,7 +181,7 @@ func GetCaptcha(c *gin.Context) {
} }
func CheckReadonly(c *gin.Context) { func CheckReadonly(c *gin.Context) {
if util.ReadOnly { if util.ReadOnly || IsReadOnlyRole(GetGinContextRole(c)) {
result := util.NewResult() result := util.NewResult()
result.Code = -1 result.Code = -1
result.Msg = Conf.Language(34) result.Msg = Conf.Language(34)

View file

@ -362,10 +362,6 @@ func GetLocalStorage() (ret map[string]interface{}) {
} }
func setLocalStorage(val interface{}) (err error) { func setLocalStorage(val interface{}) (err error) {
if util.ReadOnly {
return
}
dirPath := filepath.Join(util.DataDir, "storage") dirPath := filepath.Join(util.DataDir, "storage")
if err = os.MkdirAll(dirPath, 0755); err != nil { if err = os.MkdirAll(dirPath, 0755); err != nil {
logging.LogErrorf("create storage [local] dir failed: %s", err) logging.LogErrorf("create storage [local] dir failed: %s", err)