constants.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package utils
  2. import "io/fs"
  3. const (
  4. UserLoginSalt = "MiQM9YUdf89T2uIH" // 用户登录盐值
  5. DesKeySalt = "MxuqSoUrTAmyRd9fb0TtlrPk" // DesKey盐值
  6. )
  7. const (
  8. CACHE_ACCESS_TOKEN_LOGIN = "pc_eta_min_crm_ht:login:" //管理后台登录
  9. CACHE_ACCESS_TOKEN_LOGIN_NO_TRUST = "pc_eta_min_crm:login_ht:no_trust:" //管理后台登录(不可信登录态)
  10. )
  11. // 手机号,电子邮箱正则
  12. const (
  13. RegularMobile = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0-9])|(17[0-9])|(16[0-9])|(19[0-9]))\\d{8}$" //手机号码
  14. RegularEmail = `\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*` //匹配电子邮箱
  15. )
  16. // 常量定义
  17. const (
  18. FormatTime = "15:04:05" //时间格式
  19. FormatTimeHm = "15:04" //时间格式
  20. FormatDate = "2006-01-02" //日期格式
  21. FormatDateUnSpace = "20060102" //日期格式
  22. FormatDateTime = "2006-01-02 15:04:05" //完整时间格式
  23. HlbFormatDateTime = "2006-01-02_15:04:05.999" //完整时间格式
  24. FormatDateTimeUnSpace = "20060102150405" //完整时间格式
  25. FormatShortDateTimeUnSpace = "060102150405" //省去开头两位年份的时间格式
  26. EmptyDateTimeStr = "0000-00-00 00:00:00" //DateTime零值字符串
  27. EmptyDateStr = "0000-00-00" //Date零值字符串
  28. FormatMonthDayUnSpace = "0102" //日期格式
  29. FormatMonthDay = "01-02" //日期格式
  30. FormatYearMonthDate = "2006-01" //日期格式
  31. FormatYearDate = "2006" //日期格式
  32. PageSize15 = 15 //列表页每页数据量
  33. PageSize5 = 5
  34. PageSize10 = 10
  35. PageSize20 = 20
  36. PageSize30 = 30
  37. PageSize50 = 50
  38. PageSize100 = 100
  39. MaxDepartmentLevel = 3
  40. )
  41. // DIR_MOD 目录创建权限
  42. const DIR_MOD fs.FileMode = 0766 // Unix permission bits
  43. // 用户状态定义
  44. const (
  45. UserStatusNo = 0 //禁用
  46. UserStatusPotential = 1 //潜在用户
  47. UserStatusFormal = 2 //正式用户
  48. )
  49. // Pdf研报状态定义
  50. const (
  51. ReportStatusUp = 1 // 研报已发布
  52. ReportStatusDown = 2 // 研报未发布
  53. )
  54. const (
  55. STORAGESOURCE_OSS_NAME = "oss"
  56. STORAGESOURCE_MINIO_NAME = "minio"
  57. )
  58. // 免验证接口
  59. var NoAuthApiMap = map[string]bool{
  60. "/role/menu/buttons": true,
  61. "/role/menu/list": true,
  62. "/department/list": true,
  63. "/sys_user/reset_my_pass": true,
  64. "/chart_permission/list": true,
  65. "/user/change_list": true,
  66. "/classify/list": true,
  67. "/seller/list": true,
  68. "/user/readMessage": true,
  69. "/user/readMessages": true,
  70. "/user/message": true,
  71. "/sys/config": true,
  72. }
  73. var APPNAME string = "海通CRM"