constants.go 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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:login:" //管理后台登录
  9. CACHE_ACCESS_TOKEN_LOGIN_NO_TRUST = "pc_eta_min_crm:login: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. ReportTypeEta = 1 // eta研报
  56. ReportTypePdf = 2 // pdf研报
  57. )
  58. const (
  59. STORAGESOURCE_OSS_NAME = "oss"
  60. STORAGESOURCE_MINIO_NAME = "minio"
  61. )
  62. // 免验证接口
  63. var NoAuthApiMap = map[string]bool{
  64. "/role/menu/buttons": true,
  65. "/role/menu/list": true,
  66. "/department/list": true,
  67. "/sys_user/reset_my_pass": true,
  68. "/chart_permission/list": true,
  69. "/user/change_list": true,
  70. "/classify/list": true,
  71. "/seller/list": true,
  72. "/seller/department/list": true,
  73. }
  74. var APPNAME string = "东吴CRM"