forked from Gitlink/forgeplus-react
Merge branch 'pre_dev_military' of http://106.75.45.236:3000/tongChong/forgeplus-react into pre_dev_military
This commit is contained in:
commit
d0e1603bbf
|
@ -25,7 +25,7 @@ if (isDev) {
|
|||
}
|
||||
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
||||
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
|
||||
window.location.search.indexOf('debug=a') !== -1 ? 'a' : parsed.debug || 'admin'
|
||||
window.location.search.indexOf('debug=a') !== -1 ? 'a' : parsed.debug || ''
|
||||
}
|
||||
window._debugType = debugType;
|
||||
export function initAxiosInterceptors(props) {
|
||||
|
|
|
@ -139,6 +139,16 @@ const GatheringList = Loadable({
|
|||
})
|
||||
|
||||
const Managements = (propsF) => {
|
||||
useEffect(()=>{
|
||||
const {current_user, history} = propsF;
|
||||
if(current_user && current_user.login){
|
||||
if(!current_user.admin){
|
||||
history.push('/403')
|
||||
}
|
||||
}else{
|
||||
propsF.showLoginDialog();
|
||||
}
|
||||
},[])
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix managementMain">
|
||||
|
|
|
@ -31,6 +31,8 @@ export default Form.create()(({form}) => {
|
|||
const [selectedMenuFa, setSelectedMenuFa] = useState(undefined);
|
||||
// 一级菜单项
|
||||
let oneTree = [];
|
||||
// 二级菜单项
|
||||
let twoTree = [];
|
||||
|
||||
const helper = useCallback(
|
||||
(label, name, rules, widget, initialValue) => (
|
||||
|
@ -216,7 +218,9 @@ export default Form.create()(({form}) => {
|
|||
listMenu(roleId).then(response=>{
|
||||
if(response && response.message=='success'){
|
||||
// 过滤掉一级菜单项
|
||||
const keys = response.data.map(item=>{return oneTree.indexOf(item.key.toString()) === -1 ? item.key.toString() : null});
|
||||
const keys = response.data.map(item=>{
|
||||
return (oneTree.indexOf(item.key.toString()) !== -1 || twoTree.indexOf(item.key.toString()) !== -1) ? null : item.key.toString()
|
||||
});
|
||||
setSelectedMenu(keys);
|
||||
setRoleId(roleId);
|
||||
setMenuModal(true);
|
||||
|
@ -239,7 +243,17 @@ export default Form.create()(({form}) => {
|
|||
useEffect(()=>{
|
||||
treeList().then(response=>{
|
||||
if(response && response.message=='success'){
|
||||
oneTree = response.data.map(item=>{return item.key.toString()});
|
||||
// 遍历菜单数组找到所有的一级、二级菜单项(原因: antd tree checkedKeys属性如果包含了上级菜单,下级菜单默认是勾选的)
|
||||
response.data.map(item=>{
|
||||
oneTree.push(item.key.toString())
|
||||
if(item.children && item.children.length){
|
||||
item.children.map(i =>{
|
||||
if(i.children && i.children.length){
|
||||
twoTree.push(i.key.toString());
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
setMenuTreeData(response.data);
|
||||
}
|
||||
}).finally(()=>{
|
||||
|
|
|
@ -165,27 +165,35 @@ const Competition = (props) => {
|
|||
|
||||
// 关注和取消关注
|
||||
function follow1(){
|
||||
follow({
|
||||
id: competitionId,
|
||||
target_type: 'competition_info'
|
||||
}).then(res=>{
|
||||
if(res && res.status === 200){
|
||||
message.success('关注成功');
|
||||
setReloadDetail(Math.random());
|
||||
}
|
||||
})
|
||||
if(current_user && current_user.login){
|
||||
follow({
|
||||
id: competitionId,
|
||||
target_type: 'competition_info'
|
||||
}).then(res=>{
|
||||
if(res && res.status === 200){
|
||||
message.success('关注成功');
|
||||
setReloadDetail(Math.random());
|
||||
}
|
||||
})
|
||||
}else{
|
||||
props.showLoginDialog();
|
||||
}
|
||||
}
|
||||
|
||||
function unfollow(){
|
||||
unFollow({
|
||||
id: competitionId,
|
||||
target_type: 'competition_info'
|
||||
}).then(res=>{
|
||||
if(res && res.status === 200){
|
||||
message.success('取消关注成功');
|
||||
setReloadDetail(Math.random());
|
||||
if(current_user && current_user.login){
|
||||
unFollow({
|
||||
id: competitionId,
|
||||
target_type: 'competition_info'
|
||||
}).then(res=>{
|
||||
if(res && res.status === 200){
|
||||
message.success('取消关注成功');
|
||||
setReloadDetail(Math.random());
|
||||
}
|
||||
})
|
||||
}else{
|
||||
props.showLoginDialog();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const is_local = qzDetail && qzDetail.is_local;
|
||||
|
|
|
@ -7,6 +7,9 @@ import './LoginRegisterPage.scss';
|
|||
const Option = Select.Option;
|
||||
|
||||
function Register(props) {
|
||||
const settings=localStorage.getItem('chromesetting')?JSON.parse(localStorage.getItem('chromesetting')):{};
|
||||
let professional_field=settings.professional_field||[];
|
||||
let is_local=settings.is_local;
|
||||
const { form } = props;
|
||||
const { getFieldDecorator,setFieldsValue,validateFields,getFieldValue } = form;
|
||||
//用户输入的符合规则的手机号(用于获取验证码)
|
||||
|
@ -36,7 +39,7 @@ function Register(props) {
|
|||
company_name: values.company_name,
|
||||
user_type: values.user_type,
|
||||
professional_field:values.professional_field,
|
||||
code: values.captcha
|
||||
code:is_local?'111111': values.captcha
|
||||
}).then((response) => {
|
||||
if (response.data && response.data.status === -6) {
|
||||
//验证码不正确
|
||||
|
@ -178,8 +181,7 @@ function Register(props) {
|
|||
clear();
|
||||
}, [])
|
||||
|
||||
const settings=localStorage.getItem('chromesetting')?JSON.parse(localStorage.getItem('chromesetting')):{};
|
||||
let professional_field=settings.professional_field||[];
|
||||
|
||||
|
||||
return (
|
||||
<div className="right_cont Register_content">
|
||||
|
@ -222,7 +224,7 @@ function Register(props) {
|
|||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item>
|
||||
{!is_local&&<Form.Item>
|
||||
<div className="login_register_head">
|
||||
{getFieldDecorator('captcha', {
|
||||
rules: [{
|
||||
|
@ -235,7 +237,7 @@ function Register(props) {
|
|||
)}
|
||||
<Button className={getCaptchaBut||(isMobile && !countDown) ? 'codeBut' : 'codeBut disable'} disabled={!getCaptchaBut && !(isMobile && !countDown)} onClick={getCaptcha}>{getCaptchaBut||(isMobile && !countDown) || (!getCaptchaBut && !countDown) ? "获取验证码" : `重发(${secondsStr}s)`}</Button>
|
||||
</div>
|
||||
</Form.Item>
|
||||
</Form.Item>}
|
||||
|
||||
<Form.Item>
|
||||
{getFieldDecorator('register_psd', {
|
||||
|
|
Loading…
Reference in New Issue