urlUtils.ts 940 B

1234567891011121314151617181920212223242526272829303132333435
  1. export function vaildUrl() {
  2. const url: string = window.location.href;
  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.href;
  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. }