diff --git a/package-lock.json b/package-lock.json index 9ea84263..a72d2386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14204,7 +14204,7 @@ }, "qr.js": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/qr.js/-/qr.js-0.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/qr.js/download/qr.js-0.0.0.tgz", "integrity": "sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8=" }, "qrcode.react": { diff --git a/public/css/edu-common.css b/public/css/edu-common.css index 56790f05..30ddf03f 100755 --- a/public/css/edu-common.css +++ b/public/css/edu-common.css @@ -25,9 +25,6 @@ html { min-width: 1200px } -.newFooter { - max-height: 110px; -} .newFooter { position: absolute; diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index 0d146204..0d23c5bc 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -3604,7 +3604,6 @@ a.user_bluebg_btn { margin-right: 5px; } - /***** loading ******/ /*****载入中******/ #ajax-indicator { @@ -3971,7 +3970,7 @@ html>body #ajax-indicator { display: block; height: 100%; width: 100%; - color: #333; + color: #fff; font-size: 16px; } diff --git a/src/App.js b/src/App.js index 3072aca5..fad7e937 100644 --- a/src/App.js +++ b/src/App.js @@ -84,7 +84,7 @@ const EducoderLogin = Loadable({ loading: Loading, }) const Search = Loadable({ - loader: () => import('./modules/search/'), + loader: () => import('./search/SearchPage'), loading: Loading, }) const WikiPreview = Loadable({ @@ -92,6 +92,7 @@ const WikiPreview = Loadable({ loading: Loading, }) + const ProjectIndex = Loadable({ loader: () => import("./forge/Index"), loading: Loading, @@ -178,7 +179,6 @@ class App extends Component { componentDidMount() { document.title = "loading..."; - this.getAppdata(); window.addEventListener('error', (event) => { diff --git a/src/AppConfig.js b/src/AppConfig.js index ea85a4e5..b93e7c0b 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -11,9 +11,9 @@ broadcastChannelOnmessage('refreshPage', () => { }) function locationurl(list) { - if (window.location.port !== "3007") { + // if (window.location.port !== "3007") { window.location.href = list - } + // } } // TODO 开发期多个身份切换 let debugType = "" @@ -32,7 +32,7 @@ export function initAxiosInterceptors(props) { // 判断网络是否连接 initOnlineOfflineListener(); - var proxy = "https://testforgeplus.trustie.net"; + var proxy = "https://testforgeplus.educoder.net"; //响应前的设置 axios.interceptors.request.use( config => { @@ -86,7 +86,7 @@ export function initAxiosInterceptors(props) { if (response.data.status === 404) { let responseURL = response.request ? response.request.responseURL:''; - if (responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1 ) { + if (responseURL.indexOf('/api/users/') === -1 || responseURL.indexOf('/api/organizations/') === -1 || responseURL.indexOf('/api/owners/') === -1) { locationurl('/nopage'); } } diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index f1800a75..f75fbf70 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -8,16 +8,34 @@ const isDev = window.location.port == 3007; const isdev2= window.location.hostname ==='www.educoder.net' export const TEST_HOST = "https://testforgeplus.trustie.net/" export function getImageUrl(path) { - // https://www.educoder.net - // https://testbdweb.trustie.net - // const local = 'http://localhost:3000' - const local = 'https://testforgeplus.trustie.net'; - if (isDev) { - return `${local}/${path}` + const local = 'https://testforgeplus.educoder.net'; + const normal = 'https://ali-cdn.educoder.net/images'; + const normalend = 'https://ali-cdn.educoder.net'; + if(path.substr(0, 7) !== "/system"){ + if (isDev) { + return `${local}/${path}` + } + if(path.substr(0, 7) !== "/images"){ + return `${normal}${path}`; + }else{ + return `${normalend}${path}`; + } } return `${path}`; } + +export function openNewWindow(url) { + let link = document.createElement('a') + link.target = "_blank" + document.body.appendChild(link) + link.href = url + let evt = document.createEvent("MouseEvents") + evt.initEvent("click", false, false) + link.dispatchEvent(evt) + document.body.removeChild(link); +} + export function numFormat(num, digits){ let d = digits || 1; var si = [ @@ -179,7 +197,7 @@ export function getmyUrl(geturl) { } export function getUploadActionUrl(path, goTest) { - return `${getUrl()}/api/attachments.json${isDev ?`${isDev ?`?debug=${window._debugType || 'admin'}` : ""}` : ""}`; + return `${getUrl()}/api/attachments.json`; } export function getUploadLogoActionUrl() { diff --git a/src/common/educoder.js b/src/common/educoder.js index 1a063d82..5191bb4f 100644 --- a/src/common/educoder.js +++ b/src/common/educoder.js @@ -7,6 +7,7 @@ export { getImageUrl as getImageUrl,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl , getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth , getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl + , openNewWindow as openNewWindow } from './UrlTool'; export { setmiyah as setmiyah } from './Component'; diff --git a/src/forge/Component/EAccount.scss b/src/forge/Component/EAccount.scss index 6fe44ab3..38dc0adf 100644 --- a/src/forge/Component/EAccount.scss +++ b/src/forge/Component/EAccount.scss @@ -3,4 +3,9 @@ } .ant-modal-wrap{ z-index: 1032; +} +.ant-modal-wrap{ + .ant-form-explain{ + position: absolute; + } } \ No newline at end of file diff --git a/src/forge/Component/EducoderAccount.jsx b/src/forge/Component/EducoderAccount.jsx index 51fe0ded..76243f77 100644 --- a/src/forge/Component/EducoderAccount.jsx +++ b/src/forge/Component/EducoderAccount.jsx @@ -1,15 +1,32 @@ import React , {forwardRef, useEffect} from 'react'; import { Modal , Form , Input , Button } from 'antd'; import './EAccount.scss'; +import axios from 'axios'; -function EducoderAccount({form , visible , onOk , email}){ +function EducoderAccount({form , visible , current_user , onCancel}){ const { getFieldDecorator, validateFields , setFieldsValue } = form; useEffect(()=>{ - if(email){ - setFieldsValue({email}) + if(current_user && current_user.email){ + setFieldsValue({email:current_user.email}) } - },[email]) + },[current_user]) + + function onOk(values){ + let url = `/accounts/gitea_register.json`; + const { email , is_sync_pwd} = current_user; + if(email && !is_sync_pwd){ + url = `/users/change_password.json`; + } + axios.post(url,{ + login:current_user && current_user.login, + ...values + }).then(result=>{ + if(result && result.data && result.data.status === 0){ + window.location.reload(); + } + }).catch(error=>{}) + } function onSure(){ validateFields((error,values)=>{ @@ -27,7 +44,7 @@ function EducoderAccount({form , visible , onOk , email}){ visible={visible} title="提示" width="500px" - closable={false} + onCancel={onCancel} footer={ } @@ -35,21 +52,26 @@ function EducoderAccount({form , visible , onOk , email}){ >
- 为确保您能正常使用平台功能,请确认以下信息: + { + current_user && current_user.email ? + `平台已检测到您已绑定邮箱${current_user.email},请您确认如下操作` + : + "平台已检测到您未绑定邮箱,为不影响使用协同开发功能,请先绑定邮箱" + }
您可以在QQ服务群向管理员申请,获得继续操作的权限
+ < img src={require("./teacherQQ.png")} width={200} height={200} alt=""/> +群号:693542422
+
-
-
已通过你加入【{project && project.name}】项目的申请
+ default: + return已拒绝你加入【{project && project.name}】项目的申请
+ } + }else{ + return "" + } + } + return(- 上传时间:{item.uploadTime} - 文件大小:{item.fileSize} - 下载:{item.download} -
-{item.remark}
++ 上传时间:{item.uploadTime} + 文件大小:{item.fileSize} + 下载:{item.download} +
+{item.remark}
+ { item.tags && item.tags.length>0 &&