فهرست منبع

fix:kcy认证新增接口

ALIEZ 5 روز پیش
والد
کامیت
d5c6ab30ce
2فایلهای تغییر یافته به همراه44 افزوده شده و 2 حذف شده
  1. 22 1
      kycAuth.js
  2. 22 1
      vu/kycAuth.js

+ 22 - 1
kycAuth.js

@@ -223,12 +223,28 @@ let vm = new Vue({
       lang:{},
 
       imgUrl:'',
-      ho:''
+      ho:'',
+      externalUserId:''
     },
   computed: {
     
   },
     methods: {
+      getQueryStringRegExp(name){
+        var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i");
+        if (reg.test(location.href)) return unescape(RegExp.$2.replace(/\+/g, " "));
+        return "";
+      },
+      verifyIp() {
+        if (!this.externalUserId) return;
+        axios.post(this.imgUrl + '/custom/verify/ip', {
+          externalUserId: this.externalUserId
+        }).then(res => {
+          if (res.data.code != 200) {
+            this.$message.error(res.data.msg);
+          }
+        }).catch(function () {});
+      },
       // 语言切换函数
       chooseLang(key) {
         this.lang = content[key];
@@ -239,6 +255,11 @@ let vm = new Vue({
     },
     mounted() {
       this.ho = window.location.host.split('.')[1];
+      var hostParts = window.location.host.split('.');
+      var tld = hostParts.slice(2).join('.') || 'com';
+      this.imgUrl = 'https://secure.' + this.ho + '.' + tld;
+      this.externalUserId = this.getQueryStringRegExp('externalUserId');
+      this.verifyIp();
 
       if (sessionStorage.getItem("lang")) {
         this.language = sessionStorage.getItem("lang"),

+ 22 - 1
vu/kycAuth.js

@@ -223,12 +223,28 @@ let vm = new Vue({
       lang:{},
 
       imgUrl:'',
-      ho:''
+      ho:'',
+      externalUserId:''
     },
   computed: {
     
   },
     methods: {
+      getQueryStringRegExp(name){
+        var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i");
+        if (reg.test(location.href)) return unescape(RegExp.$2.replace(/\+/g, " "));
+        return "";
+      },
+      verifyIp() {
+        if (!this.externalUserId) return;
+        axios.post(this.imgUrl + '/custom/verify/ip', {
+          externalUserId: this.externalUserId
+        }).then(res => {
+          if (res.data.code != 200) {
+            this.$message.error(res.data.msg);
+          }
+        }).catch(function () {});
+      },
       // 语言切换函数
       chooseLang(key) {
         this.lang = content[key];
@@ -239,6 +255,11 @@ let vm = new Vue({
     },
     mounted() {
       this.ho = window.location.host.split('.')[1];
+      var hostParts = window.location.host.split('.');
+      var tld = hostParts.slice(2).join('.') || 'com';
+      this.imgUrl = 'https://secure.' + this.ho + '.' + tld;
+      this.externalUserId = this.getQueryStringRegExp('externalUserId');
+      this.verifyIp();
 
       if (sessionStorage.getItem("lang")) {
         this.language = sessionStorage.getItem("lang"),