Commit 5a3a3112 by guomingpang

feat:微信用户审核bug1

parent e5ebb51d
......@@ -41,7 +41,7 @@ if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
}
// Tools like Cloud9 rely on this.
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3002;
const HOST = process.env.HOST || '0.0.0.0';
if (process.env.HOST) {
......
......@@ -61,12 +61,17 @@ class Authorize extends React.Component {
}
Service.hades('/anon/hades/bindWeChat',params).then((res)=>{
if(res.success){
if(res.auditSwitch === 'OPEN'){
window.RCHistory.replace('/wechat-audit');
}else{
this.setState({
hasBindWechat:true,
headImgUrl:res.result.headImgUrl,
ticketState:"AUTH_SUCCESS"
},()=>{this.changeCodeState()})
}
}
})
}
......
import React from "react";
import { createHashHistory } from 'history';
import { Route, Router, Switch ,Redirect} from 'react-router-dom';
import EmptyPage from './EmptyPage'
import WechatAudit from './WechatAudit'
import WechatAuditResult from "./WechatAuditResult";
const XMHistory = createHashHistory();
window.XMHistory = XMHistory;
const App =function(){
return <Router history={XMHistory}>
<Switch>
<Redirect from='/' to='/empty' exact />
<Route exact path='/empty' render={() => <EmptyPage />} />
<Route path='/wechat-audit' render={() => <WechatAudit />} />
<Route path='/wechat-audit-result' render={() => <WechatAuditResult />} />
</Switch>
</Router>
}
export default App;
\ No newline at end of file
import React, { useState } from "react";
import { Form, Button, Input } from "antd";
import './WechatAudit.less'
const WechatAudit = function () {
const [nickName, setNickName] = useState("");
function saveUserInfo(){
window.location.href =window.location.origin + window.location.pathname + '#/wechat-audit-result'
}
return (
<div className='wechat-audit'>
<div className="box">
<div className="title">登录申请</div>
<div className="tip">
请输入您的真实姓名并提交申请,通过申请后即可登录学院
</div>
<Form>
<div className="name-item">
<Input
placeholder="请输入姓名,最多6个字符"
style={{ width: 300, height: 32 }}
value={nickName}
maxLength={6}
onChange={(e) => {
setNickName(e.target.value);
}}
/>
</div>
<div className="save-btn">
<Button
type="primary"
onClick={() => {
saveUserInfo();
}}
>
申请加入
</Button>
</div>
</Form>
</div>
</div>
);
};
export default WechatAudit;
.wechat-audit{
background: #F4F6FA;
min-height: 100vh;
width: 100%;
max-width: 1200px;
display: flex;
justify-content: center;
text-align: center;
margin: 0 auto;
.box{
margin-top: 2.02rem;
.title{
font-size: .34rem;
color: #333;
margin-bottom: .2rem;
}
.tip{
font-size: .26rem;
color: #999;
margin-bottom: .32rem;
}
.name-item input{
width: 100% !important;
height: 44px !important;
font-size: .3rem !important;
}
.save-btn{
button{
width: 100% !important;
height: 44px !important;
margin-top: .6rem;
font-size: .3rem !important;
}
}
}
}
\ No newline at end of file
import React, { useEffect, useState } from "react";
import { debounce } from "underscore";
import "./WechatAuditResult.less";
const WechatAuditResult = function () {
const [status, setStatus] = useState("waiting");
useEffect(() => {
getStatus("waiting");
}, []);
function getStatus(arr) {
setStatus(arr);
}
return (
<div className="wechat-audit-result">
<Choose>
<When condition={status === "waiting"}>
<div className="box">
<img
className="img"
src="https://image.xiaomaiketang.com/xm/6isseQhcTh.png"
alt=""
/>
<div className="desc">申请审核中</div>
<div className="tip">
您已成功提交申请,待系统审核通过后,才能登录学院
</div>
<div
className="btn reload"
onClick={debounce(() => getStatus("fail"), 3000, true)}
>
刷新
</div>
</div>
</When>
<Otherwise>
<div className="box">
<img
className="img"
src="https://image.xiaomaiketang.com/xm/cQzJDFZDsp.png"
alt=""
/>
<div className="desc">审核失败</div>
<div className="tip">
请输入您的真实姓名并提交申请,通过申请后就可以登录学院
</div>
<div
className="btn reload"
onClick={() => {
window.location.href =
window.location.origin +
window.location.pathname +
"#/wechat-audit";
}}
>
{" "}
重新申请
</div>
</div>
</Otherwise>
</Choose>
</div>
);
};
export default WechatAuditResult;
.wechat-audit-result{
background: #F4F6FA;
min-height: 100vh;
width: 100%;
max-width: 1200px;
display: flex;
justify-content: center;
text-align: center;
margin: 0 auto;
.box{
margin-top: 3.42rem;
.img{
width: 1.2rem;
height: 1.2rem;
}
.desc{
font-size: #333;
font-size: .3rem;
font-weight: 500;
margin:.32rem 0 .2rem;
}
.tip{
font-size: .26rem;
color: #999;
width: 85%;
margin: 0 auto;
line-height: 1.8;
}
.btn{
color: #2966ff;
font-size: .3rem;
cursor: pointer;
margin-top: 1.6rem;
&:active{
opacity: 0.7;
}
}
}
}
\ No newline at end of file
......@@ -11,6 +11,8 @@ import { MenuConfig } from '@/routes/interface';
import Authorize from '@/modules/authorize';
import WorkWxAuthorize from '@/modules/workWxAuthorize';
import EmptyPage from '@/modules/empty-page/EmptyPage'
import WechatAudit from '@/modules/wechat-audit/WechatAudit';
import WechatAuditResult from '@/modules/wechat-audit/WechatAuditResult';
const CloudClassConfig: MenuConfig = {
key: 'cloudClass',
name: '云课堂',
......@@ -33,6 +35,18 @@ const CloudClassConfig: MenuConfig = {
path: '/empty-page',
component:EmptyPage,
},
{
key: 'wechat-audit',
name: '',
path: '/wechat-audit',
component: WechatAudit,
},
{
key: 'wechat-audit-result',
name: '提示',
path: '/wechat-audit-result',
component:WechatAuditResult,
},
]
};
export default CloudClassConfig;
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