Sys.go 764 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package Account
  2. import (
  3. "ERP_user/conf"
  4. "ERP_user/logs"
  5. "strings"
  6. )
  7. var ERP_Sys_prefix = make([]string, 0)
  8. var ERP_Sys_List = map[string]string{}
  9. func init() {
  10. ERP_Sys_List = make(map[string]string)
  11. if len(conf.ERP_Sys) > 0 {
  12. logs.Println("=========== 初始化系统信息 =========")
  13. // 除开用户系统的其他系统前缀
  14. sysList := strings.Split(conf.ERP_Sys, ",")
  15. for _, v := range sysList {
  16. k := strings.Split(v, "|")[0]
  17. ERP_Sys_List[k] = strings.Split(v, "|")[1]
  18. if k == conf.ERP_ACCOUNT_Sys {
  19. continue
  20. }
  21. // ERP_Sys_prefix ["ERP_AMS","ERP_"]
  22. ERP_Sys_prefix = append(ERP_Sys_prefix, k)
  23. }
  24. }
  25. }
  26. func Get_Sys_Name(code string) string {
  27. if v, ok := ERP_Sys_List[code]; ok {
  28. return v
  29. } else {
  30. return code
  31. }
  32. }