index.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. let ht = window.location.protocol;
  2. let ho = window.location.host.split('.')[1];
  3. ht = ht == 'http:' ? 'https:' : ht;
  4. ho = ho == '168' ? '44a5c8109e4' : ho;
  5. const config = {
  6. HostWs: "wss://ws." + ho + ".com",
  7. Host80: ht + "//secure." + ho + ".com",
  8. Host00: ht + "//ucard." + ho + ".com",
  9. Host85: ht + "//ucard." + ho + ".com",
  10. Host04: ht + "//pay." + ho + ".com",
  11. Host90: ht + "//data." + ho + ".com",
  12. HostShop: ht + "//shopcustom." + ho + ".com",
  13. HostShopImg: ht + "//shopmanager." + ho + ".com",
  14. Host87: ht + "//followup." + ho + ".com",
  15. Host05: ht + "//file." + ho + ".com",
  16. HostEnter: ht + "//ad." + ho + ".com",
  17. Code: {
  18. StatusOK: 200,
  19. StatusFail: 400,
  20. StatusSessionExpire: 600,
  21. StatusSNotFound: 404,
  22. },
  23. Pattern: {
  24. Email: /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i,
  25. Phone: /^1[3-9]\d{9}$/,
  26. Pin: /^(?!(\d)\1{5})(?!012345)(?!123456)(?!234567)(?!345678)(?!456789)(?!987654)(?!876543)(?!765432)(?!654321)(?!543210)\d{6}$/,
  27. Password: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,16}$/,
  28. Tel: /^0[1-9]{2,3}-\d{5,10}$/,
  29. Num: /\d/,
  30. NonNegInt: /^\d+$/, // 非负整数
  31. PosInt: /^[1-9]\d*$/, // 正整数
  32. nonnegative: /^\d+(\.\d{1,2})?$/, // 非负数(最多两位小数)
  33. englishName: /^[^\u4E00-\u9FA5]+$/,
  34. },
  35. };
  36. export default config;