|
@@ -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'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
-}
|
|
|
+ }
|
|
|
+});
|