├── service ├── .eslintignore ├── .eslintrc ├── jsconfig.json ├── .gitignore ├── app │ ├── router.js │ ├── middleware │ │ └── adminauth.js │ ├── router │ │ ├── default.js │ │ └── admin.js │ └── controller │ │ ├── default │ │ └── home.js │ │ └── admin │ │ └── main.js ├── .travis.yml ├── appveyor.yml ├── config │ ├── plugin.js │ └── config.default.js ├── .autod.conf.js ├── test │ └── app │ │ └── controller │ │ └── home.test.js ├── README.md └── package.json ├── admin_app ├── src │ ├── react-app-env.d.ts │ ├── static │ │ └── css │ │ │ ├── ArticleList.css │ │ │ ├── BBDList.css │ │ │ ├── Login.css │ │ │ ├── AdminIndex.css │ │ │ └── AddArticle.css │ ├── index.js │ ├── pages │ │ ├── Main.js │ │ ├── Login.js │ │ ├── AdminIndex.js │ │ ├── ArticleList.js │ │ ├── BBDList.js │ │ └── AddArticle.js │ ├── config │ │ └── apiUrl.js │ └── components │ │ └── tocify.tsx ├── public │ ├── robots.txt │ ├── favicon.ico │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── index.html ├── .gitignore ├── tsconfig.json ├── package.json └── README.md ├── blog ├── static │ ├── favicon.ico │ ├── style │ │ ├── components │ │ │ ├── footer.css │ │ │ ├── advert.css │ │ │ ├── studyLine.css │ │ │ ├── rightmi.css │ │ │ ├── author.css │ │ │ └── header.css │ │ └── pages │ │ │ ├── bibidao.css │ │ │ ├── list.css │ │ │ ├── index.css │ │ │ ├── comm.css │ │ │ ├── detailed.css │ │ │ └── han.css │ └── test.md ├── now.json ├── pages │ ├── _app.js │ ├── bibidao.js │ ├── list.js │ ├── detailed.js │ └── index.js ├── next.config.js ├── components │ ├── Footer.js │ ├── Heading.js │ ├── Advert.js │ ├── HeadingBlock.js │ ├── CodeBlock.js │ ├── StudyLine.js │ ├── tocify.tsx │ ├── LearningRoute.js │ ├── Header.js │ ├── Author.js │ └── Rightmi.js ├── .babelrc ├── .gitignore ├── config │ └── apiUrl.js └── package.json ├── .gitignore └── README.md /service/.eslintignore: -------------------------------------------------------------------------------- 1 | coverage 2 | -------------------------------------------------------------------------------- /service/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint-config-egg" 3 | } 4 | -------------------------------------------------------------------------------- /service/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": [ 3 | "**/*" 4 | ] 5 | } -------------------------------------------------------------------------------- /admin_app/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /admin_app/src/static/css/ArticleList.css: -------------------------------------------------------------------------------- 1 | .list-div{ 2 | width: 100%; 3 | } -------------------------------------------------------------------------------- /admin_app/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /admin_app/src/static/css/BBDList.css: -------------------------------------------------------------------------------- 1 | .cart-list-url{ 2 | word-wrap:break-word 3 | 4 | } -------------------------------------------------------------------------------- /blog/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenghy/react_blog/HEAD/blog/static/favicon.ico -------------------------------------------------------------------------------- /admin_app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenghy/react_blog/HEAD/admin_app/public/favicon.ico -------------------------------------------------------------------------------- /admin_app/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenghy/react_blog/HEAD/admin_app/public/logo192.png -------------------------------------------------------------------------------- /admin_app/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenghy/react_blog/HEAD/admin_app/public/logo512.png -------------------------------------------------------------------------------- /blog/now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "builds": [{ "src": "next.config.js", "use": "@now/next" }] 4 | } -------------------------------------------------------------------------------- /admin_app/src/static/css/Login.css: -------------------------------------------------------------------------------- 1 | .login-div{ 2 | margin: 150px auto; 3 | width: 400px; 4 | } 5 | body{ 6 | background-color: #f0f0f0; 7 | } -------------------------------------------------------------------------------- /blog/pages/_app.js: -------------------------------------------------------------------------------- 1 | import App from 'next/app' 2 | 3 | import 'antd/dist/antd.css' 4 | import '../static/style/pages/comm.css' 5 | 6 | export default App -------------------------------------------------------------------------------- /blog/static/style/components/footer.css: -------------------------------------------------------------------------------- 1 | .footer-div{ 2 | text-align: center; 3 | width: 100%; 4 | padding: 1rem; 5 | color:#888; 6 | height: 100px; 7 | } -------------------------------------------------------------------------------- /blog/static/style/components/advert.css: -------------------------------------------------------------------------------- 1 | .ad-div{ 2 | margin-top: .5rem; 3 | } 4 | .ad-div div{ 5 | border-radius: .3rem; 6 | margin-bottom: .2rem; 7 | overflow: hidden; 8 | } -------------------------------------------------------------------------------- /admin_app/src/static/css/AdminIndex.css: -------------------------------------------------------------------------------- 1 | .logo { 2 | height: 32px; 3 | background: rgba(255, 255, 255, 0.2); 4 | margin: 16px; 5 | font-size: 19px; 6 | color: #ccc; 7 | text-align: center; 8 | 9 | } -------------------------------------------------------------------------------- /blog/next.config.js: -------------------------------------------------------------------------------- 1 | const withCss = require('@zeit/next-css') 2 | 3 | if(typeof require !== 'undefined'){ 4 | require.extensions['.css']=file=>{} 5 | } 6 | 7 | module.exports = withCss({ 8 | target: 'serverless' 9 | }) -------------------------------------------------------------------------------- /admin_app/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import Main from './pages/Main' 4 | 5 | 6 | 7 | 8 | ReactDOM.render(
, document.getElementById('root')); 9 | 10 | 11 | -------------------------------------------------------------------------------- /service/.gitignore: -------------------------------------------------------------------------------- 1 | logs/ 2 | npm-debug.log 3 | yarn-error.log 4 | node_modules/ 5 | package-lock.json 6 | yarn.lock 7 | coverage/ 8 | .idea/ 9 | run/ 10 | .DS_Store 11 | *.sw* 12 | *.un~ 13 | typings/ 14 | .nyc_output/ 15 | -------------------------------------------------------------------------------- /service/app/router.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | /** 3 | * @param {Egg.Application} app - egg application 4 | */ 5 | module.exports = app => { 6 | 7 | require('./router/default')(app) 8 | require('./router/admin')(app) 9 | }; 10 | -------------------------------------------------------------------------------- /service/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - '10' 5 | before_install: 6 | - npm i npminstall -g 7 | install: 8 | - npminstall 9 | script: 10 | - npm run ci 11 | after_script: 12 | - npminstall codecov && codecov 13 | -------------------------------------------------------------------------------- /blog/components/Footer.js: -------------------------------------------------------------------------------- 1 | import '../static/style/components/footer.css' 2 | const Footer = ()=>( 3 |
4 |
系统由 React+Node+Ant Desgin驱动
5 |
JSPang.com
6 |
7 | ) 8 | 9 | export default Footer -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /service/node_modules 2 | /service/logs 3 | /service/run 4 | /service/package-lock.json 5 | /service/yarn.lock 6 | /blog/node_modules 7 | /blog/out 8 | /blog/.next 9 | /blog/package-lock.json 10 | /blog/yarn.lock 11 | /admin_app/node_modules 12 | /admin_app/yarn.lock 13 | -------------------------------------------------------------------------------- /blog/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets":["next/babel"], //Next.js的总配置文件,相当于继承了它本身的所有配置 3 | "plugins":[ //增加新的插件,这个插件就是让antd可以按需引入,包括CSS 4 | [ 5 | "import", 6 | { 7 | "libraryName":"antd" 8 | } 9 | ] 10 | ] 11 | } -------------------------------------------------------------------------------- /service/app/middleware/adminauth.js: -------------------------------------------------------------------------------- 1 | module.exports = options =>{ 2 | return async function adminauth(ctx,next){ 3 | console.log(ctx.session.openId) 4 | if(ctx.session.openId){ 5 | await next() 6 | }else{ 7 | ctx.body={data:'没有登录'} 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /service/appveyor.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | matrix: 3 | - nodejs_version: '10' 4 | 5 | install: 6 | - ps: Install-Product node $env:nodejs_version 7 | - npm i npminstall && node_modules\.bin\npminstall 8 | 9 | test_script: 10 | - node --version 11 | - npm --version 12 | - npm run test 13 | 14 | build: off 15 | -------------------------------------------------------------------------------- /blog/static/style/pages/bibidao.css: -------------------------------------------------------------------------------- 1 | .bbd-img{ 2 | border-radius: 5px; 3 | display:inline-block; 4 | } 5 | .bbd-title{ 6 | margin-top:10px; 7 | } 8 | .bbd-zi{ 9 | color: #888; 10 | } 11 | .item-div{ 12 | width: 100%; 13 | overflow: hidden; 14 | } 15 | .img-wrapper{ 16 | display: block; 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /blog/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | .env* 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | -------------------------------------------------------------------------------- /blog/components/Heading.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const elements = { 4 | h1: "h1", 5 | h2: "h2", 6 | h3: "h3", 7 | h4: "h4", 8 | h5: "h5", 9 | h6: "h6" 10 | }; 11 | 12 | function Heading({ level, children, ...props }) { 13 | return React.createElement(elements[level] || elements.h1, props, children); 14 | } 15 | 16 | Heading.defaultProps = { 17 | type: "h1" 18 | }; 19 | 20 | export default Heading; -------------------------------------------------------------------------------- /admin_app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | # ffddf 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /service/config/plugin.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** @type Egg.EggPlugin */ 4 | // module.exports = { 5 | // // had enabled by egg 6 | // // static: { 7 | // // enable: true, 8 | // // } 9 | // }; 10 | 11 | //配置插件 12 | exports.mysql = { 13 | enable: true, 14 | package: 'egg-mysql' 15 | } 16 | 17 | exports.cors = { 18 | enable: true, 19 | package: 'egg-cors' 20 | } 21 | 22 | exports.origin = { 23 | enable: true, 24 | package: 'egg-origin', 25 | } -------------------------------------------------------------------------------- /blog/components/Advert.js: -------------------------------------------------------------------------------- 1 | import '../static/style/components/advert.css' 2 | 3 | const Advert = ()=>{ 4 | return ( 5 |
6 | 7 |
8 | 9 | 10 | 11 |
12 | 13 |
14 | ) 15 | } 16 | 17 | export default Advert -------------------------------------------------------------------------------- /service/.autod.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | write: true, 5 | prefix: '^', 6 | plugin: 'autod-egg', 7 | test: [ 8 | 'test', 9 | 'benchmark', 10 | ], 11 | dep: [ 12 | 'egg', 13 | 'egg-scripts', 14 | ], 15 | devdep: [ 16 | 'egg-ci', 17 | 'egg-bin', 18 | 'egg-mock', 19 | 'autod', 20 | 'autod-egg', 21 | 'eslint', 22 | 'eslint-config-egg', 23 | ], 24 | exclude: [ 25 | './test/fixtures', 26 | './dist', 27 | ], 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /blog/static/style/components/studyLine.css: -------------------------------------------------------------------------------- 1 | .sl-row{ 2 | padding:5px 0px; 3 | border-bottom:1px solid #eee; 4 | } 5 | .sl-title{ 6 | padding-left: 5px; 7 | font-size: 1rem; 8 | color:#888 !important; 9 | } 10 | .sl-title1{ 11 | padding-top: 5px;; 12 | font-size: 0.8rem; 13 | color: #ccc; 14 | } 15 | .sl-icon{ 16 | padding-top: 5px; 17 | } 18 | .ls-main-title{ 19 | font-size: 1rem; 20 | text-align: center; 21 | color: #888; 22 | padding: 6px; 23 | border-bottom: 1px solid #eee; 24 | 25 | } -------------------------------------------------------------------------------- /admin_app/src/pages/Main.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { BrowserRouter as Router, Route} from "react-router-dom"; 3 | 4 | import Login from './Login' 5 | import AdminIndex from './AdminIndex' 6 | function Main(){ 7 | return ( 8 | 9 |
10 | 11 | 12 |
13 | 14 | 15 |
16 | ) 17 | } 18 | export default Main 19 | 20 | 21 | -------------------------------------------------------------------------------- /blog/static/style/components/rightmi.css: -------------------------------------------------------------------------------- 1 | .rightmi-div{ 2 | margin-top: 8px !important; 3 | margin-bottom: 8px !important; 4 | } 5 | .miquan-img img{ 6 | width: 100%; 7 | border-radius: 3px; 8 | } 9 | .miquan-price{ 10 | text-align: center; 11 | margin: 5px; 12 | color: #1890ff; 13 | font-size: 1.0rem; 14 | } 15 | .miquan-text{ 16 | padding: 5px; 17 | line-height: 14px; 18 | color:#999; 19 | 20 | } 21 | .miquan-text span{ 22 | color:#999; 23 | } 24 | .quan-button{ 25 | text-align: center; 26 | margin-bottom: 10px; 27 | } -------------------------------------------------------------------------------- /service/test/app/controller/home.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { app, assert } = require('egg-mock/bootstrap'); 4 | 5 | describe('test/app/controller/home.test.js', () => { 6 | it('should assert', () => { 7 | const pkg = require('../../../package.json'); 8 | assert(app.config.keys.startsWith(pkg.name)); 9 | 10 | // const ctx = app.mockContext({}); 11 | // yield ctx.service.xx(); 12 | }); 13 | 14 | it('should GET /', () => { 15 | return app.httpRequest() 16 | .get('/') 17 | .expect('hi, egg') 18 | .expect(200); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /blog/config/apiUrl.js: -------------------------------------------------------------------------------- 1 | let ipUrl = 'http://127.0.0.1:7001/default/' 2 | //let ipUrl = 'http://192.168.0.105:7001/default/' 3 | 4 | let servicePath = { 5 | getArticleList:ipUrl + 'getArticleList' , // 首页文章列表接口 6 | getArticleById:ipUrl + 'getArticleById/', // 文章详细页内容接口 ,需要接收参数 7 | getTypeInfo:ipUrl + 'getTypeInfo', // 文章分类信息 8 | getListById:ipUrl + 'getListById/', // 根据类别ID获得文章列表 9 | getAllPartCount:ipUrl + 'getAllPartCount', // 获得所有集数和访问数 10 | getListBBD:ipUrl + 'getListBBD', // 大胖逼逼叨的列表 11 | 12 | } 13 | 14 | export default servicePath; -------------------------------------------------------------------------------- /blog/static/style/components/author.css: -------------------------------------------------------------------------------- 1 | .author-div{ 2 | text-align: center; 3 | padding: 1rem !important; 4 | 5 | } 6 | .author-div div{ 7 | margin-bottom: 1rem; 8 | 9 | } 10 | .author-introduction{ 11 | font-size:.8rem; 12 | color: #999; 13 | 14 | } 15 | .account{ 16 | background-color: #999; 17 | margin-left: .5rem !important; 18 | margin-right: .5rem !important; 19 | } 20 | .author-name{ 21 | font-size: 1rem; 22 | color: #1890ff; 23 | } 24 | .author-tag{ 25 | line-height: 27px; 26 | } 27 | 28 | .ant-avatar-image{ 29 | background: #ccc !important; 30 | } -------------------------------------------------------------------------------- /admin_app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "noEmit": true, 20 | "jsx": "react" 21 | }, 22 | "include": [ 23 | "src" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /admin_app/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /service/README.md: -------------------------------------------------------------------------------- 1 | # service 2 | 3 | 4 | 5 | ## QuickStart 6 | 7 | 8 | 9 | see [egg docs][egg] for more detail. 10 | 11 | ### Development 12 | 13 | ```bash 14 | $ npm i 15 | $ npm run dev 16 | $ open http://localhost:7001/ 17 | ``` 18 | 19 | ### Deploy 20 | 21 | ```bash 22 | $ npm start 23 | $ npm stop 24 | ``` 25 | 26 | ### npm scripts 27 | 28 | - Use `npm run lint` to check code style. 29 | - Use `npm test` to run unit test. 30 | - Use `npm run autod` to auto detect dependencies upgrade, see [autod](https://www.npmjs.com/package/autod) for more detail. 31 | 32 | 33 | [egg]: https://eggjs.org -------------------------------------------------------------------------------- /service/app/router/default.js: -------------------------------------------------------------------------------- 1 | module.exports = app =>{ 2 | const {router,controller} = app 3 | router.get('/default/index',controller.default.home.index) 4 | router.get('/default/getArticleList',controller.default.home.getArticleList) 5 | router.get('/default/getArticleById/:id',controller.default.home.getArticleById) 6 | router.get('/default/getTypeInfo',controller.default.home.getTypeInfo) 7 | router.get('/default/getListById/:id',controller.default.home.getListById) 8 | router.get('/default/getAllPartCount',controller.default.home.getAllPartCount) 9 | router.get('/default/getListBBD',controller.default.home.getListBBD) 10 | } -------------------------------------------------------------------------------- /blog/static/style/components/header.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | background-color: #fff; 3 | padding: .4rem; 4 | overflow: hidden; 5 | height: 3.2rem; 6 | border-bottom:1px solid #eee; 7 | 8 | } 9 | .header-center{ 10 | max-width: 1100px; 11 | margin: 0 auto; 12 | } 13 | .header-logo{ 14 | color:#1e90ff; 15 | font-size: 1.4rem; 16 | text-align: left; 17 | } 18 | .header-txt{ 19 | font-size: 0.6rem; 20 | color: #999; 21 | display: inline-block; 22 | padding-left: 0.3rem; 23 | } 24 | 25 | .memu-div{ 26 | padding-top: 10px; 27 | } 28 | .memu-div a{ 29 | color:#999 !important; 30 | font-size: .9rem; 31 | } 32 | -------------------------------------------------------------------------------- /blog/static/test.md: -------------------------------------------------------------------------------- 1 | ## API 2 | 3 | ### PreviewLayout 4 | 5 | | 参数 | 说明 | 类型 | 默认值 | 版本 | 6 | | :------- | :------------------------- | :--: | :----: | :---: | 7 | | children | 传递的组件,可以是任意组件 | jsx | null | 0.1.0 | 8 | 9 | ### MdPreviewer 10 | 11 | | 参数 | 说明 | 类型 | 默认值 | 版本 | 12 | | :--- | :------------ | :----: | :----: | :---: | 13 | | md | markdown 文档 | string | null | 0.1.0 | 14 | 15 | ### CodePreviewer 16 | 17 | | 参数 | 说明 | 类型 | 默认值 | 版本 | 18 | | :------- | :------------- | :----: | :----: | :---: | 19 | | code | 要显示的代码 | string | null | 0.0.1 | 20 | | showCode | 是否要展示代码 | bool | true | 0.1.0 | -------------------------------------------------------------------------------- /blog/static/style/pages/list.css: -------------------------------------------------------------------------------- 1 | .bread-div{ 2 | padding: .5rem; 3 | border-bottom:1px solid #eee; 4 | background-color: #e1f0ff; 5 | } 6 | 7 | pre{ 8 | display: block; 9 | background-color: #283646 !important; 10 | padding: .5rem !important; 11 | overflow-y: auto; 12 | font-weight: 300; 13 | font-family: Menlo, monospace; 14 | border-radius: .3rem; 15 | } 16 | 17 | pre >code{ 18 | border:0px !important; 19 | background-color: #283646 !important; 20 | color:#FFF; 21 | 22 | } 23 | code { 24 | display: inline-block ; 25 | background-color:#fff5f5; 26 | border-radius:3px; 27 | padding-left: 5px; 28 | padding-right: 5px; 29 | color:#ff502c; 30 | margin: 0px 3px; 31 | line-height: 1.1rem; 32 | font-size: .87rem; 33 | 34 | } -------------------------------------------------------------------------------- /admin_app/src/config/apiUrl.js: -------------------------------------------------------------------------------- 1 | let ipUrl = 'http://127.0.0.1:7001/admin/' 2 | 3 | let servicePath = { 4 | getTypeInfo:ipUrl + 'getTypeInfo' , // 获得文章类别信息 5 | addArticle:ipUrl + 'addArticle' , // 添加文章 6 | updateArticle:ipUrl + 'updateArticle' , // 添加文章 7 | getArticleList:ipUrl + 'getArticleList' , // 文章列表 8 | delArticle:ipUrl + 'delArticle/' , // 删除文章 9 | getArticleById:ipUrl + 'getArticleById/' , // 根据ID获得文章详情 10 | checkLogin:ipUrl + 'checkLogin' , // 检查用户名密码是否正确 11 | checkOpenId:ipUrl + 'checkOpenId' , // 检查OPendId是否和服务器一样 12 | outLogin:ipUrl + 'outLogin' , // 退出登录 13 | addBBD:ipUrl + 'addBBD' , // 增加大胖逼逼叨视频 14 | getListBBD:ipUrl + 'getListBBD' , // 大胖逼逼叨列表 15 | delBBDbyId:ipUrl + 'delBBDbyId/' , // 删除大胖逼逼叨单一项 16 | updateIsTop:ipUrl + 'updateIsTop' , // 修改文章是否置顶 17 | } 18 | 19 | export default servicePath; -------------------------------------------------------------------------------- /blog/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blog", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "set NODE_ENV=production next start -p 3000 ", 9 | "export": "npm run build && next export" 10 | }, 11 | "dependencies": { 12 | "@zeit/next-css": "^1.0.1", 13 | "antd": "^3.23.3", 14 | "axios": "^0.19.0", 15 | "babel-plugin-import": "^1.12.1", 16 | "highlight.js": "^9.15.10", 17 | "loadash": "^1.0.0", 18 | "markdown-navbar": "^1.0.7", 19 | "marked": "^0.7.0", 20 | "next": "9.0.6", 21 | "react": "16.9.0", 22 | "react-countup": "^4.2.2", 23 | "react-dom": "16.9.0", 24 | "react-highlight": "^0.12.0", 25 | "react-markdown": "^4.2.2", 26 | "react-syntax-highlighter": "^11.0.2" 27 | }, 28 | "devDependencies": { 29 | "raw-loader": "^3.1.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /blog/components/HeadingBlock.js: -------------------------------------------------------------------------------- 1 | import React, { PureComponent } from "react"; 2 | import PropTypes from "prop-types"; 3 | import Heading from "./Heading"; 4 | 5 | class HeadingBlock extends PureComponent { 6 | renderHtml = () => { 7 | const { level, children } = this.props; 8 | 9 | if (children && children.length > 0) { 10 | const nodeValue = children[0].props.value; 11 | return ( 12 | <> 13 | 14 | 15 | # 16 | 17 | {children} 18 | 19 | 20 | 21 | 22 | 23 | ); 24 | } else { 25 | return <>{children}; 26 | } 27 | }; 28 | 29 | 30 | 31 | render() { 32 | return (<> 33 | {this.renderHtml()} 34 | 35 | ); 36 | } 37 | } 38 | 39 | export default HeadingBlock; -------------------------------------------------------------------------------- /admin_app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "admin", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@types/lodash": "^4.14.149", 7 | "antd": "^3.25.0", 8 | "axios": "^0.19.0", 9 | "highlight.js": "^9.16.2", 10 | "loadash": "^1.0.0", 11 | "marked": "^0.7.0", 12 | "react": "^16.11.0", 13 | "react-dom": "^16.11.0", 14 | "react-router-dom": "^5.1.2", 15 | "react-scripts": "3.2.0", 16 | "typescript": "^3.7.3" 17 | }, 18 | "scripts": { 19 | "start": "react-scripts start", 20 | "build": "react-scripts build", 21 | "test": "react-scripts test", 22 | "eject": "react-scripts eject" 23 | }, 24 | "eslintConfig": { 25 | "extends": "react-app" 26 | }, 27 | "browserslist": { 28 | "production": [ 29 | ">0.2%", 30 | "not dead", 31 | "not op_mini all" 32 | ], 33 | "development": [ 34 | "last 1 chrome version", 35 | "last 1 firefox version", 36 | "last 1 safari version" 37 | ] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /blog/components/CodeBlock.js: -------------------------------------------------------------------------------- 1 | import React, { PureComponent } from "react"; 2 | import PropTypes from "prop-types"; 3 | import { PrismLight as SyntaxHighlighter } from "react-syntax-highlighter"; 4 | // 设置高亮样式 5 | import { coy } from "react-syntax-highlighter/dist/esm/styles/prism"; 6 | // 设置高亮的语言 7 | import { jsx, javascript, sass, scss ,css} from "react-syntax-highlighter/dist/esm/languages/prism"; 8 | 9 | class CodeBlock extends PureComponent { 10 | static propTypes = { 11 | value: PropTypes.string.isRequired, 12 | language: PropTypes.string 13 | }; 14 | 15 | static defaultProps = { 16 | language: null 17 | }; 18 | 19 | componentWillMount() { 20 | // 注册要高亮的语法, 21 | // 注意:如果不设置打包后供第三方使用是不起作用的 22 | SyntaxHighlighter.registerLanguage("jsx", jsx); 23 | SyntaxHighlighter.registerLanguage("javascript", javascript); 24 | SyntaxHighlighter.registerLanguage("css", css); 25 | } 26 | 27 | render() { 28 | // const { language, value } = this.props; 29 | return ( 30 | 31 | d 32 | {value} 33 | 34 | 35 | ); 36 | } 37 | } 38 | 39 | export default CodeBlock; -------------------------------------------------------------------------------- /blog/static/style/pages/index.css: -------------------------------------------------------------------------------- 1 | pre{ 2 | display: block; 3 | background-color:#f3f3f3; 4 | padding: .5rem !important; 5 | overflow-y: auto; 6 | font-weight: 300; 7 | font-family: Menlo, monospace; 8 | border-radius: .3rem; 9 | } 10 | pre{ 11 | background-color: #283646 !important; 12 | } 13 | pre >code{ 14 | border:0px !important; 15 | background-color: #283646 !important; 16 | color:#FFF; 17 | 18 | } 19 | code { 20 | display: inline-block ; 21 | background-color:#fff5f5; 22 | border-radius:3px; 23 | padding-left: 5px; 24 | padding-right: 5px; 25 | color:#ff502c; 26 | margin: 0px 3px; 27 | line-height: 1.1rem; 28 | font-size: .87rem; 29 | 30 | } 31 | .list-context{ 32 | font-size: 1.0rem; 33 | color: #999; 34 | line-height: 1.6rem; 35 | } 36 | 37 | .list-context img{ 38 | width:100% ; 39 | border-radius:5px; 40 | border:1px solid #ccc; 41 | max-width:1000px !important; 42 | display: block; 43 | margin:8px auto ; 44 | 45 | 46 | } 47 | .bibidao-title{ 48 | display: flex; 49 | flex-direction: row; 50 | } 51 | .bibidao-title > div{ 52 | width: 50%; 53 | } 54 | .right{ 55 | text-align: right; 56 | padding-right:10px ; 57 | font-size: 0.9rem; 58 | } -------------------------------------------------------------------------------- /service/app/router/admin.js: -------------------------------------------------------------------------------- 1 | module.exports = app =>{ 2 | const {router,controller} = app 3 | var adminauth = app.middleware.adminauth() 4 | router.get('/admin/index',controller.admin.main.index) 5 | router.get('/admin/getTypeInfo',adminauth ,controller.admin.main.getTypeInfo) 6 | router.post('/admin/addArticle',adminauth,controller.admin.main.addArticle) 7 | router.post('/admin/updateArticle',adminauth,controller.admin.main.updateArticle) 8 | router.get('/admin/getArticleList',adminauth,controller.admin.main.getArticleList) 9 | router.get('/admin/delArticle/:id',adminauth,controller.admin.main.delArticle) 10 | router.get('/admin/getArticleById/:id',adminauth,controller.admin.main.getArticleById) 11 | router.post('/admin/checkLogin',controller.admin.main.checkLogin) 12 | router.post('/admin/checkOpenId',controller.admin.main.checkOpenId) 13 | router.get('/admin/outLogin',adminauth,controller.admin.main.outLogin) 14 | router.post('/admin/addBBD',adminauth,controller.admin.main.addBBD) 15 | router.get('/admin/getListBBD',adminauth,controller.admin.main.getListBBD) 16 | router.get('/admin/delBBDbyId/:id',adminauth,controller.admin.main.delBBDbyId) 17 | router.post('/admin/updateIsTop',adminauth,controller.admin.main.updateIsTop) 18 | } -------------------------------------------------------------------------------- /service/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "service", 3 | "version": "1.0.0", 4 | "description": "", 5 | "private": true, 6 | "egg": { 7 | "declarations": true 8 | }, 9 | "dependencies": { 10 | "egg": "^2.15.1", 11 | "egg-cors": "^2.2.0", 12 | "egg-mysql": "^3.0.0", 13 | "egg-origin": "^1.0.3", 14 | "egg-scripts": "^2.11.0" 15 | }, 16 | "devDependencies": { 17 | "autod": "^3.0.1", 18 | "autod-egg": "^1.1.0", 19 | "egg-bin": "^4.11.0", 20 | "egg-ci": "^1.11.0", 21 | "egg-mock": "^3.21.0", 22 | "eslint": "^5.13.0", 23 | "eslint-config-egg": "^7.1.0" 24 | }, 25 | "engines": { 26 | "node": ">=10.0.0" 27 | }, 28 | "scripts": { 29 | "start": "egg-scripts start --daemon --title=egg-server-service", 30 | "stop": "egg-scripts stop --title=egg-server-service", 31 | "dev": "egg-bin dev", 32 | "debug": "egg-bin debug", 33 | "test": "npm run lint -- --fix && npm run test-local", 34 | "test-local": "egg-bin test", 35 | "cov": "egg-bin cov", 36 | "lint": "eslint .", 37 | "ci": "npm run lint && npm run cov", 38 | "autod": "autod" 39 | }, 40 | "ci": { 41 | "version": "10" 42 | }, 43 | "repository": { 44 | "type": "git", 45 | "url": "" 46 | }, 47 | "author": "", 48 | "license": "MIT" 49 | } 50 | -------------------------------------------------------------------------------- /blog/static/style/pages/comm.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-color: #f4f5f5; 3 | font-family: -apple-system,system-ui,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif; 4 | 5 | height: auto; 6 | } 7 | 8 | .comm-left{ 9 | background-color: #FFF; 10 | padding:.3rem; 11 | border-radius: .3rem; 12 | border:1px solid #eee; 13 | margin-bottom: 16px; 14 | } 15 | .comm-box{ 16 | background-color: #FFF; 17 | margin-left: .5rem; 18 | padding:.3rem; 19 | border-radius: .3rem; 20 | border:1px solid #eee; 21 | 22 | 23 | } 24 | .comm-main{ 25 | margin-top: .5rem !important; 26 | max-width: 1100px; 27 | margin:0 auto; 28 | 29 | } 30 | 31 | .list-title{ 32 | font-size:1.4rem; 33 | color: #1e90ff; 34 | padding: 0 0.5rem; 35 | margin-top: 1.3rem; 36 | } 37 | .list-context{ 38 | color:#777; 39 | padding:.5rem; 40 | } 41 | .list-icon{ 42 | padding:.5rem 0; 43 | color:#ccc; 44 | } 45 | .list-icon span{ 46 | display: inline-block; 47 | padding: 0 10px; 48 | } 49 | .list-header{ 50 | font-size: 1.1rem; 51 | padding-left:1rem; 52 | } 53 | .list-go{ 54 | text-align: right; 55 | margin-right: 20px; 56 | color:#bbb; 57 | } 58 | .bbd-img{ 59 | border-radius: 4px; 60 | width: 100%; 61 | } 62 | .bbd-title{ 63 | margin-top:10px; 64 | overflow: hidden; 65 | text-overflow:ellipsis; 66 | white-space: nowrap; 67 | } 68 | .bbd-zi{ 69 | color: #888; 70 | } 71 | .ant-card-body{ 72 | padding:10px; 73 | } 74 | -------------------------------------------------------------------------------- /blog/components/StudyLine.js: -------------------------------------------------------------------------------- 1 | import '../static/style/components/studyLine.css' 2 | import {Row,Col,Icon} from 'antd' 3 | 4 | const StudyLine = ()=>{ 5 | return ( 6 |
7 |
学习路线
8 | 9 | 10 | React学习路线 11 | 基础到实战 12 | 13 | 14 | 15 | 16 | 17 | 18 | Vue2.x学习路线 19 | 基础到实战 20 | 21 | 22 | 23 | 24 | 25 | 26 | Flutter学习路线 27 | 基础到实战 28 | 29 | 30 | 31 | 32 |
33 | ) 34 | } 35 | 36 | export default StudyLine -------------------------------------------------------------------------------- /admin_app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /service/config/config.default.js: -------------------------------------------------------------------------------- 1 | /* eslint valid-jsdoc: "off" */ 2 | 3 | 'use strict'; 4 | 5 | /** 6 | * @param {Egg.EggAppInfo} appInfo app info 7 | */ 8 | module.exports = appInfo => { 9 | /** 10 | * built-in config 11 | * @type {Egg.EggAppConfig} 12 | **/ 13 | const config = exports = {}; 14 | 15 | // use for cookie sign key, should change to your own and keep security 16 | config.keys = appInfo.name + '_1570612395695_7299'; 17 | 18 | // add your middleware config here 19 | config.middleware = []; 20 | 21 | // add your user config here 22 | const userConfig = { 23 | // myAppName: 'egg', 24 | }; 25 | config.mysql = { 26 | // database configuration 27 | client: { 28 | // host 29 | host: 'localhost', 30 | // port 31 | port: '3306', 32 | // username 33 | user: 'root', 34 | // password 35 | password: '12345678', 36 | // database 37 | database: 'react_blog', 38 | }, 39 | // load into app, default is open 40 | app: true, 41 | // load into agent, default is close 42 | agent: false, 43 | }; 44 | 45 | config.security = { 46 |     csrf: {enable: false}, 47 |     domainWhiteList: [ '*' ] 48 |   }; 49 | 50 | config.cors = { 51 | origin: 'http://127.0.0.1:3000', 52 | credentials: true, //允许Cook可以跨域 53 | allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS' 54 | }; 55 | 56 | //长文本设置 57 | config.bodyParser = { 58 | enable: true, 59 | encoding: 'utf8', 60 | formLimit: '5024kb', 61 | jsonLimit: '5024kb', 62 | strict: true, 63 | // @see https://github.com/hapijs/qs/blob/master/lib/parse.js#L8 for more options 64 | queryString: { 65 | arrayLimit: 100, 66 | depth: 5, 67 | parameterLimit: 1000, 68 | }, 69 | 70 | } 71 | 72 | return { 73 | ...config, 74 | ...userConfig, 75 | }; 76 | }; 77 | 78 | 79 | -------------------------------------------------------------------------------- /blog/components/tocify.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Anchor } from 'antd'; 3 | import { last } from 'lodash'; 4 | 5 | const { Link } = Anchor; 6 | 7 | export interface TocItem { 8 | anchor: string; 9 | level: number; 10 | text: string; 11 | children?: TocItem[]; 12 | } 13 | 14 | export type TocItems = TocItem[]; // TOC目录树结构 15 | 16 | export default class Tocify { 17 | tocItems: TocItems = []; 18 | 19 | index: number = 0; 20 | 21 | constructor() { 22 | this.tocItems = []; 23 | this.index = 0; 24 | } 25 | 26 | add(text: string, level: number) { 27 | const anchor = `toc${level}${++this.index}`; 28 | const item = { anchor, level, text }; 29 | const items = this.tocItems; 30 | 31 | if (items.length === 0) { // 第一个 item 直接 push 32 | items.push(item); 33 | } else { 34 | let lastItem = last(items) as TocItem; // 最后一个 item 35 | 36 | if (item.level > lastItem.level) { // item 是 lastItem 的 children 37 | for (let i = lastItem.level + 1; i <= 2; i++) { 38 | const { children } = lastItem; 39 | if (!children) { // 如果 children 不存在 40 | lastItem.children = [item]; 41 | break; 42 | } 43 | 44 | lastItem = last(children) as TocItem; // 重置 lastItem 为 children 的最后一个 item 45 | 46 | if (item.level <= lastItem.level) { // item level 小于或等于 lastItem level 都视为与 children 同级 47 | children.push(item); 48 | break; 49 | } 50 | } 51 | } else { // 置于最顶级 52 | items.push(item); 53 | } 54 | } 55 | 56 | return anchor; 57 | } 58 | 59 | reset = () => { 60 | this.tocItems = []; 61 | this.index = 0; 62 | }; 63 | 64 | renderToc(items: TocItem[]) { // 递归 render 65 | return items.map(item => ( 66 | 67 | {item.children && this.renderToc(item.children)} 68 | 69 | )); 70 | } 71 | 72 | render() { 73 | return ( 74 | 75 | {this.renderToc(this.tocItems)} 76 | 77 | ); 78 | } 79 | } -------------------------------------------------------------------------------- /admin_app/src/components/tocify.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Anchor } from 'antd'; 3 | import { last } from 'lodash'; 4 | 5 | const { Link } = Anchor; 6 | 7 | export interface TocItem { 8 | anchor: string; 9 | level: number; 10 | text: string; 11 | children?: TocItem[]; 12 | } 13 | 14 | export type TocItems = TocItem[]; // TOC目录树结构 15 | 16 | export default class Tocify { 17 | tocItems: TocItems = []; 18 | 19 | index: number = 0; 20 | 21 | constructor() { 22 | this.tocItems = []; 23 | this.index = 0; 24 | } 25 | 26 | add(text: string, level: number) { 27 | const anchor = `toc${level}${++this.index}`; 28 | const item = { anchor, level, text }; 29 | const items = this.tocItems; 30 | 31 | if (items.length === 0) { // 第一个 item 直接 push 32 | items.push(item); 33 | } else { 34 | let lastItem = last(items) as TocItem; // 最后一个 item 35 | 36 | if (item.level > lastItem.level) { // item 是 lastItem 的 children 37 | for (let i = lastItem.level + 1; i <= 2; i++) { 38 | const { children } = lastItem; 39 | if (!children) { // 如果 children 不存在 40 | lastItem.children = [item]; 41 | break; 42 | } 43 | 44 | lastItem = last(children) as TocItem; // 重置 lastItem 为 children 的最后一个 item 45 | 46 | if (item.level <= lastItem.level) { // item level 小于或等于 lastItem level 都视为与 children 同级 47 | children.push(item); 48 | break; 49 | } 50 | } 51 | } else { // 置于最顶级 52 | items.push(item); 53 | } 54 | } 55 | 56 | return anchor; 57 | } 58 | 59 | reset = () => { 60 | this.tocItems = []; 61 | this.index = 0; 62 | }; 63 | 64 | renderToc(items: TocItem[]) { // 递归 render 65 | return items.map(item => ( 66 | 67 | {item.children && this.renderToc(item.children)} 68 | 69 | )); 70 | } 71 | 72 | render() { 73 | return ( 74 | 75 | {this.renderToc(this.tocItems)} 76 | 77 | ); 78 | } 79 | } -------------------------------------------------------------------------------- /blog/components/LearningRoute.js: -------------------------------------------------------------------------------- 1 | import React,{useState ,useEffect} from 'react' 2 | import {Avatar,Divider,Tooltip ,Tag} from 'antd' 3 | import '../static/style/components/author.css' 4 | import servicePath from '../config/apiUrl' 5 | import axios from 'axios' 6 | import CountUp from 'react-countup' 7 | 8 | const Author =()=>{ 9 | 10 | 11 | 12 | const [ all_part_count , setAll_part_count ] = useState(0); 13 | const [ all_view_count , setAll_view_count ] = useState( 0); 14 | 15 | useEffect(()=>{ 16 | 17 | fetchData() 18 | 19 | },[]) 20 | 21 | 22 | const fetchData = async ()=>{ 23 | const result = await axios(servicePath.getAllPartCount).then( 24 | (res)=>{ return res.data.data } 25 | ) 26 | setAll_part_count(result[0].all_part_count) 27 | setAll_view_count(result[0].all_view_count) 28 | } 29 | 30 | return ( 31 |
32 |
33 |
34 |
技术胖
35 |
专注于WEB和移动前端开发
36 |
37 | 光头Coder 38 | 12年经验 39 | 业余讲师 40 | 免费视频 41 | 被访问 42 |
43 | 44 | 社交账号 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
56 |
57 | ) 58 | 59 | } 60 | 61 | 62 | 63 | export default Author -------------------------------------------------------------------------------- /admin_app/src/static/css/AddArticle.css: -------------------------------------------------------------------------------- 1 | .markdown-content{ 2 | font-size:16px !important; 3 | max-height: 745px; 4 | } 5 | .show-html{ 6 | padding:10px; 7 | border:1px solid #ddd; 8 | border-radius: 5px; 9 | font-size:16px; 10 | height: 745px; 11 | background-color: #f0f0f0; 12 | overflow: auto; 13 | } 14 | .show-html img{ 15 | width: 100%; 16 | } 17 | 18 | .show-html h1{ 19 | font-size:30px; 20 | } 21 | 22 | .show-html h2{ 23 | font-size:28px; 24 | border-bottom: 1px solid #cbcbcb; 25 | } 26 | .show-html h3{ 27 | font-size:24px; 28 | } 29 | 30 | .show-html pre{ 31 | display: block; 32 | background-color: #ccc; 33 | padding: 5px; 34 | border-radius: 5px; 35 | } 36 | .show-html pre>code{ 37 | color: #000; 38 | background-color: #ccc; 39 | } 40 | .show-html code { 41 | background-color: #fff5f5; 42 | padding: 5px 10px; 43 | border-radius: 5px; 44 | margin: 0px 3px; 45 | color: #ff502c; 46 | } 47 | .show-html blockquote{ 48 | border-left:4px solid #cbcbcb ; 49 | padding: 10px 10px 10px 30px; 50 | background-color: #f8f8f8; 51 | } 52 | .introduce-html{ 53 | padding:10px; 54 | border:1px solid #ddd; 55 | border-radius: 5px; 56 | font-size:16px; 57 | 58 | background-color: #f0f0f0; 59 | } 60 | 61 | 62 | .introduce-html h1{ 63 | font-size:30px; 64 | } 65 | 66 | .introduce-html h2{ 67 | font-size:28px; 68 | border-bottom: 1px solid #cbcbcb; 69 | } 70 | .introduce-html h3{ 71 | font-size:24px; 72 | } 73 | 74 | .introduce-html pre{ 75 | display: block; 76 | background-color: #f0f0f0; 77 | padding: 5px; 78 | border-radius: 5px; 79 | } 80 | .introduce-html pre>code{ 81 | color: #000; 82 | background-color: #ccc; 83 | } 84 | .introduce-html code { 85 | background-color: #fff5f5; 86 | padding: 5px 10px; 87 | border-radius: 5px; 88 | margin: 0px 3px; 89 | color: #ff502c; 90 | } 91 | .introduce-html img{ 92 | width: 100%; 93 | } 94 | .introduce-html blockquote{ 95 | border-left:4px solid #cbcbcb ; 96 | padding: 10px 10px 10px 30px; 97 | background-color: #f8f8f8; 98 | } 99 | .date-select{ 100 | margin-top:10px; 101 | } -------------------------------------------------------------------------------- /blog/components/Header.js: -------------------------------------------------------------------------------- 1 | import React ,{useState,useEffect} from 'react' 2 | import Router from 'next/router' 3 | import Link from 'next/link' 4 | import '../static/style/components/header.css' 5 | import {Row,Col, Menu, Icon} from 'antd' 6 | import axios from 'axios' 7 | import servicePath from '../config/apiUrl' 8 | 9 | const Header = () => { 10 | 11 | return ( 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 | 技术胖 20 | 21 | 22 | 23 | 专注前端开发,每年100集免费视频。 24 | 25 | 26 | 27 | 28 | 29 | 30 | 博客首页 31 | 32 | 33 | 34 | 35 | 视频教程 36 | 37 | 38 | 39 | 40 | 逼逼叨 41 | 42 | 43 | 44 | 45 | 46 |
47 |
48 | 49 | ) 50 | } 51 | 52 | export default Header 53 | -------------------------------------------------------------------------------- /blog/components/Author.js: -------------------------------------------------------------------------------- 1 | import React,{useState ,useEffect} from 'react' 2 | import {Avatar,Divider,Tooltip ,Tag} from 'antd' 3 | import '../static/style/components/author.css' 4 | import servicePath from '../config/apiUrl' 5 | import axios from 'axios' 6 | import CountUp from 'react-countup' 7 | 8 | const Author =()=>{ 9 | 10 | 11 | 12 | const [ all_part_count , setAll_part_count ] = useState(0); 13 | const [ all_view_count , setAll_view_count ] = useState( 0); 14 | 15 | useEffect(()=>{ 16 | 17 | fetchData() 18 | 19 | },[]) 20 | 21 | 22 | const fetchData = async ()=>{ 23 | const result = await axios(servicePath.getAllPartCount).then( 24 | (res)=>{ return res.data.data } 25 | ) 26 | setAll_part_count(result[0].all_part_count) 27 | setAll_view_count(result[0].all_view_count) 28 | } 29 | 30 | return ( 31 |
32 |
33 |
34 |
技术胖
35 |
专注于WEB和移动前端开发
36 |
37 | 光头Coder 38 | 12年经验 39 | 业余讲师 40 | 免费视频 41 | 被访问 42 |
43 | 44 | 社交账号 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
63 |
64 | ) 65 | 66 | } 67 | 68 | 69 | 70 | export default Author -------------------------------------------------------------------------------- /blog/static/style/pages/detailed.css: -------------------------------------------------------------------------------- 1 | .bread-div{ 2 | padding: .6rem; 3 | border-bottom:1px solid #DDD; 4 | background-color: #FFF; 5 | 6 | } 7 | .detailed-title{ 8 | font-size: 1.6rem; 9 | text-align: center; 10 | padding: 1rem; 11 | } 12 | .center{ 13 | text-align: center; 14 | } 15 | .detailed-content{ 16 | padding: 1.3rem; 17 | font-size: 1.05rem; 18 | color: #777; 19 | line-height: 1.9rem; 20 | } 21 | .detailed-content h2{ 22 | border-bottom: 1px solid #d9dada; 23 | padding-bottom: 1rem; 24 | margin-bottom: 2rem; 25 | margin-top: 2rem; 26 | -webkit-margin-bottom-collapse: 2rem; 27 | color: #333 ; 28 | font-size: 1.3rem; 29 | font-weight: bold; 30 | } 31 | .detailed-content h3{ 32 | border-left: 4px solid rgb(156, 203, 250); 33 | padding-left:1rem ; 34 | margin-bottom: 1rem; 35 | margin-top: 1rem; 36 | -webkit-margin-bottom-collapse: 2rem; 37 | color: #666 ; 38 | font-size: 1.3rem; 39 | font-weight: bold; 40 | 41 | } 42 | .detailed-content img{ 43 | border-radius: 5px; 44 | border:1px solid #f0f0f0; 45 | } 46 | pre{ 47 | display: block; 48 | background-color: #283646 !important; 49 | padding: .5rem !important; 50 | overflow-y: auto; 51 | font-weight: 300; 52 | font-family: Menlo, monospace; 53 | border-radius: .3rem; 54 | } 55 | 56 | pre > code{ 57 | border:0px !important; 58 | background-color: #283646 !important; 59 | color:#ccc !important; 60 | font-size: .87rem; 61 | 62 | } 63 | code { 64 | display: inline-block ; 65 | background-color:#fff5f5; 66 | border-radius:3px; 67 | padding-left: 5px; 68 | padding-right: 5px; 69 | color:#ff502c; 70 | margin: 0px 3px; 71 | line-height: 1.1rem; 72 | font-size: .87rem; 73 | 74 | } 75 | 76 | .title-anchor{ 77 | color:#888 !important; 78 | padding:4px !important; 79 | margin: 0rem !important; 80 | height: auto !important; 81 | line-height: 1.2rem !important; 82 | font-size: .7rem !important; 83 | border-bottom: 1px dashed #eee; 84 | overflow: hidden; 85 | text-overflow:ellipsis; 86 | white-space: nowrap; 87 | } 88 | .active{ 89 | color:rgb(30, 144, 255) !important; 90 | } 91 | .nav-title{ 92 | text-align: center; 93 | color: #888; 94 | border-bottom: 1px solid rgb(30, 144, 255); 95 | font-size: 1rem; 96 | 97 | } 98 | .article-menu{ 99 | font-size:12px; 100 | } 101 | iframe{ 102 | height: 34rem; 103 | border:1px solid #ccc; 104 | border-radius: 8px; 105 | } 106 | @media screen and (min-width: 320px)and (max-width: 750px){ 107 | iframe{ 108 | height: 12rem; 109 | } 110 | } 111 | 112 | .detailed-content img{ 113 | width: 100%; 114 | border:1px solid #f3f3f3; 115 | } 116 | .title-level3{ 117 | display: none !important; 118 | } 119 | .ant-anchor-link-title{ 120 | font-size: 12px !important; 121 | } 122 | .ant-anchor-wrapper{ 123 | padding: 5px !important; 124 | } 125 | 126 | -------------------------------------------------------------------------------- /admin_app/README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run:1ddss 6 | 7 | ### `yarn start` 8 | 9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console.d 14 | 15 | ### `yarn test` 16 | 17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `yarn build` 21 | 22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `yarn eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `yarn build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /blog/pages/bibidao.js: -------------------------------------------------------------------------------- 1 | import React,{useState,useEffect} from 'react' 2 | import Head from 'next/head' 3 | import {Row, Col , List , Card,Breadcrumb } from 'antd' 4 | import Header from '../components/Header' 5 | import Author from '../components/Author' 6 | import Advert from '../components/Advert' 7 | import Footer from '../components/Footer' 8 | import '../static/style/pages/bibidao.css' 9 | 10 | import axios from 'axios' 11 | import servicePath from '../config/apiUrl' 12 | 13 | 14 | const Bibidao = (data) =>{ 15 | 16 | const [mylist, setList ] = useState(data.list) 17 | 18 | 19 | useEffect(()=>{ 20 | 21 | }) 22 | 23 | return ( 24 | <> 25 | 26 | 大胖逼逼叨 27 | 28 | 29 |
30 | 31 | 32 |
33 |
34 | 35 | 首页 36 | 大胖逼逼叨 37 | 38 |
39 |
40 | 41 | ( 52 | 53 | 57 |
58 | 59 | example 60 | 61 |
62 | 67 | 68 | 69 |
70 |
71 | )} 72 | /> 73 | 74 |
75 | 76 | 77 |
78 | 79 | 80 | 81 | 82 | 83 | 84 |
85 |