From bea187c1f9593dd2e3a61d2f509a2c35e4f487f4 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 16 Apr 2021 17:53:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=A8=E5=85=B0=E7=AC=AC=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 69 +--- src/AppConfig.js | 28 +- src/indexEduplus2RequestProxy.js | 16 - src/mulan/Components/Login/Index.scss | 7 + src/mulan/Components/Login/Login.jsx | 46 ++- src/mulan/Components/Login/LoginModal.jsx | 10 +- src/mulan/Components/Login/Register.jsx | 74 ++++- src/mulan/Data/getUrl.jsx | 10 + src/mulan/HOC/Footer.jsx | 14 +- src/mulan/HOC/Header.jsx | 10 +- src/mulan/HOC/HomeHeader.jsx | 11 - src/mulan/HOC/HomeHoc.jsx | 49 ++- src/mulan/HOC/Index.scss | 49 ++- src/mulan/HOC/Nav.jsx | 41 ++- src/mulan/Index.jsx | 363 +++++++++++----------- src/mulan/Index.scss | 75 +++-- src/mulan/Projects/Index.jsx | 191 +++++++----- src/mulan/Projects/Index.scss | 116 ++++++- src/mulan/Projects/Ranking.jsx | 33 ++ src/mulan/images/1_1.png | Bin 148011 -> 89914 bytes src/mulan/images/320.jpeg | Bin 113765 -> 0 bytes src/mulan/images/320.jpg | Bin 0 -> 630283 bytes src/mulan/images/bg2.jpg | Bin 50349 -> 1256116 bytes src/mulan/images/cards.png | Bin 0 -> 17592 bytes src/mulan/images/icon1.png | Bin 4801 -> 17933 bytes src/mulan/images/icon2.png | Bin 3273 -> 16383 bytes src/mulan/license/FAQ.jsx | 113 ++----- src/mulan/license/Index.jsx | 43 ++- src/mulan/license/Index.scss | 43 +-- src/mulan/license/PSL.jsx | 142 ++------- src/mulan/license/Preface.jsx | 30 +- src/mulan/license/Public.jsx | 113 ++----- 32 files changed, 893 insertions(+), 803 deletions(-) create mode 100644 src/mulan/Data/getUrl.jsx delete mode 100644 src/mulan/HOC/HomeHeader.jsx create mode 100644 src/mulan/Projects/Ranking.jsx delete mode 100644 src/mulan/images/320.jpeg create mode 100644 src/mulan/images/320.jpg create mode 100644 src/mulan/images/cards.png diff --git a/src/App.js b/src/App.js index 7130cc68..57c94765 100644 --- a/src/App.js +++ b/src/App.js @@ -120,7 +120,7 @@ class App extends Component { }); initAxiosInterceptors(this.props); - this.getAppdata(); + this.getSetting(); window.addEventListener('error', (event) => { const msg = `${event.type}: ${event.message}`; @@ -133,67 +133,30 @@ class App extends Component { }) }; - //获取数据为空的时候 - gettablogourlnull = () => { - this.setState({ - mygetHelmetapi: undefined - }); - document.title = "Forge"; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); - link.id = 'dynamic-favicon'; - link.rel = 'shortcut icon'; - link.href = "/react/build/./favicon.ico"; - if (oldLink) { - document.head.removeChild(oldLink); - } - document.head.appendChild(link); - }; - //获取数据的时候 + getSetting=()=>{ + const url = `/setting.json`; + axios.get(url).then(result=>{ + if(result){ + this.setState({ + headData:result.data.data + }) + this.gettablogourldata(result.data.data) + } + }).catch(error=>{}) + } + gettablogourldata = (response) => { - document.title = response.data.setting.name; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); + document.title = response.name; + var link = document.createElement('link'),oldLink = document.getElementById('dynamic-favicon'); link.id = 'dynamic-favicon'; link.rel = 'shortcut icon'; - link.href = '/' + response.data.setting.tab_logo_url; + link.href = '/' + response.tab_logo_url; if (oldLink) { document.head.removeChild(oldLink); } document.head.appendChild(link); } - //获取当前定制信息 - getAppdata = () => { - let url = "/setting.json"; - axios.get(url).then((response) => { - if (response) { - if (response.data) { - this.setState({ - mygetHelmetapi: response.data.setting - }); - //存储配置到游览器 - localStorage.setItem('chromesetting', JSON.stringify(response.data.setting)); - localStorage.setItem('chromesettingresponse', JSON.stringify(response)); - try { - if (response.data.setting.tab_logo_url) { - this.gettablogourldata(response); - } else { - this.gettablogourlnull(); - } - } catch (e) { - this.gettablogourlnull(); - } - } else { - this.gettablogourlnull(); - } - } else { - this.gettablogourlnull(); - } - }).catch((error) => { - this.gettablogourlnull(); - }); - }; render() { return ( diff --git a/src/AppConfig.js b/src/AppConfig.js index 3b223f44..1f87e949 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -34,7 +34,7 @@ function clearAllCookie() { cookie.remove('autologin_trustie', { path: '/' }); setpostcookie() } -clearAllCookie(); +// clearAllCookie(); function setpostcookie() { const str = window.location.pathname; if (str.indexOf("/wxcode") !== -1) { @@ -50,13 +50,13 @@ function setpostcookie() { } } } -setpostcookie(); +// setpostcookie(); window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener(); var proxy = "http://localhost:3000"; - proxy = "http://192.168.1.37:3000"; + proxy = "https://mulan.trustie.net"; const requestMap = {}; window.setfalseInRequestMap = function (keyName) { @@ -65,10 +65,10 @@ export function initAxiosInterceptors(props) { //响应前的设置 axios.interceptors.request.use( config => { - setpostcookie() - clearAllCookie() + // clearAllCookie() + // setpostcookie() - if (config.url.indexOf(proxy) !== -1) { + if (config.url.indexOf("http") !== -1) { return config } requestProxy(config) @@ -79,20 +79,20 @@ export function initAxiosInterceptors(props) { if (window.location.port === "3007") { config.url = `${proxy}${url}`; if (config.url.indexOf('?') === -1) { - config.url = `${config.url}?debug=${debugType}`; + config.url = `${config.url}`; } else { - config.url = `${config.url}&debug=${debugType}`; + config.url = `${config.url}`; } } else { config.url = url; } - setpostcookie(); + // setpostcookie(); } - if (config.url.indexOf('update_file') === -1) { - requestMap[config.url] = true; + // if (config.url.indexOf('update_file') === -1) { + // requestMap[config.url] = true; - window.setTimeout("setfalseInRequestMap('" + config.url + "')", 900) - } + // window.setTimeout("setfalseInRequestMap('" + config.url + "')", 900) + // } return config; }, err => { @@ -147,7 +147,7 @@ export function initAxiosInterceptors(props) { }, 2000); } requestMap[response.config.url] = false; - setpostcookie(); + // setpostcookie(); return response; }, function (error) { return Promise.reject(error); diff --git a/src/indexEduplus2RequestProxy.js b/src/indexEduplus2RequestProxy.js index 81cfba0e..fc3e2111 100644 --- a/src/indexEduplus2RequestProxy.js +++ b/src/indexEduplus2RequestProxy.js @@ -66,19 +66,3 @@ export function requestProxy(config) { } return config; } - -/** - ('/api/v1/careers/qweqw/edit/').match(/\/api\/v1\/careers\/(\w*)\/edit/i) - 0: "/api/v1/careers/qweqw/edit" - 1: "qweqw" - - example: - `/api/v1/games/${this.props.game.identifier}/answer_grade` -> - `/tasks/${this.props.game.identifier}/answer_grade.json` - - - https://testeduplus2.educoder.net/api/v1/games/feguz4tiqpvx/rep_content - ?path=src/step2/CLnkQueue.cpp&shixun_gpid=2791&status=0&retry=0 -> - http://testeduplus2.educoder.net/tasks/tonblikwzj78/rep_content.json - ?path=1-4.py&shixun_gpid=2448&status=0 - */ \ No newline at end of file diff --git a/src/mulan/Components/Login/Index.scss b/src/mulan/Components/Login/Index.scss index 2995c97e..3bb708f6 100644 --- a/src/mulan/Components/Login/Index.scss +++ b/src/mulan/Components/Login/Index.scss @@ -1,4 +1,11 @@ .loginModal{ + .ant-modal-close{ + top:0px!important; + height: 48px; + line-height: 48px; + display: flex; + align-items: center; + } .ant-modal-body{ padding:0px; .ant-menu{ diff --git a/src/mulan/Components/Login/Login.jsx b/src/mulan/Components/Login/Login.jsx index debbbd0c..fb479702 100644 --- a/src/mulan/Components/Login/Login.jsx +++ b/src/mulan/Components/Login/Login.jsx @@ -1,24 +1,48 @@ -import React, { useState , forwardRef } from 'react'; -import { Form , Input , Checkbox } from 'antd'; +import React, { useState , forwardRef, useEffect } from 'react'; +import { Form , Input , Checkbox, Button } from 'antd'; import "./Index.scss"; +import axios from 'axios'; -function LoginModal({form}){ +function LoginModal({form , successFunc , visible}){ const [ active , setActive ] = useState(false); + const [ loading , setLoading ] = useState(false); const { getFieldDecorator, validateFields , setFieldsValue , getFieldsValue } = form; + function changeInput(){ - const { account , password } = getFieldsValue(); - if(account && password){ + const { login , password } = getFieldsValue(); + if(login && password){ setActive(true); }else{ setActive(false); } } + function loginFunc() { + validateFields((error,values)=>{ + if(!error){ + setLoading(true); + const url = `/accounts/login.json`; + axios.post(url,{ + ...values + }).then(result=>{ + successFunc(result.data.data); + setLoading(false); + if(!values.savePass){ + setFieldsValue({ + login:undefined, + password:undefined, + savePass:false + }) + } + }).catch(error=>{}) + } + }) + } return(
木兰开源社区
-开放共享打造开源生态
+{item.full_name}
+{item.author && item.author.name}
+{item.description}
+云对象存储系统
-清华大学
-云对象存储系统作为云操作系统的重要组成部分,主要负责非结构化数据的储存 和管理,用户通过REST API与系统进行交互。云对象存储系统支持服务端加密、 访问权限控制、静态网站托管和大对象分段上传等功能。这些API均与Amazon S3 和阿里云 OSS 标准兼容,以便于现有的云应用向中国云迁移。
- -CCDemon
-复旦大学
-基于相似代码分析的代码辅助完成工具。
-UserPortrait
-国防科技大学
-面向群体化协同开发的用户画像系统,从社区影响力、社区活跃度、社区贡献度 、项目经验、语言能力五个维度评估开发者能力,综合利用基本属性数据、行为 数据、社交数据构建用户画像。
-RETO
-北京理工大学
-该项目由北京理工大学智能化软件工程实验室负责,主要设计并实现了Rename重 构机会的推荐、Move Method重构机会的推荐以及运行过程中动态地对阈值进行 优化这三个功能。
-OC-BlueStore
-中科院计算所
-面向云计算场景分布式存储系统单机引擎,基于开放SSD实现软件定义和租户感知 的数据布局,支持软件触发垃圾回收。
-Labeled Risc-V
-中科院计算所
-基于精简指令集(RISC)原则的开源指令集架构,用于允许任何人设计、制造和 销售RISC-V芯片和软件。
-SGX-Migration
-上海交通大学
-致力于在异构云平台之间,实现Enclave的实时跨云迁移。
-HCloud
-上海交通大学
-致力于跨云环境下的可信数据融合与机密计算。
-木兰重生:更多 $ 的妙用,self 的拓展语义
-官方宣布 Perl 7 计划
-Deno 继颠覆 Node 之后,又“内部”拒绝了 TypeScript
-Go 泛型草案更新,明年8月发布的 Go 1.17 将引入
-基础类开源软件
{ list && list.length > 0 ?{item.desc}
-{item.full_name}
+{item.description}
+活跃度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