Add webBasePath update feature to CLI

This commit is contained in:
Maisam
2024-05-24 22:43:34 +03:30
parent ca4f83c7b1
commit 76ac6f4173
2 changed files with 21 additions and 2 deletions
+10
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 {