You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
499 B

  1. package model
  2. import (
  3. "gin-vue-admin/global"
  4. "gin-vue-admin/init"
  5. "gin-vue-admin/utils"
  6. )
  7. //配置文件结构体
  8. type System struct {
  9. Config init.Config
  10. }
  11. //读取配置文件
  12. func (s *System) GetSystemConfig() (err error, conf init.Config) {
  13. return nil, global.GVA_CONFIG
  14. }
  15. //设置配置文件
  16. func (s *System) SetSystemConfig() (err error) {
  17. confs := utils.StructToMap(s.Config)
  18. for k, v := range confs {
  19. global.GVA_VP.Set(k, v)
  20. }
  21. err = global.GVA_VP.WriteConfig()
  22. return err
  23. }