luohailiang 2 gadi atpakaļ
vecāks
revīzija
9ec5148147
2 mainītis faili ar 54 papildinājumiem un 42 dzēšanām
  1. 53 41
      static/scripts/transfer.js
  2. 1 1
      transfer.html

+ 53 - 41
static/scripts/transfer.js

@@ -7,53 +7,65 @@ function setCookie(name, value, day, path, domain) {
     if (domain) str += 'domain=' + domain;
     document.cookie = str;
 }
+new Vue({
+    el:'#transfer',
+    data() {
+        return {
 
-let zlb_token = '';
-if (location.search.includes('zlb_token')) {
-    zlb_token = location.search.substring(11);
-    const requestURL = 'https://tyyxopenapi.txhlwxx.com/openapi/oauth/zlb/checkticket.php';
-    $.ajax({
-        url: requestURL,
-        async: false,
-        type: "POST",
-        timeout: 30000,
-        dataType: 'json',
-        data: {
-            type: 'login',
-            zlb_token: zlb_token,
-            client:'h5'
-        },
-        success: (res) => {
-            if (res.code === '1') {
-                localStorage.setItem('userInfo', JSON.stringify(res.data));
-                setCookie('token', res.data.token, 30, '/');
-                setTimeout(() => {
-                    location.href = './index.html';
-                }, 500)
-            } else if(res.code === '501'){
-                this.$message({
-                    message:res.msg,
-                    type: 'warning',
-                    showClose: true,
-                    duration: '1500',
-                    onClose:()=>{
+        }
+    },
+    methods:{
+
+    },
+    mounted() {
+        let zlb_token = '';
+        if (location.search.includes('zlb_token')) {
+            zlb_token = location.search.substring(11);
+            const requestURL = 'https://tyyxopenapi.txhlwxx.com/openapi/oauth/zlb/checkticket.php';
+            $.ajax({
+                url: requestURL,
+                async: false,
+                type: "POST",
+                timeout: 30000,
+                dataType: 'json',
+                data: {
+                    type: 'login',
+                    zlb_token: zlb_token,
+                    client:'h5'
+                },
+                success: (res) => {
+                    if (res.code === '1') {
                         localStorage.setItem('userInfo', JSON.stringify(res.data));
                         setCookie('token', res.data.token, 30, '/');
                         setTimeout(() => {
                             location.href = './index.html';
                         }, 500)
-                    },
+                    } else if(res.code === '501'){
+                        this.$message({
+                            message:res.msg,
+                            type: 'warning',
+                            showClose: true,
+                            duration: '1500',
+                            onClose:()=>{
+                                localStorage.setItem('userInfo', JSON.stringify(res.data));
+                                setCookie('token', res.data.token, 30, '/');
+                                setTimeout(() => {
+                                    location.href = './index.html';
+                                }, 500)
+                            },
 
-                });
+                        });
 
-            } else {
-                this.$message({
-                    message: res.msg,
-                    type: 'error',
-                    showClose: true,
-                    duration: '1500'
-                });
-            }
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error',
+                            showClose: true,
+                            duration: '1500'
+                        });
+                    }
+                }
+            });
         }
-    });
-}
+    }
+});

+ 1 - 1
transfer.html

@@ -24,7 +24,7 @@
 <script src="static/scripts/axios.min.js"></script>
 <script src="static/scripts/qs.min.js"></script>
 <script src="static/element/index.js"></script>
-<script src="static/scripts/transfer.js?v=202212291111"></script>
+<script src="static/scripts/transfer.js?v=202212292222"></script>
 <script>
     var _hmt = _hmt || [];
     (function() {