Commit 2a993011 by zhujian

'fixed'

parent ccf77bc2
...@@ -37,17 +37,27 @@ ...@@ -37,17 +37,27 @@
line-height: 24px; line-height: 24px;
margin-top: 12px; margin-top: 12px;
} }
.hide {
display: none;
}
</style> </style>
</head> </head>
<body> <body>
<div class="box"> <div class="box">
<div> <div id='success' class='hide'>
<img src="https://image.xiaomaiketang.com/xm/iRkcMHPHba.png" style='width:60px' alt=""> <img src="https://image.xiaomaiketang.com/xm/iRkcMHPHba.png" style='width:60px' alt="">
<p> <p>
扫码成功 扫码成功
</p> </p>
</div> </div>
<div id="error" class='hide'>
<img src="https://image.xiaomaiketang.com/xm/iRkcMHPHba.png" style='width:60px' alt="">
<p id='message'>
</p>
</div>
</div> </div>
...@@ -101,7 +111,15 @@ ...@@ -101,7 +111,15 @@
dataType: 'json', dataType: 'json',
success(res, status, xhr) { success(res, status, xhr) {
if (res.code == 200) {
$('#success').show()
} else {
$('#error').show();
var message = res.message.split(',').join('<br />')
$('#message').html(message)
}
}, },
}; };
......
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import qrcode from '@/core/qrcode/qrcode.js' import qrcode from '@/core/qrcode/qrcode.js'
import Service from "@/common/js/service"; import Service from "@/common/js/service";
import User from '@/common/js/user';
import './WechatLogin.less' import './WechatLogin.less'
const Logo = require("@/common/images/logo.png") const Logo = require("@/common/images/logo.png")
declare var location: any; declare var location: any;
...@@ -61,9 +62,29 @@ export default function WechatLogin(props: any) { ...@@ -61,9 +62,29 @@ export default function WechatLogin(props: any) {
if (leftTime == 60 || !ticket) { if (leftTime == 60 || !ticket) {
return return
} }
Service.Hades('anon/hades/getTicketState', { useEffect(() => {
ticket if (leftTime == 60 || !ticket) {
}) return
}
Service.Hades('anon/hades/getTicketState', {
ticket
}).then((res: any) => {
if (res.result === 'AUTH_SUCCESS') {
Service.Hades('anon/hades/getTicketWXWorkLogin', {
ticket
}).then((_res: any) => {
User.setUserId(_res.result.loginInfo.userId);
User.setToken(_res.result.loginInfo.xmToken);
window.RCHistory.push({
pathname: `/switch-route`,
})
})
}
})
}, [leftTime])
}, [leftTime]) }, [leftTime])
return <div className='wechatLoginBox'> return <div className='wechatLoginBox'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment