pre.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. let pre = new Vue({
  2. el: "#pre",
  3. data: {
  4. imgUrl: '',
  5. ho: ''
  6. },
  7. computed: {
  8. },
  9. methods: {
  10. //获取当前国家编码
  11. async getCountryMsg() {
  12. axios.get(this.imgUrl + '/country/get', {
  13. //参数
  14. }).then(res => {//请求成功后的处理函数
  15. if (res.data.code == 200) {
  16. if ((res.data.msg == "GB"||res.data.msg == "IE")&&res.data.data.indexOf('//195.224.141.218') == -1) {
  17. // window.location.href = 'https://www.cwgmarkets.co.uk';
  18. window.location.href = 'https://www.cwgmarkets.co.uk'
  19. } else {
  20. setTimeout(function() {
  21. document.getElementById("pre").style.display = 'none';
  22. }, 500);
  23. // document.getElementById("preIframe").style.display = 'none';
  24. }
  25. // document.getElementById("preIframe").style.display = 'none';
  26. } else {
  27. document.getElementById("pre").style.display = 'none'
  28. // document.getElementById("preIframe").style.display = 'none';
  29. this.$message.error(res.data.msg);
  30. }
  31. }).catch(err => {//请求失败后的处理函数
  32. })
  33. },
  34. },
  35. mounted() {
  36. this.ho = window.location.host.split('.')[1];
  37. this.imgUrl = window.location.origin;
  38. // this.imgUrl = 'http://193.134.208.211:8000';
  39. this.getCountryMsg()
  40. },
  41. destroyed() {
  42. },
  43. });