Add webBasePath update feature to CLI (#2300)

This commit is contained in:
Maisam
2024-05-25 11:45:06 +03:30
committed by GitHub
parent bd2d7bce62
commit c422214ae8
2 changed files with 21 additions and 2 deletions

View File

@@ -352,6 +352,16 @@ func (s *SettingService) GetSecret() ([]byte, error) {
return []byte(secret), err
}
func (s *SettingService) SetBasePath(basePath string) error {
if !strings.HasPrefix(basePath, "/") {
basePath = "/" + basePath
}
if !strings.HasSuffix(basePath, "/") {
basePath += "/"
}
return s.setString("webBasePath", basePath)
}
func (s *SettingService) GetBasePath() (string, error) {
basePath, err := s.getString("webBasePath")
if err != nil {