diff --git a/src/App/App.css b/src/App/App.css
deleted file mode 100644
index 2ac8e40..0000000
--- a/src/App/App.css
+++ /dev/null
@@ -1,177 +0,0 @@
-@import '~antd/dist/antd.css';
-
-@keyframes myfirst
-{
-from {background: red;}
-to {background: yellow;}
-}
-#root{
- height: 100%;
-}
-/* 使图片自适应浏览器的宽度 */
-.background{
- background-color:#fff;
- margin: 0;
- width: 100%;
- height: 100%;
-}
-
-.App {
- text-align: center;
- margin: 24px 0 30px 0;
- background-color:#f2f4f5;
- display: inline-block;
- width: 100%;
-}
-.App-header {
- min-height: 40px;
- width: 100%;
- font-size: calc(10px + 2vmin);
- background:#ff4d4f;
- color: white;
- box-shadow: 0 2px 8px #ffa39e;
- position: fixed;
- top: 0px;
- z-index: 15;
- vertical-align:center;
-}
-
-.main-left{
- width: 256px;
- min-height: 100%;
- margin: 0 0 0 0;
- background: #fff;
- float: left;
- position: fixed;
- z-index: 14;
- box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)
-}
-.main-right{
- background: #f6f6f6;
- margin: 40px 0px 0px 256px;
- padding-left: 20px;
- padding-right: 20px;
- padding-top: 20px;
- min-height: 100%;
-}
-.App-logo {
- animation: App-logo-spin infinite 20s linear;
- height: 40vmin;
- pointer-events: none;
-}
-
-
-.App-link {
- color: #61dafb;
-}
-
-@keyframes App-logo-spin {
- from {
- transform: rotate(0deg);
- }
- to {
- transform: rotate(360deg);
- }
-}
-
-body {
- margin: 0;
- padding: 0;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
- "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
- sans-serif;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-code {
- font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
- monospace;
-}
-.appSider{
- overflow:auto;
- height: 100%;
- position: fixed;
- left: 0;
- z-index:6;
- margin-top:64px;
- background:#fff;
- border-right:1px solid #e8e8e8;
-}
-.appTrigger {
- display: inline;
- font-size: 18px;
- line-height: 64px;
- padding: 0 24px;
- cursor: pointer;
- transition: color 0.3s;
- color: #fff;
-}
-
-.appTrigger:hover {
- color: #cf1322;
-}
-.logoPic{
- width:200px;
- display: inline;
- margin: -3px 0 -4px 0;
-}
-.logoDiv{
- display: inline;
- width:200px;
- overflow: hidden;
-}
-.layoutContent{
- padding: 20px 50px 0 50px;
- margin-top: 64px;
- overflow:hidden;
-}
-.loader{
- text-align: center;
-}
-.end-text{
- text-align: center;
-}
-@media (max-width: 576px) {
- .layoutContent{
- padding: 20px 0 0 0;
- }
-}
-@media (min-width: 576px) and (max-width: 768px){
- .layoutContent{
- padding: 20px 10px 0 10px;
- }
-}
-@media (min-width: 768px) and (max-width: 992px){
- .layoutContent{
- padding: 20px 20px 0 20px;
- }
-}
-@media (min-width: 992px) and (max-width: 1200px ){
- .layoutContent{
- padding: 20px 30px 0 30px;
- }
-}
-@media (min-width: 1200px) and (max-width: 1600px){
- .layoutContent{
- padding: 20px 40px 0 40px;
- }
-}
-
-.appContentMask{
- position:fixed;
- width:100%;
- left:0;
- background-color:rgba(0,0,0,0.45);
- opacity:0;
- height: 0%;
- transition:height 0s ease 0.3s,opacity .3s linear;
- -webkit-transition:height 0s ease 0.3s,opacity .3s linear;
- z-index: 5;
-}
-.appContentMask.appContentMaskOpen{
- transition:height 0s ease, opacity .3s linear;
- -webkit-transition:height 0s ease, opacity .3s linear;
- height: 100%;
- opacity:1;
-}
\ No newline at end of file
diff --git a/src/App/App.js b/src/App/App.js
deleted file mode 100644
index b487114..0000000
--- a/src/App/App.js
+++ /dev/null
@@ -1,103 +0,0 @@
-import React, { Component } from 'react';
-import './App.css';
-import { BackTop,Layout,Icon,Row, Col} from 'antd';
-import MainLeftMenu from './Menu/MainLeftMenu';
-import MessageBoard from './MessageBoard/MessageBoard';
-//import Header from './Header/Header';
-import { BrowserRouter,Route,withRouter } from 'react-router-dom';
-import Home from './Home/Home';
-import MySearch from './MySearch/MySearch';
-import ArticleList from './Article/ArticleList';
-import ArticleDetails from './Article/details/ArticleDetails';
-import ThinkList from './Think/ThinkList';
-import logopng from '../resource/logo.486a892c.png';
-import { PhotoProvider } from 'react-photo-view';
-import 'react-photo-view/dist/index.css';
-
-const {Header,Content,Footer,Sider} =Layout;
-const minMarginLeft=0;
-const maxMarginLeft=200;
-class App extends Component {
-
- state={
- collapsed:false,
- rightLayoutStyle:{},
- padding:"",
- appContentMaskClassName:"appContentMask",
- };
- onCollapse = collapsed => {
- console.log(collapsed);
- let animation=( collapsed)?'rightAreaCollapsed 0.2s':'rightAreaUnCollapsed 0.2s' ;
- let marginLeft=( collapsed)?minMarginLeft:maxMarginLeft ;
- console.log(animation);
- this.setState({
- collapsed,
- rightLayoutStyle:{marginLeft:marginLeft}
- });
- };
- toggle = () => {
- let isPhone=window.innerWidth<=768;
- let collapsed=!this.state.collapsed;
- let animation=( collapsed)?'rightAreaCollapsed 0.2s':'rightAreaUnCollapsed 0.2s' ;
- if(isPhone){
- if(collapsed){
- this.setState({
- collapsed: collapsed,
- appContentMaskClassName:"appContentMask",
- });
- }else{
- this.setState({
- collapsed: collapsed,
- appContentMaskClassName:"appContentMask appContentMaskOpen",
- });
- }
- }else{
- let marginLeft=( collapsed)?minMarginLeft:maxMarginLeft ;
- this.setState({
- collapsed: collapsed,
- rightLayoutStyle:{animation:animation,marginLeft:marginLeft,animationTimingTunction:'linear'},
- appContentMaskClassName:"appContentMask",
- });
- }
- };
- render() {
- return (
-
-
-
-
.
-
-\`\`\`js
-const React = require('react')
-const ReactDOM = require('react-dom')
-const Markdown = require('react-markdown')
-const CodeRenderer = require('./code-renderer')
-
-ReactDOM.render(
- React.createElement(Markdown, {
- source: 'your markdown here',
- renderers: {
- CodeBlock: CodeRenderer
- Code: CodeRenderer
- }
- }),
- document.body
-)
-\`\`\`
-
-By checking the \`inline\` property, we can reuse the same renderer for both inline and blocks of code!
-For instance, we could highlight \`const React = require('react')\` inline.
-
-See \`examples/custom-renderers\` for the code behind this.
-`;
diff --git a/src/App/Document/data/images.js b/src/App/Document/data/images.js
deleted file mode 100644
index d596b2b..0000000
--- a/src/App/Document/data/images.js
+++ /dev/null
@@ -1,43 +0,0 @@
-export default `
-## Custom image renderer
-
-This example uses a custom image renderer in order to lazy-load and fade in images while rendering the title as an element instead of an attribute.
-
-* ![beer (255)](beer.jpg "Beer!")
-* ![plant (453)](plant.jpg "Plant details")
-* ![ego (302)](ego.jpg "Beer from Ego Brygghus")
-* ![coast (252)](coast.jpg "Coast of California")
-* ![sunrise (252)](sunrise.jpg "Sunrise... Somewhere")
-* ![tree (459)](tree.jpg "Grown people playing")
-* ![sluser (255)](sluser.jpg "Storstraumen")
-* ![chania (453)](chania.jpg "Chania, Crete")
-* ![legs (453)](legs.jpg "Relaxing")
-* ![building (453)](building.jpg "San Francisco?")
-* ![moss (453)](moss.jpg "Mossy rock")
-* ![bird (255)](bird.jpg "Bird, in Egypt")
-* ![alexandria (255)](alexandria.jpg "Library of Alexandria")
-* ![spiral (575)](spiral.jpg "Where?")
-* ![jordan (453)](jordan.jpg "Petra, Jordan")
-* ![56k (276)](56k.jpg "Fastest of 56k modems")
-* ![spices (309)](spices.jpg "Spices in Luxor")
-* ![crete (510)](crete.jpg "Knossos, Crete")
-* ![santorini (510)](santorini.jpg "Santorini")
-* ![android (427)](android.jpg "Dat Android")
-* ![rabbit (375)](rabbit.jpg "Lunte the Rabbit")
-* ![ce (420)](ce.jpg "Codename Eagle")
-* ![dragon (227)](dragon.jpg "Butterfly")
-* ![parrot (574)](parrot.jpg "Parrot in Malaysia")
-* ![hovlandsdal (255)](hovlandsdal.jpg "River in Hovlandsdal")
-* ![tulum (453)](tulum.jpg "Tulum, Mexico")
-* ![shells (422)](shells.jpg "Seashells")
-* ![unicode (236)](unicode.jpg "Aqaba, Jordan")
-* ![beach (546)](beach.jpg "Beach near Krabi, Thailand")
-* ![meercat (637)](meercat.jpg "Meercat")
-* ![towers (423)](towers.jpg "Petronas Towers")
-* ![bridges (226)](bridges.jpg "Grimstad, Norway")
-* ![paris (178)](paris.jpg "Paris, France")
-* ![panda (441)](red-panda.jpg "Red Panda <3")
-* ![sea (436)](sea.jpg "Thailand")
-* ![rome (405)](rome.jpg "Rome")
-* ![keg (226)](keg.jpg "Beer keg")
-`;
diff --git a/src/App/Document/data/links.js b/src/App/Document/data/links.js
deleted file mode 100644
index 5904993..0000000
--- a/src/App/Document/data/links.js
+++ /dev/null
@@ -1,40 +0,0 @@
-export default `
-## React router link renderer
-
-This example renders [links](https://en.wikipedia.org/wiki/Hyperlink) without
-a protocol as [react router](https://github.com/reactjs/react-router) links,
-while "external" links are handled with regular links. External links also get
-a nice little cloud icon thrown in to symbolize they are... well, external.
-The \`target\` attribute is also set to \`_blank\` on the external ones.
-
-In much the same way as the [syntax highlighting](/code) example,
-there really is very little you can't do with this flexibility.
-
-Hard to come up with some dummy text here, so let me just throw in another
-[relative link](/image) to be handled by react-router.
-
-In it's bare essentials, to simply render a link using React Router:
-
-\`\`\`js
-const React = require('react')
-const ReactDOM = require('react-dom')
-const Markdown = require('react-markdown')
-const Link = require('react-router').Link
-
-function RouterLink(props) {
- return (
- props.href.match(/^(https?:)?\\/\\//)
- ? {props.children}
- : {props.children}
- );
-}
-
-ReactDOM.render(
- ,
- document.body
-)
-\`\`\`
-`;
diff --git a/src/App/Header/Header.css b/src/App/Header/Header.css
deleted file mode 100644
index b37f696..0000000
--- a/src/App/Header/Header.css
+++ /dev/null
@@ -1,13 +0,0 @@
-.search{
- width: 500px;
- margin:5px 200px 0 ;
- float: right;
-}
-
-.headerPic{
- margin-left: 50px;
- float: left;
- height: 40px;
- display: block;
- max-width: 100%;
-}
\ No newline at end of file
diff --git a/src/App/Header/Header.js b/src/App/Header/Header.js
deleted file mode 100644
index 276df6a..0000000
--- a/src/App/Header/Header.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import React,{Component} from 'react';
-import { Input } from 'antd';
-import './Header.css';
-import logopng from '../../resource/logo.png';
-
-const { Search } = Input;
-
-
-class Header extends Component{
- render(){
- return (
- console.log(value)} />
- );
- }
-
-}
-
-export default Header;
\ No newline at end of file
diff --git a/src/App/Home/Home.css b/src/App/Home/Home.css
deleted file mode 100644
index afb51e8..0000000
--- a/src/App/Home/Home.css
+++ /dev/null
@@ -1,19 +0,0 @@
-.home{
- text-align: center;
- font-size: 50px;
-}
-.homePic{
- display: block;
- height: auto;
- max-width: 100%;
-}
-.ant-descriptions-item-label{
- color:rgba(240, 52, 52, 1)
-}
-.homeH3{
- color:rgba(0, 0, 0, 0.85);
- line-height:1.5;
- font-size: 16px;
- margin-bottom: 20px;
- font-weight: bold;
-}
\ No newline at end of file
diff --git a/src/App/Home/Home.js b/src/App/Home/Home.js
deleted file mode 100644
index c7bae6f..0000000
--- a/src/App/Home/Home.js
+++ /dev/null
@@ -1,107 +0,0 @@
-import React, { Component } from 'react';
-import './Home.css';
-import { Timeline, Icon,Card,List ,Descriptions,Typography } from 'antd';
-import world_pic from '../../resource/world.jpg';
-
-const { Text,Title,Paragraph } = Typography;
-const data = [
- {
- title: '随想',
- description:
-
- :当浏览网页查找资料的时候,通过自己编写的插件,将网址和title保存到这里,方便之后查找,搜索,将各种随便化的信息集中起来,类似于软件
- Pocket的功能
-
-
-
- },
- {
- title: '文章',
- description: ':会不时总结自己认为有价值的问题。'
- },
- {
- title: 'Github',
- description: ':欢迎一次合作完成项目,或对项目提出建议'
- },
- {
- title: '微博',
- description: ':欢迎互粉,点赞,评论,@'
- },
- {
- title: '留言',
- description: ':有什么话想说都可以写在这里'
- }
- ];
-class Home extends Component{
- render(){
- return (
-
-
- 欢迎来到我的个人网站
-
- 就职于格尔软件西安分公司
- 西北农林科技大学 16年毕业 (985院校)
- 陕西 西安 高新区
- ximouzhao@foxmail.com
-
- 各种球类运动,打游戏,写代码,探讨人生...
-
-
-
-
- 本站相关技术:
- 本站技术栈:React + antd + springboot + mysql
-
- 前台代码同步Github:knowme_front
-
- 后台代码同步Github:knowme_background
-
- 全部使用markdown语法来进行文章的编写,包括留言,致谢react-markdown项目
-
-
- 功能介绍:
- (
-
-
- {item.title}
- {item.description}
-
-
- )}
- />
-
-
- 开发进度:
-
- }>
- 待办事项:
-
1.登录管理,需要支持Github登录
-
2.文章支持锚点
-
3.显示文章阅读数
-
4.点赞评论功能
-
- 前台搜索功能
- 实现后台逻辑删除
- 实现滚动热加载
- 优化在移动端设备显示
- 实现后台新增文章的功能
-
- 确定前台页面,增加后台管理页面
-
- 编写前台页面
- 实现图片上传
-
- 熟悉Ant Design 搭建前后台工程
-
-
-
-
- );
- }
-}
-
-export default Home;
\ No newline at end of file
diff --git a/src/App/Menu/MainLeftMenu.css b/src/App/Menu/MainLeftMenu.css
deleted file mode 100644
index e69de29..0000000
diff --git a/src/App/Menu/MainLeftMenu.js b/src/App/Menu/MainLeftMenu.js
deleted file mode 100644
index 930bba0..0000000
--- a/src/App/Menu/MainLeftMenu.js
+++ /dev/null
@@ -1,88 +0,0 @@
-import React,{Component} from 'react'
-import { Menu, Icon ,Layout} from 'antd';
-import { BrowserRouter,Route,Link } from 'react-router-dom';
-import './MainLeftMenu.css';
-
-const { SubMenu } = Menu;
-class MainLeftMenu extends Component{
- // submenu keys of first level
- rootSubmenuKeys = ['sub1', 'sub2', 'sub4'];
-
- state = {
- openKeys: ['sub1'],
- };
-
- onOpenChange = openKeys => {
- const latestOpenKey = openKeys.find(key => this.state.openKeys.indexOf(key) === -1);
- if (this.rootSubmenuKeys.indexOf(latestOpenKey) === -1) {
- this.setState({ openKeys });
- } else {
- this.setState({
- openKeys: latestOpenKey ? [latestOpenKey] : [],
- });
- }
- };
- render(){
- return (
-
-
- );
- }
-}
-export default MainLeftMenu;
\ No newline at end of file
diff --git a/src/App/MessageBoard/MessageBoard.css b/src/App/MessageBoard/MessageBoard.css
deleted file mode 100644
index e028bcf..0000000
--- a/src/App/MessageBoard/MessageBoard.css
+++ /dev/null
@@ -1,34 +0,0 @@
-@import '~antd/dist/antd.css';
-
-.messageBoard{
- /* background:url("resource/body_bg.jpg") no-repeat top center; */
- display: block;
- text-align: center;
- top:40px;
-}
-.messageBoard img {
- display: block;
- height: auto;
- max-width: 100%;
-}
-
-.editArea{
- background-color: #fff;
- padding:30px;
- box-shadow: 0 0 2px rgba(0,0,0,0.2);
- border-radius:2px;
-}
-
-code {
- font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
- monospace;
-}
-.ant-upload-select-picture-card i {
- font-size: 32px;
- color: #999;
-}
-
-.ant-upload-select-picture-card .ant-upload-text {
- margin-top: 8px;
- color: #666;
-}
\ No newline at end of file
diff --git a/src/App/MessageBoard/MessageBoard.js b/src/App/MessageBoard/MessageBoard.js
deleted file mode 100644
index 595fc17..0000000
--- a/src/App/MessageBoard/MessageBoard.js
+++ /dev/null
@@ -1,327 +0,0 @@
-import React, { Component } from 'react';
-import './MessageBoard.css';
-import { Input , Modal,Upload, message, Button, Icon,Alert ,Spin} from 'antd';
-import MessageList from './MessageList';
-import WrapFetch from '../../Tools/WrapFetch';
-import DocumentType from '../../Constant/DocumentType';
-import SparkMD5 from 'spark-md5';
-import InfiniteScroll from 'react-infinite-scroller';
-
-function getBase64(file) {
- return new Promise((resolve, reject) => {
- const reader = new FileReader();
- reader.readAsDataURL(file);
- reader.onload = () => resolve(reader.result);
- reader.onerror = error => reject(error);
- });
-}
-class MessageBoard extends Component {
-
- //state状态 value值得是
- state ={
- txtValue:'',
- list:[],
- loading: false,
- tip:'',
- fileList: [],
- uploading: false,
- previewVisible: false,
- previewImage: '',
- picAddDisabled:false,
- btnPublishDisabled:true,
- modelVisible:false,
- // start 滚动加载
- hasMore: true,
- pageNum: 0,
- pageSize: 20,
- total: 0
- // end
- };
- onRemove=(file)=>{
- this.setState(state => {
- const index = state.fileList.indexOf(file);
- const newFileList = state.fileList.slice();
- newFileList.splice(index, 1);
- return {
- fileList: newFileList,
- };
- });
- }
- isEmpty=(str)=>{
- if(str!== undefined&&str!==null && str.length!=0){
- return false;
- }else{
- return true;
- }
- }
- handleCancel = () => this.setState({ previewVisible: false });
-
- handlePreview = async file => {
- console.log(file);
- //这里也是包装后的File类型,file.originFileObj是原生类型
- if (!file.url && !file.preview) {
- file.preview = await getBase64(file.originFileObj);
- }
- this.setState({
- previewImage: file.url || file.preview,
- previewVisible: true,
- });
- };
- handleChange = ({ fileList }) =>{
- //这里的fileList是对File进行包装之后的类型,file.originFileObj是原生类型
- if(fileList.length>=9){
- this.setState({ fileList:fileList,picAddDisabled:true });
- }else{
- this.setState({ fileList:fileList,picAddDisabled:false });
- }
- if(this.isEmpty(fileList)&&this.isEmpty(this.state.txtValue)){
- this.setState({btnPublishDisabled:true});
- }else{
- this.setState({btnPublishDisabled:false});
- }
- }
- beforeUpload=(file)=>{
- //这里的fileList是原生File类型
- const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'|| file.type === 'image/jpg';
- if (!isJpgOrPng) {
- message.error('文件类型必须是 JPG或者PNG !');
- }
- const isLt2M = file.size / 1024 / 1024 < 10;
- if (!isLt2M) {
- message.error('图像大小必须小于10MB!');
- }
- let filename=file.name;
- let markdownUseFileName=filename;
- //markdwown需要转义一些字符
- let parseArr={
- "\\\\":"\\","\\`":"`",
- "\\*":"*","\\_":"_",
- "\\{":"{","\\}":"}",
- "\\[":"[","\\]":"]",
- "\\(":"(","\\)":")",
- "\\#":"#","\\+":"+",
- "\\-":"-","\\!":"!"
- };
- for(let key in parseArr){
- let reg=new RegExp(key,"g");
- markdownUseFileName=markdownUseFileName.replace(reg,"\\"+parseArr[key]);
- }
- file.markdownUseFileName=markdownUseFileName;
- //let fileList=this.state.fileList;
- if (!file.url ){
- //let spark = new SparkMD5();
- const reader = new FileReader();
- reader.readAsBinaryString(file);
- reader.onload = function(e){
- file.fileMd5=SparkMD5.hashBinary(e.target.result);
- }
- }
-
- return false;
- }
- handleUpload = async (fileList) => {
- const formData = new FormData();
- //formData.append('file', fileList[0].originFileObj);
- fileList.forEach(file => {
- formData.append('files', file.originFileObj);
- });
-
- this.setState({
- uploading: true,
- });
- await fetch('/api/file/upload', {
- method: 'post',
- body: formData,
- }).then(response => response.json())
- .then((data) => {
- this.setState({
- fileList: [],
- uploading: false,
- btnPublishDisabled:true,
- });
- //message.success('图片上传成功');
- return "success";
- }).catch((err)=>{
- this.setState({
- uploading: false,
- });
- // message.error('上传图片失败');
- return "fail";
- });
- };
- saveDocument=async (fileList,txtValue)=>{
- console.log(DocumentType.MESSAGE);
- let markdownPic='';
- fileList.forEach(file => {
- markdownPic+="\n![" + file.markdownUseFileName + "](/api/files/" + file.originFileObj.fileMd5+file.name.substr(file.name.lastIndexOf('.')) + ")";
- });
- txtValue+=markdownPic;
- let url=`/api/document/addDocument?type=${DocumentType.MESSAGE}&`+this.changeJSON2QueryString({content:txtValue});
- await fetch(url).then(res=>{
- //message.success('成功发表留言');
- this.setState({txtValue:''});
- })
-
- };
- publishMessage=async ()=>{
- this.setState({btnPublishDisabled:true});
- const { fileList ,txtValue} = this.state;
- this.setState({loading:true,tip:'正在上传图片...'})
- await this.handleUpload(fileList);
- this.setState({tip:'正在保存留言...'})
- await this.saveDocument(fileList,txtValue);
- this.setState({tip:'正在重新加载...'})
- await this.getFirstData();
- this.setState({loading:false})
- }
- showModal =() => {
- this.setState({
- modelVisible: true,
- });
- };
- closeModal = () => {
- this.setState({
- modelVisible: false,
- });
- };
-
-
- changeJSON2QueryString(JSON){
- var temp = [];
- for(var k in JSON){
- temp.push(k + "=" + encodeURIComponent(JSON[k]));
- }
- return temp.join("&");
- }
- hanldleTextAreaChange=(event)=>{
- if(event && event.target){
- let txtValue=event.target.value;
- this.setState(()=>({txtValue:txtValue}));
- }
- console.log(this.fileList);
- console.log(this.state.txtValue);
- if(this.isEmpty(this.fileList)&&this.isEmpty(event.target.value)){
- this.setState({btnPublishDisabled:true});
- }else{
- this.setState({btnPublishDisabled:false});
- }
- };
- handleSaveButtonClick=(event)=>{
- console.log('button click');
- if(event && event.target ){
- this.publishMessage();
- }
- };
-
- async componentDidMount(){
- this.getFirstData();
- };
- getFirstData= ()=>{
- this.setState({loading:true,tip:'正在加载留言...'})
- WrapFetch.get(
- {
- url: `/api/document/findByPageAndType`,
- queryParam: { type: DocumentType.MESSAGE, page: 0, pageSize: this.state.pageSize }
- }
- ).then(
- (data) => {
- this.setState({ list: data.content, total: data.totalElements, hasMore: data.totalPages > 1, loading: false });
- }
- );
- }
- // 获取下一页信息
- getMore = (page) => {
- console.log("getmore",page)
- if (this.state.total === this.state.list.length) {
- return;
- }
- this.setState({
- pageNum: page
- }, () => {
- this.getMoreData(page); //请求数据接口
- });
- }
- getMoreData = (page) => {
- WrapFetch.get(
- {
- url: `/api/document/findByPageAndType`,
- queryParam: { type: DocumentType.MESSAGE, page: page, pageSize: this.state.pageSize }
- }
- ).then(
- (data) => {
- this.setState({ list: this.state.list.concat(data.content), total: data.totalElements, hasMore: data.totalPages > page+1});
- }
- );
- };
- render() {
- const { TextArea } = Input;
-
- const uploadButton = (
-
-
- 添加图片
-
- );
- const tip = (
-
-
-
- );
- //const { imageUrl } = this.state;
- const { previewVisible, previewImage, fileList,picAddDisabled, btnPublishDisabled} = this.state;
- return (
-
-
-
-
- Loading ... }
- >
-
- {/* Tip:内部元素不要加高度以及overflow:auto等属性!!!! */}
- {!this.state.hasMore ? -------- 你已经看完所有的留言啦 -------- : ""}
-
-
-
-
-
- );
- }
-}
-
-export default MessageBoard;
diff --git a/src/App/MessageBoard/MessageContent.css b/src/App/MessageBoard/MessageContent.css
deleted file mode 100644
index 17a07c9..0000000
--- a/src/App/MessageBoard/MessageContent.css
+++ /dev/null
@@ -1,67 +0,0 @@
-.messageContent{
- background-color: #fff;
- margin: 10px 0 10px 0;
- padding: 20px 20px 0 20px;
- /*border:1px solid #ebedf0;*/
- box-shadow: 0 0 2px rgba(0,0,0,0.2);
- border-radius:2px;
- display:block;
- text-align: left;
- position: relative;
- overflow: hidden;
-}
-
-
-.messageContent .headPhoto{
- height: 50px;
- width: 50px;
- border-radius:50%;
- overflow: hidden;
- display: inline-block;
- position:relative;
- margin-top: 0;
- /*重要*/
- float:left;
-}
-.messageContent .content{
- margin-left: 60px;
-}
-.messageContent .header{
-}
-.messageContent .markdown{
- padding-top: 1px;
-}
-.messageContent .handle{
- border-top-width:1px;
- border-top-style:solid;
- border-color:#f2f2f5;
- line-height:22px;
- font-size: 14px;
-}
-.messageContent .name{
- color:#333;
- text-decoration:none;
- font-size:14px;
- font-weight:700;
- margin: 5px 0 7px 0;
-}
-.messageContent .time{
- margin-bottom:2px;
- color:#808080;
- font-size: 12px;
-}
-.messageContent .comment{
- width: 50%;
- display: inline-block;
- text-align: center;
- margin:7px 0;
-}
-.messageContent .like{
- width: 50%;
- display: inline-block;
- text-align: center;
- margin:7px 0;
- border-left-width:1px;
- border-left-style:solid;
- border-color:#d9d9d9;
-}
\ No newline at end of file
diff --git a/src/App/MessageBoard/MessageContent.js b/src/App/MessageBoard/MessageContent.js
deleted file mode 100644
index 859c0e3..0000000
--- a/src/App/MessageBoard/MessageContent.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import React,{Component} from 'react';
-import ReactMarkdown from 'react-markdown';
-import CodeBlock from '../../Tools/CodeBlock';
-import ImageBlock from '../../Tools/ImageBlock';
-import { Icon } from 'antd';
-import './MessageContent.css';
-import headPtoto from '../../resource/head_photo.png';
-import IconKnowMe from '../../Icon/IconKnowMe';
-
-class MessageContent extends Component{
-
- // componentDidMount(){
- // let width=this.refs.messageContent.scrollWidth;
- // console.log(this.refs.messageContent.scrollWidth);
- // console.log('width='+width);
- // let iframe=this.refs.content.children[1].getElementsByTagName("iframe");
- // if(iframe.length>0){
- // for(var i=0;i
-
-
-
- {this.props.element.id}
- {this.props.element.ts}
-
-
-
-
- 评论
- 点赞
-
-
- );
- }
-}
-export default MessageContent;
\ No newline at end of file
diff --git a/src/App/MessageBoard/MessageList.css b/src/App/MessageBoard/MessageList.css
deleted file mode 100644
index 1293acb..0000000
--- a/src/App/MessageBoard/MessageList.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.messageList{
- margin:0;
-}
\ No newline at end of file
diff --git a/src/App/MessageBoard/MessageList.js b/src/App/MessageBoard/MessageList.js
deleted file mode 100644
index 71d0c98..0000000
--- a/src/App/MessageBoard/MessageList.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import React, { Component } from 'react';
-import MessageContent from './MessageContent'
-import { message } from 'antd';
-import './MessageList.css';
-
-class MessageList extends Component {
-
- render() {
- let messageContents = [];
- this.props.list.forEach((element, index, array) => {
- try {
- messageContents.push( );
- } catch (err) {
- message.error(err + '');
- }
- });
- return ({messageContents})
- }
-}
-export default MessageList;
\ No newline at end of file
diff --git a/src/App/MySearch/MySearch.css b/src/App/MySearch/MySearch.css
deleted file mode 100644
index 877d3d8..0000000
--- a/src/App/MySearch/MySearch.css
+++ /dev/null
@@ -1,25 +0,0 @@
-.search_img_normal {
- z-index: 0;
- float: left;
- display: block;
- height: auto;
- max-width: 100%;
- position: relative;
-}
-.search_normal {
- z-index: 3;
- align-items:center;
- display: flex;
- justify-content: center;
- flex-direction: column;
- height: 100%;
- max-width: 70%;
- position: absolute;
-}
-.search_img_hidden {
- z-index: 0;
- display: none;
-}
-.search_searching {
-
-}
\ No newline at end of file
diff --git a/src/App/MySearch/MySearch.js b/src/App/MySearch/MySearch.js
deleted file mode 100644
index 8f9b44f..0000000
--- a/src/App/MySearch/MySearch.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import React, { Component } from 'react';
-import './MySearch.css';
-import moment from 'moment';
-import { Icon, Card, List, Descriptions, Typography ,Spin} from 'antd';
-import WrapFetch from '../../Tools/WrapFetch';
-import SearchResult from './SearchResult';
-import { Input } from 'antd';
-const { Search } = Input;
-class MySearch extends Component {
- state = {
- isShowImg: true,
- loading:false,
- tip: "正在查询",
- list: [],
- text: "",
- // start 滚动加载
- hasMore: true,
- pageNum: 0,
- pageSize: 20,
- total: 0
- // end
- };
- onSearchChange=(value)=>{
- console.log(value)
- }
- onSearchClick = (value) => {
- console.log(value)
- this.setState({ text: value,list: [] ,loading:true,isShowImg:false},this.getMore)
- };
- getMore=()=> {
- WrapFetch.get(
- {
- url: `/api/document/search`,
- queryParam: { text: this.state.text, page: this.state.pageNum, pageSize: this.state.pageSize }
- }
- ).then(
- (data) => {
- data.content.forEach((item)=>{
- item.ts=moment(item.ts).format("YYYY-MM-DD HH:mm:ss");
- })
- this.setState({ list: this.state.list.concat(data.content), total: data.totalElements, hasMore: data.totalPages > 1, loading: false });
- }
- );
- }
- render() {
- let SearchResults = [];
- this.state.list.forEach((element, index, array) => {
- SearchResults.push( );
- });
- return (
-
- this.onSearchClick(value)} enterButton
- onChange={this.onSearchChange}/>
-
-
- {SearchResults}
-
-
- );
- }
-}
-
-export default MySearch;
\ No newline at end of file
diff --git a/src/App/MySearch/SearchResult.js b/src/App/MySearch/SearchResult.js
deleted file mode 100644
index 198e78e..0000000
--- a/src/App/MySearch/SearchResult.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import React, { Component } from 'react';
-import { Card, Col, Row } from 'antd';
-import { Link } from 'react-router-dom';
-import MessageContent from '../MessageBoard/MessageContent';
-import ThinkContent from '../Think/ThinkContent';
-class SearchResult extends Component {
- render() {
- let name = this.props.element.name == undefined ? "" : this.props.element.name;
- let detail;
- if (this.props.element.type == "ARTICLE") {
- detail = (
-
- {this.props.element.content}
- );
- } else if (this.props.element.type == "MESSAGE") {
- detail = ( );
- } else {
- detail =
- }
- return (
-
-
-
- {detail}
-
-
-
- );
- }
-}
-export default SearchResult;
\ No newline at end of file
diff --git a/src/App/Think/ThinkContent.js b/src/App/Think/ThinkContent.js
deleted file mode 100644
index 4e8138f..0000000
--- a/src/App/Think/ThinkContent.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import React, { Component } from 'react';
-import { Skeleton, Switch, Card, Icon, Avatar } from 'antd';
-import IconKnowMe from '../../Icon/IconKnowMe';
-import ReactMarkdown from 'react-markdown';
-import CodeBlock from '../../Tools/CodeBlock';
-import ImageBlock from '../../Tools/ImageBlock';
-const { Meta } = Card;
-
-
-class ThinkContent extends Component{
- render(){
- return (
- , ]}
- >
-
-
- }
- title={this.props.element.ts}
- description={ }
- />
-
-
- );
- }
-}
-
-export default ThinkContent;
\ No newline at end of file
diff --git a/src/App/Think/ThinkList.js b/src/App/Think/ThinkList.js
deleted file mode 100644
index 941598e..0000000
--- a/src/App/Think/ThinkList.js
+++ /dev/null
@@ -1,86 +0,0 @@
-import React, { Component } from 'react';
-import WrapFetch from '../../Tools/WrapFetch';
-import ThinkContent from './ThinkContent';
-import DocumentType from '../../Constant/DocumentType';
-import { message } from 'antd';
-import InfiniteScroll from 'react-infinite-scroller';
-
-class ThinkList extends Component {
- state = {
- list: [{ title: '1', content: '1' }, { title: '2', content: '2' }, { title: '3', content: '3' }, { title: '4', content: '4' }],
- loading: true,
- // start 滚动加载
- hasMore: true,
- pageNum: 0,
- pageSize: 20,
- total: 0
- // end
- };
- // 获取下一页信息
- getMore = (page) => {
- console.log("getmore",page)
- if (this.state.total === this.state.list.length) {
- return;
- }
- this.setState({
- pageNum: page
- }, () => {
- this.getMoreData(page); //请求数据接口
- });
- }
- componentDidMount() {
- this.getFirstData();
- }
- getFirstData = () => {
- this.setState({ loading: { tip: '正在加载...', spinning: true } });
- WrapFetch.get(
- {
- url: `/api/document/findByPageAndType`,
- queryParam: { type: DocumentType.THINK, page: 0, pageSize: this.state.pageSize }
- }
- ).then(
- (data) => {
- this.setState({ list: data.content, total: data.totalElements, hasMore: data.totalPages > 1, loading: false });
- }
- );
- }
- getMoreData = (page) => {
- WrapFetch.get(
- {
- url: `/api/document/findByPageAndType`,
- queryParam: { type: DocumentType.THINK, page: page, pageSize: this.state.pageSize }
- }
- ).then(
- (data) => {
- this.setState({ list: this.state.list.concat(data.content), total: data.totalElements, hasMore: data.totalPages > page+1, scrollLoading: false });
- }
- );
- };
- render() {
- let ThinkContents = [];
- this.state.list.forEach((element, index, array) => {
- ThinkContents.push( );
- });
- return (
-
- Loading ... }
- >
- {ThinkContents}
- {/* Tip:内部元素不要加高度以及overflow:auto等属性!!!! */}
- {!this.state.hasMore ? -------- 你已经看完所有的随想啦 -------- : ""}
-
-
- );
-
- }
-
-}
-export default ThinkList;
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index a013f53..1a6950f 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,7 +2,6 @@ import 'react-app-polyfill/ie9';
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
-import App from './App/App';
import Admin from './Admin/Admin'
import { BrowserRouter,Route } from 'react-router-dom'
import * as serviceWorker from './serviceWorker';
@@ -16,9 +15,7 @@ ReactDOM.render(
forceRefresh={optionalBool}
getUserConfirmation={optionalFunc}
keyLength={optionalNumber} */>
-
-
-
+
,
document.getElementById('root'));