index.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // * 默认主题颜色
  2. export const PRIMARY_COLOR = '#409eff'
  3. /**
  4. * 开发环境配置
  5. * Host 服务器地址
  6. */
  7. // 8.210.194.53
  8. // 139.99.63.178
  9. // 145.239.1.65 cwgchinese
  10. //103.148.59.49:18500
  11. //193.134.208.230
  12. const ht = window.location.protocol
  13. const ho = window.location.host.split('.')[1]
  14. const c = import.meta.env.VITE_APP_ENV
  15. let Host00, Host85, Host05, Host80
  16. switch (c) {
  17. // 测试环境
  18. case 'test':
  19. Host00 = ht + '//secure.' + ho + '.com'
  20. Host85 = ht + '//ad.' + ho + '.com'
  21. Host05 = ht + '//file.' + ho + '.com'
  22. Host80 = ht + '//secure.' + ho + '.com'
  23. // Host05 = "http://103.171.34.61:8705"
  24. break
  25. // 生产环境
  26. case 'production':
  27. Host00 = ht + '//secure.' + ho + '.com'
  28. Host85 = ht + '//ad.' + ho + '.com'
  29. Host05 = ht + '//file.' + ho + '.com'
  30. Host80 = ht + '//secure.' + ho + '.com'
  31. break
  32. default:
  33. // 开发环境
  34. Host00 = 'http://103.214.175.29:8000'
  35. Host85 = 'https://ad.44a5c8109e4.com'
  36. // Host85="http://103.171.34.61:8500" // 测试
  37. Host05 = 'http://103.171.34.61:8705'
  38. Host80 = 'http://192.168.0.30:8000'
  39. // Host85 = 'http://192.168.0.18:8500' // 高超本地
  40. Host85 = 'http://192.168.0.38:8501' // 孔向阳本地
  41. // Host85="http://192.168.0.30:8500"
  42. break
  43. }
  44. const config = {
  45. Host00,
  46. Host85,
  47. Host05,
  48. Host80,
  49. Code: {
  50. StatusOK: 200,
  51. StatusFail: 400,
  52. StatusSessionExpire: 600,
  53. StatusSNotFound: 404,
  54. },
  55. Pattern: {
  56. Email: /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/,
  57. Password:
  58. /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*([~!@&%$^\\(\\)#_]).*\\1.*\\1.*\\1)[A-Za-z0-9~!@&%$^\\(\\)#_]{8,16}$/,
  59. Password1: /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,15}$/,
  60. Phone: /^1(3|4|5|6|7|8|9)\d{9}$/,
  61. Tel: /^[0][1-9]{2,3}-[0-9]{5,10}$/,
  62. Num: /\d/,
  63. NonNegInt: /^[0-9]+?$/, //非负整数
  64. PosInt: /^[1-9]\d*$/, //正整数
  65. nonnegative: /^[0-9]+([.]{1}[0-9]{1,2})?$/, //非负数(最多两位小数)
  66. englishName: /^[^\u4e00-\u9fa5]+$/,
  67. },
  68. }
  69. // const dev = {
  70. // Host: "http://47.75.159.72:8000"
  71. // }
  72. // const build = {
  73. // Host: "http://192.168.2.2"
  74. // }
  75. //
  76. // if (process.env.NODE_ENV == 'dev') {
  77. // config.Host = dev.Host
  78. // } else {
  79. // config.Host = build.Host
  80. // }
  81. export default config