urlUtils.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. export function vaildUrl() {
  2. const url: string = window.location.hostname;
  3. let returnUrl = '';
  4. if (/test/.test(url)) {
  5. // dev 环境
  6. returnUrl = 'https://test.kt.colexiu.com';
  7. } else if (/dev/.test(url)) {
  8. returnUrl = 'https://dev.kt.colexiu.com';
  9. } else if (/localhost/.test(url)) {
  10. // //本地环境
  11. returnUrl = 'https://test.kt.colexiu.com';
  12. } else {
  13. // 默认dev环境
  14. returnUrl = 'https://kt.colexiu.com';
  15. }
  16. return returnUrl;
  17. }
  18. export function vaildMusicScoreUrl() {
  19. const url: string = window.location.hostname;
  20. let returnUrl = '';
  21. if (/test/.test(url)) {
  22. // dev 环境
  23. returnUrl = 'https://test.kt.colexiu.com';
  24. } else if (/dev/.test(url)) {
  25. returnUrl = 'https://dev.kt.colexiu.com';
  26. } else if (/localhost/.test(url)) {
  27. // //本地环境
  28. returnUrl = 'https://test.kt.colexiu.com';
  29. } else {
  30. returnUrl = 'https://mec.colexiu.com';
  31. }
  32. return returnUrl;
  33. }
  34. export function vaildPPTUrl() {
  35. const url: string = window.location.hostname;
  36. let returnUrl = '';
  37. if (/test/.test(url)) {
  38. returnUrl = 'https://test.kt.colexiu.com/classroom-ppt';
  39. } else if (/dev/.test(url)) {
  40. returnUrl = 'https://dev.kt.colexiu.com/classroom-ppt';
  41. } else if (/localhost/.test(url)) {
  42. returnUrl = 'http://192.168.3.122:9527';
  43. } else {
  44. returnUrl = 'https://mec.colexiu.com/classroom-ppt';
  45. }
  46. return returnUrl;
  47. }