diff --git a/src/military/components/sortBox/index.jsx b/src/military/components/sortBox/index.jsx
index 4cb0f4f34..f3f3004f0 100644
--- a/src/military/components/sortBox/index.jsx
+++ b/src/military/components/sortBox/index.jsx
@@ -32,7 +32,6 @@ export default memo((props) => {
setMyOptions(myOptions);
}
- console.log('-----options----')
return (
diff --git a/src/military/javaFetch.js b/src/military/javaFetch.js
index 829a50d4e..90e7e9253 100644
--- a/src/military/javaFetch.js
+++ b/src/military/javaFetch.js
@@ -17,7 +17,6 @@ export default function javaFetch(actionUrl){
// request拦截器
service.interceptors.request.use(config => {
if (cookie.load(TokenKey)) {
- console.log(cookie.load(TokenKey));
config.headers['Authorization'] = cookie.load(TokenKey); // 让每个请求携带自定义token 请根据实际情况自行修改
}
if (window.location.port === "3007") {
diff --git a/src/military/task/api.js b/src/military/task/api.js
index 85645e2b8..98313f636 100644
--- a/src/military/task/api.js
+++ b/src/military/task/api.js
@@ -160,6 +160,13 @@ export function deleteTask(id, isDelete) {
});
}
+//推荐
+export function recommendTask(id, recommend) {
+ return fetch({
+ url: '/api/tasks/backend/changeTaskRecommendedStatus/' + id + '?recommend=' + recommend,
+ method: 'PUT',
+ });
+}
//新增成果
export function addPaper(data) {
diff --git a/src/military/task/taskAdmin/index.jsx b/src/military/task/taskAdmin/index.jsx
index 2ca99d8a7..c6dcbb795 100644
--- a/src/military/task/taskAdmin/index.jsx
+++ b/src/military/task/taskAdmin/index.jsx
@@ -4,7 +4,7 @@ import { Input, Select, Button, Form, DatePicker, Table, Pagination, Modal } fro
import { Link } from "react-router-dom";
import { paperCheckStatusArr, publishModeArr, taskStatusAllArr, showUserModeArr, main_web_site_url } from '../static';
-import { getTaskAdminList, changeShowUserMode, deleteTask } from '../api';
+import { getTaskAdminList, changeShowUserMode, deleteTask, recommendTask } from '../api';
import '../index.scss';
import './index.scss';
const format = "YYYY-MM-DD HH:mm:ss";
@@ -29,6 +29,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
const [publishMode, setPublishMode] = useState('');
const [showUserMode, setShowUserMode] = useState('');
const [isDelete, setIsDelete] = useState('0');
+ const [recommend, setRecommend] = useState('');
const [sort, setSort] = useState('Desc');
const [order, setOrder] = useState('createdAt');
@@ -48,6 +49,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
pageSize: 10,
orderBy: order + sort,
isDelete,
+ recommend,
};
setLoading(true);
getTaskAdminList(params).then(data => {
@@ -57,7 +59,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
}
setLoading(false);
})
- }, [statusString, order, sort, publishMode, showUserMode, curPage, searchObj, isDelete, reload]);
+ }, [statusString, order, sort, publishMode, showUserMode, curPage, searchObj, isDelete, reload ,recommend]);
const helper = useCallback(
@@ -205,8 +207,13 @@ export default Form.create()(({ form, showNotification, match, history }) => {
{
- isDelete == '0' ?
- :
+ isDelete == '0' ?
+ :
+ }
+
+ {
+ record.recommend ?
+ :
}
{/* 查看 */}
@@ -216,8 +223,24 @@ export default Form.create()(({ form, showNotification, match, history }) => {
]
}, [isDelete]);
+ function recommendItem(id, recommend) {
+ Modal.confirm({
+ title: "警告",
+ content: recommend == '0' ? "确认撤销该推荐吗 ?撤销后首页中将不再展示该任务" : "确认推荐吗?推荐后,用户可以在首页看到推荐任务中点击量前三的任务!",
+ okText: '确定',
+ cancelText: '取消',
+ onOk() {
+ recommendTask(id, recommend).then(res => {
+ if (res.message === 'success') {
+ showNotification('操作成功!');
+ setReload(Math.random());
+ }
+ });
+ },
+ });
+ }
- function deletItem(id, isDelete) {
+ function deleteItem(id, isDelete) {
Modal.confirm({
title: "警告",
content: isDelete == '0' ? "确认恢复该任务吗?恢复后用户可以重新看到该任务!" : "确认隐藏?隐藏后用户无法看到该任务!",
@@ -261,7 +284,16 @@ export default Form.create()(({ form, showNotification, match, history }) => {
const changeShow = useCallback((isDelete) => {
setIsDelete(isDelete);
setCurPage(1);
- })
+ });
+
+ const changeRecommend = useCallback((recommend) => {
+ if (recommend === 'all') {
+ setRecommend('');
+ } else {
+ setRecommend(recommend);
+ }
+ setCurPage(1);
+ });
function downloadFile() {
window.open(main_web_site_url + '/admin/tasks.xlsx');
@@ -334,6 +366,19 @@ export default Form.create()(({ form, showNotification, match, history }) => {
+
+
+
+
diff --git a/src/modules/404/Shixunnopage.js b/src/modules/404/Shixunnopage.js
index 418932403..5b59b472b 100644
--- a/src/modules/404/Shixunnopage.js
+++ b/src/modules/404/Shixunnopage.js
@@ -11,21 +11,44 @@ import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { SnackbarHOC,getImageUrl } from 'educoder';
class http500 extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ isAdmins:true,
+ }
+ }
+
+ UNSAFE_componentWillMount() {
+ if (this.props.history.location.pathname.indexOf('/admins/') > -1) {
+ let nowTime = new Date().getTime();
+ if ((nowTime - (localStorage.reloadTime || 0)) > 2000) {
+ localStorage.setItem('reloadTime', nowTime);
+ window.location.reload();
+ return;
+ }
+ }
+ this.setState({isAdmins:false});
+ }
+
+
render() {
return (
-
- {/*mt100 mb100*/}
-
})
-
- 您可以稍后尝试 返回首页
- ,或者
- QQ反馈>>
-
-
+ {
+ this.state.isAdmins?
:
+ {/*mt100 mb100*/}
+
})
+
+ 您可以稍后尝试 返回首页
+ ,或者
+ QQ反馈>>
+
+
+ }
+
{/*
*/}
{/*
载入中...
*/}
{/*
*/}
diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js
index 9d1d53202..77a6f46cb 100644
--- a/src/modules/tpm/NewHeader.js
+++ b/src/modules/tpm/NewHeader.js
@@ -1,9 +1,9 @@
import React, { Component } from 'react';
import { Link } from "react-router-dom";
import AccountProfile from "../user/AccountProfile";
-import { getImageUrl } from 'educoder'
+import { getImageUrl,getLogoImageUrl } from 'educoder'
import axios from 'axios';
-import { Modal, Input, message, notification } from 'antd';
+import { Modal, Input, message, notification, Button } from 'antd';
import LoginDialog from '../login/LoginDialog';
import GotoQQgroup from '../../modal/GotoQQgroup'
@@ -13,7 +13,7 @@ import 'antd/lib/radio/style/index.css';
import 'antd/lib/input/style/index.css';
import './TPMIndex.css';
import './css/headerExcess.css';
-import logo from './images/logo.png';
+import logo from './images/hskylogo.png';
const $ = window.$
// TODO 这部分脚本从公共脚本中直接调用
@@ -586,6 +586,8 @@ class NewHeader extends Component {
return true
} else if (url.indexOf('users') > -1 && match.path.indexOf('users') > -1) {
return true
+ } else if (['http://117.50.100.12:8080','https://osredm.com'].includes(url) && match.path === '/') {
+ return true
} else {
return false
}
@@ -618,74 +620,76 @@ class NewHeader extends Component {
mygetHelmetapi2,
goshowqqgtounp,
} = this.state;
+
+ let activeIndex =match.path === '/'?true: '';
+
/*用户名称 用户头像url*/
- let activeIndex = false;
- let activeForums = false;
- let activeShixuns = false;
- let activePaths = false;
- let coursestype = false;
- let activePackages = false;
- let activeMoopCases = false;
- let activeCompetitions = false;
+ // let activeIndex = false;
+ // let activeForums = false;
+ // let activeShixuns = false;
+ // let activePaths = false;
+ // let coursestype = false;
+ // let activePackages = false;
+ // let activeMoopCases = false;
+ // let activeCompetitions = false;
- if (match.path === '/forums') {
- activeForums = true;
- } else if (match.path.startsWith('/shixuns')) {
- activeShixuns = true;
- } else if (match.path.startsWith('/paths')) {
- activePaths = true;
- } else if (match.path.startsWith('/courses')) {
- coursestype = true;
- } else if (match.path.startsWith('/crowdsourcing')) {
- activePackages = true;
- } else if (match.path.startsWith('/moop_cases')) {
- activeMoopCases = true;
- } else if (match.path.startsWith('/competitions')) {
- activeCompetitions = true;
- } else {
- activeIndex = true;
- }
-
- let headtypes = '/';
- if (mygetHelmetapi2) {
- if (mygetHelmetapi2.navbar) {
- if (mygetHelmetapi2.navbar.length > 0) {
- if (match.path === '/') {
- if (headtypesonClickbool === false) {
- headtypes = undefined;
- } else {
- headtypes = headtypess;
- }
- } else {
- for (var i = 0; i < mygetHelmetapi2.navbar.length; i++) {
- if (match.path === mygetHelmetapi2.navbar[i].link) {
- headtypes = mygetHelmetapi2.navbar[i].link;
- break;
- }
- }
- }
- }
- }
- }
- let shixuntype = false;
- let pathstype = false;
+ // if (match.path === '/forums') {
+ // activeForums = true;
+ // } else if (match.path.startsWith('/shixuns')) {
+ // activeShixuns = true;
+ // } else if (match.path.startsWith('/paths')) {
+ // activePaths = true;
+ // } else if (match.path.startsWith('/courses')) {
+ // coursestype = true;
+ // } else if (match.path.startsWith('/crowdsourcing')) {
+ // activePackages = true;
+ // } else if (match.path.startsWith('/moop_cases')) {
+ // activeMoopCases = true;
+ // } else if (match.path.startsWith('/competitions')) {
+ // activeCompetitions = true;
+ // } else {
+ // activeIndex = true;
+ // }
+ // let headtypes = '/';
+ // if (mygetHelmetapi2) {
+ // if (mygetHelmetapi2.navbar) {
+ // if (mygetHelmetapi2.navbar.length > 0) {
+ // if (match.path === '/') {
+ // if (headtypesonClickbool === false) {
+ // headtypes = undefined;
+ // } else {
+ // headtypes = headtypess;
+ // }
+ // } else {
+ // for (var i = 0; i < mygetHelmetapi2.navbar.length; i++) {
+ // if (match.path === mygetHelmetapi2.navbar[i].link) {
+ // headtypes = mygetHelmetapi2.navbar[i].link;
+ // break;
+ // }
+ // }
+ // }
+ // }
+ // }
+ // }
+ // let shixuntype = false;
+ // let pathstype = false;
let coursestypes = false;
if (this.props && this.props.mygetHelmetapi != null) {
- let shixun = "/shixuns";
- let paths = "/paths";
+ // let shixun = "/shixuns";
+ // let paths = "/paths";
let courses = "/courses";
this.props.mygetHelmetapi.navbar.map((item, key) => {
var reg = RegExp(item.link);
- if (shixun.match(reg)) {
- if (item.hidden === true) {
- shixuntype = true
- }
- }
- if (paths.match(reg)) {
- if (item.hidden === true) {
- pathstype = true
- }
- }
+ // if (shixun.match(reg)) {
+ // if (item.hidden === true) {
+ // shixuntype = true
+ // }
+ // }
+ // if (paths.match(reg)) {
+ // if (item.hidden === true) {
+ // pathstype = true
+ // }
+ // }
if (courses.match(reg)) {
if (item.hidden === true) {
coursestypes = true
@@ -694,7 +698,7 @@ class NewHeader extends Component {
})
}
return (
-