Commit 2a993011 by zhujian

'fixed'

parent ccf77bc2
......@@ -37,17 +37,27 @@
line-height: 24px;
margin-top: 12px;
}
.hide {
display: none;
}
</style>
</head>
<body>
<div class="box">
<div>
<div id='success' class='hide'>
<img src="https://image.xiaomaiketang.com/xm/iRkcMHPHba.png" style='width:60px' alt="">
<p>
扫码成功
</p>
</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>
......@@ -101,7 +111,15 @@
dataType: 'json',
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 qrcode from '@/core/qrcode/qrcode.js'
import Service from "@/common/js/service";
import User from '@/common/js/user';
import './WechatLogin.less'
const Logo = require("@/common/images/logo.png")
declare var location: any;
......@@ -61,9 +62,29 @@ export default function WechatLogin(props: any) {
if (leftTime == 60 || !ticket) {
return
}
Service.Hades('anon/hades/getTicketState', {
ticket
})
useEffect(() => {
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])
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