├── demo.js ├── webpack ├── webpack.config.test.js ├── webpack.config.production.js ├── webpack.config.development.js └── webpack.config.base.js ├── sass ├── booklist.scss ├── app.scss ├── all.scss ├── fonts │ └── bootstrap │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 ├── bootstrap │ ├── bootstrap │ │ ├── mixins │ │ │ ├── _center-block.scss │ │ │ ├── _opacity.scss │ │ │ ├── _size.scss │ │ │ ├── _text-overflow.scss │ │ │ ├── _tab-focus.scss │ │ │ ├── _labels.scss │ │ │ ├── _resize.scss │ │ │ ├── _progress-bar.scss │ │ │ ├── _text-emphasis.scss │ │ │ ├── _reset-filter.scss │ │ │ ├── _nav-divider.scss │ │ │ ├── _background-variant.scss │ │ │ ├── _alerts.scss │ │ │ ├── _nav-vertical-align.scss │ │ │ ├── _reset-text.scss │ │ │ ├── _border-radius.scss │ │ │ ├── _pagination.scss │ │ │ ├── _responsive-visibility.scss │ │ │ ├── _panels.scss │ │ │ ├── _hide-text.scss │ │ │ ├── _clearfix.scss │ │ │ ├── _list-group.scss │ │ │ ├── _table-row.scss │ │ │ ├── _image.scss │ │ │ ├── _buttons.scss │ │ │ ├── _grid-framework.scss │ │ │ ├── _forms.scss │ │ │ ├── _grid.scss │ │ │ └── _gradients.scss │ │ ├── _wells.scss │ │ ├── _responsive-embed.scss │ │ ├── _breadcrumbs.scss │ │ ├── _close.scss │ │ ├── _component-animations.scss │ │ ├── _utilities.scss │ │ ├── _thumbnails.scss │ │ ├── _pager.scss │ │ ├── _mixins.scss │ │ ├── _media.scss │ │ ├── _jumbotron.scss │ │ ├── _labels.scss │ │ ├── _badges.scss │ │ ├── _code.scss │ │ ├── _grid.scss │ │ ├── _alerts.scss │ │ ├── _progress-bars.scss │ │ ├── _pagination.scss │ │ ├── _print.scss │ │ ├── _tooltip.scss │ │ ├── _list-group.scss │ │ ├── _scaffolding.scss │ │ ├── _popovers.scss │ │ └── _modals.scss │ ├── _bootstrap-sprockets.scss │ ├── _bootstrap-compass.scss │ ├── _bootstrap-mincer.scss │ └── _bootstrap.scss └── footer.scss ├── .gitignore ├── src ├── common │ ├── components │ │ ├── ui │ │ │ ├── tabs │ │ │ │ ├── helpers │ │ │ │ │ ├── styles.js │ │ │ │ │ ├── uuid.js │ │ │ │ │ └── childrenPropType.js │ │ │ │ ├── index.js │ │ │ │ └── components │ │ │ │ │ ├── TabPanel.js │ │ │ │ │ ├── TabList.js │ │ │ │ │ └── Tab.js │ │ │ ├── topicDetail │ │ │ │ ├── widgets │ │ │ │ │ ├── Avator.js │ │ │ │ │ ├── Answers.js │ │ │ │ │ ├── Button.js │ │ │ │ │ ├── Operation.js │ │ │ │ │ └── Vote.js │ │ │ │ ├── Tag.js │ │ │ │ ├── TagList.js │ │ │ │ ├── Question.js │ │ │ │ ├── Answers.js │ │ │ │ └── TopHeader.js │ │ │ ├── sidebar │ │ │ │ ├── HotTopic.js │ │ │ │ └── Sidebar.js │ │ │ └── common │ │ │ │ ├── FromNow.js │ │ │ │ ├── Button.js │ │ │ │ └── Loading.js │ │ ├── topic │ │ │ ├── NoTopic.js │ │ │ ├── CategoryItem.js │ │ │ ├── CategoryBar.js │ │ │ ├── Topics.js │ │ │ └── Topic.js │ │ ├── layout │ │ │ ├── Sidebar.js │ │ │ ├── MasterLayout.js │ │ │ ├── ExitHeader.js │ │ │ ├── Header.js │ │ │ └── Footer.js │ │ ├── appui │ │ │ └── ErrMsg.js │ │ ├── 404.js │ │ ├── booklist │ │ │ ├── BookList.js │ │ │ └── BookItem.js │ │ ├── Home.js │ │ └── Topic.js │ ├── reducers │ │ ├── version.js │ │ ├── layout.js │ │ ├── index.js │ │ ├── book.js │ │ ├── publish.js │ │ ├── login.js │ │ ├── topicDetail.js │ │ ├── user.js │ │ ├── reddit.js │ │ └── topic.js │ ├── constants │ │ └── topic.js │ ├── api │ │ ├── fetchComponentDataBeforeRender.js │ │ ├── immutifyState.js │ │ ├── promiseMiddleware.js │ │ └── makeRouteHooksSafe.js │ ├── tools │ │ └── DevTools.js │ ├── actions │ │ ├── book.js │ │ ├── layout.js │ │ ├── publish.js │ │ ├── login.js │ │ ├── user.js │ │ ├── topicDetail.js │ │ └── topic.js │ ├── containers │ │ ├── LoginPage.js │ │ ├── PublishPage.js │ │ ├── BookPage.js │ │ ├── TopicDetailPage.js │ │ ├── TopicPage.js │ │ └── App.js │ ├── routes.js │ └── store │ │ └── configureStore.js ├── server │ ├── constants │ │ ├── tag.js │ │ ├── comment.js │ │ └── index.js │ ├── config │ │ ├── credentials.js │ │ ├── email │ │ │ └── messagetpl.js │ │ ├── database.js │ │ ├── webpack.js │ │ ├── config.js │ │ └── express.js │ ├── index.js │ ├── controllers │ │ ├── logout.js │ │ ├── index.js │ │ ├── tag.js │ │ ├── login.js │ │ ├── user.js │ │ ├── ask.js │ │ ├── register.js │ │ └── topics.js │ ├── server.js │ ├── middlewares │ │ ├── loginAuth.js │ │ └── renderPage-middleware.js │ ├── lib │ │ ├── utils.js │ │ └── emailHelper.js │ └── models │ │ ├── User.js │ │ ├── Tag.js │ │ ├── TopicTagRelation.js │ │ └── Answers.js └── client │ └── index.js ├── .bowerrc ├── public ├── img │ ├── 404.jpg │ ├── 404.png │ ├── PDF.png │ ├── bd24.png │ ├── btn24.png │ ├── search.png │ ├── user-64.png │ ├── carousel.png │ ├── footer-bg.png │ ├── log-logo.png │ ├── vote-bg@2x.png │ ├── flash-bg-02.jpg │ ├── logo.c1968f51.png │ └── logo-w.svg └── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 ├── .babelrc ├── README.md ├── bower.json ├── .editorconfig ├── webpack.config.js ├── LICENSE └── package.json /demo.js: -------------------------------------------------------------------------------- 1 | console.log("xxx"); 2 | -------------------------------------------------------------------------------- /webpack/webpack.config.test.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sass/booklist.scss: -------------------------------------------------------------------------------- 1 | /** BookList scss */ 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | public/components 3 | .sass-cache -------------------------------------------------------------------------------- /sass/app.scss: -------------------------------------------------------------------------------- 1 | .navbar { 2 | margin-bottom: 0; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /src/common/components/ui/tabs/helpers/styles.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 3 | }; 4 | -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "public/scripts", 3 | "json": "bower.json" 4 | } 5 | -------------------------------------------------------------------------------- /sass/all.scss: -------------------------------------------------------------------------------- 1 | @import "bootstrap/_bootstrap"; 2 | @import 'app.scss'; 3 | @import 'footer.scss'; 4 | -------------------------------------------------------------------------------- /public/img/404.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/404.jpg -------------------------------------------------------------------------------- /public/img/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/404.png -------------------------------------------------------------------------------- /public/img/PDF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/PDF.png -------------------------------------------------------------------------------- /public/img/bd24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/bd24.png -------------------------------------------------------------------------------- /public/img/btn24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/btn24.png -------------------------------------------------------------------------------- /public/img/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/search.png -------------------------------------------------------------------------------- /public/img/user-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/user-64.png -------------------------------------------------------------------------------- /public/img/carousel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/carousel.png -------------------------------------------------------------------------------- /public/img/footer-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/footer-bg.png -------------------------------------------------------------------------------- /public/img/log-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/log-logo.png -------------------------------------------------------------------------------- /public/img/vote-bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/vote-bg@2x.png -------------------------------------------------------------------------------- /src/common/reducers/version.js: -------------------------------------------------------------------------------- 1 | export default function version(state = 0, action) { 2 | return state; 3 | } 4 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | stage:0, 3 | "optional": ["es7.decorators", "es7.classProperties", "es7.objectRestSpread"] 4 | } 5 | -------------------------------------------------------------------------------- /public/img/flash-bg-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/flash-bg-02.jpg -------------------------------------------------------------------------------- /public/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/img/logo.c1968f51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/img/logo.c1968f51.png -------------------------------------------------------------------------------- /src/server/constants/tag.js: -------------------------------------------------------------------------------- 1 | export const TAG = { 2 | STATUS:{ 3 | DELETE:0, 4 | ENABLE:1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # web-bookstore 2 | React+Redux+Expressjs+MongoDB+Bootstrap 同构应用 3 | #启动 4 | ```npm install``` 5 | ```npm run dev``` 6 | -------------------------------------------------------------------------------- /src/server/constants/comment.js: -------------------------------------------------------------------------------- 1 | export const COMMENT = { 2 | STATUS:{ 3 | DELETE:0, 4 | ENABLE:1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/public/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /sass/fonts/bootstrap/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/sass/fonts/bootstrap/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /sass/fonts/bootstrap/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/sass/fonts/bootstrap/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /sass/fonts/bootstrap/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/sass/fonts/bootstrap/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /sass/fonts/bootstrap/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BSFullStack/isomorphic-redux-app/HEAD/sass/fonts/bootstrap/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/common/components/ui/tabs/helpers/uuid.js: -------------------------------------------------------------------------------- 1 | // Get a universally unique identifier 2 | let count = 0; 3 | module.exports = function uuid() { 4 | return count++; 5 | }; 6 | -------------------------------------------------------------------------------- /src/common/constants/topic.js: -------------------------------------------------------------------------------- 1 | //topic的状态 2 | export const TOPIC = { 3 | STATUS:{ 4 | "0":"no-answer", 5 | "1":"answered", 6 | "2":"solved" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_center-block.scss: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | @mixin center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /src/server/config/credentials.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 保存账号信息 3 | */ 4 | export default { 5 | gmail:{ 6 | user:"18301590621@163.com", 7 | password:"nktzsnqpnvurdtsl" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/server/constants/index.js: -------------------------------------------------------------------------------- 1 | export const USER = { 2 | ROLE:{ 3 | ADMIN:2, 4 | NORMAL:1 5 | }, 6 | STATUS:{ 7 | LOCK:0, 8 | ACTIVE:1 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_opacity.scss: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | @mixin opacity($opacity) { 4 | opacity: $opacity; 5 | // IE8 filter 6 | $opacity-ie: ($opacity * 100); 7 | filter: alpha(opacity=$opacity-ie); 8 | } 9 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webcy", 3 | "version": "0.0.1", 4 | "ignore": [ 5 | "**/.*", 6 | "node_modules", 7 | "components" 8 | ], 9 | "dependencies": { 10 | "simditor":"" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_size.scss: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | @mixin size($width, $height) { 4 | width: $width; 5 | height: $height; 6 | } 7 | 8 | @mixin square($size) { 9 | @include size($size, $size); 10 | } 11 | -------------------------------------------------------------------------------- /src/server/index.js: -------------------------------------------------------------------------------- 1 | require('babel/register') 2 | var config = require('./config/config'); 3 | var server = require('./server')(config); 4 | server.listen(config.port, function () { 5 | console.log('服务器启动成功!端口号: ' + config.port); 6 | }); 7 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_text-overflow.scss: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | @mixin text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /sass/bootstrap/_bootstrap-sprockets.scss: -------------------------------------------------------------------------------- 1 | @function twbs-font-path($path) { 2 | @return font-path($path); 3 | } 4 | 5 | @function twbs-image-path($path) { 6 | @return image-path($path); 7 | } 8 | 9 | $bootstrap-sass-asset-helper: true; 10 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_tab-focus.scss: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | @mixin tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /src/common/components/ui/tabs/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Tabs: require('./components/Tabs'), 3 | TabList: require('./components/TabList'), 4 | Tab: require('./components/Tab'), 5 | TabPanel: require('./components/TabPanel') 6 | }; 7 | -------------------------------------------------------------------------------- /sass/bootstrap/_bootstrap-compass.scss: -------------------------------------------------------------------------------- 1 | @function twbs-font-path($path) { 2 | @return font-url($path, true); 3 | } 4 | 5 | @function twbs-image-path($path) { 6 | @return image-url($path, true); 7 | } 8 | 9 | $bootstrap-sass-asset-helper: true; 10 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_labels.scss: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | @mixin label-variant($color) { 4 | background-color: $color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken($color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_resize.scss: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | @mixin resizable($direction) { 4 | resize: $direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_progress-bar.scss: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | @mixin progress-bar-variant($color) { 4 | background-color: $color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | @include gradient-striped; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/server/config/email/messagetpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 通知类邮件模板 3 | */ 4 | export function sendMessage(metaData){ 5 | const { title ,link } = metaData; 6 | return ` 7 |
直达号:${link}
9 | 10 | `; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_text-emphasis.scss: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | // [converter] $parent hack 4 | @mixin text-emphasis-variant($parent, $color) { 5 | #{$parent} { 6 | color: $color; 7 | } 8 | a#{$parent}:hover, 9 | a#{$parent}:focus { 10 | color: darken($color, 10%); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_reset-filter.scss: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | @mixin reset-filter() { 7 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 8 | } 9 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_nav-divider.scss: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | @mixin nav-divider($color: #e5e5e5) { 6 | height: 1px; 7 | margin: (($line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: $color; 10 | } 11 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_background-variant.scss: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | // [converter] $parent hack 4 | @mixin bg-variant($parent, $color) { 5 | #{$parent} { 6 | background-color: $color; 7 | } 8 | a#{$parent}:hover, 9 | a#{$parent}:focus { 10 | background-color: darken($color, 10%); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sass/bootstrap/bootstrap/mixins/_alerts.scss: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | @mixin alert-variant($background, $border, $text-color) { 4 | background-color: $background; 5 | border-color: $border; 6 | color: $text-color; 7 | 8 | hr { 9 | border-top-color: darken($border, 5%); 10 | } 11 | .alert-link { 12 | color: darken($text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/common/reducers/layout.js: -------------------------------------------------------------------------------- 1 | import { TOGGLE_SIDEBAR } from '../actions/layout'; 2 | 3 | export default function layout(state = {sidebarOpen: false}, action) { 4 | switch (action.type) { 5 | case TOGGLE_SIDEBAR: 6 | return { 7 | sidebarOpen : action.value 8 | }; 9 | default: 10 | return state; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/common/api/fetchComponentDataBeforeRender.js: -------------------------------------------------------------------------------- 1 | export function fetchComponentDataBeforeRender(dispatch, components, params) { 2 | const needs = components.reduce( (prev, current) => { 3 | return current ? (current.need || []).concat(prev) : prev; 4 | }, []); 5 | 6 | const promises = needs.map(need => dispatch(need(params))); 7 | return Promise.all(promises); 8 | } 9 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | require('babel/register'); 2 | const appEnv = process.env.NODE_ENV; 3 | if(appEnv === "development" ){ 4 | module.exports = require('./webpack/webpack.config.development'); 5 | }else if(appEnv === "production" ){ 6 | module.exports = require('./webpack/webpack.config.production'); 7 | }else{ 8 | module.exports = require('./webpack/webpack.config.development'); 9 | } 10 | -------------------------------------------------------------------------------- /src/server/config/database.js: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import glob from 'glob'; 3 | import mongoose from 'mongoose'; 4 | export default function(app,config){ 5 | 6 | mongoose.connect(config.db); 7 | 8 | const db = mongoose.connection; 9 | 10 | db.on('error', function () { 11 | throw new Error('unable to connect to database at ' + config.db); 12 | }); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/common/components/topic/NoTopic.js: -------------------------------------------------------------------------------- 1 | import React , { Component } from 'react'; 2 | 3 | /** 4 | * 无话题组件 5 | */ 6 | class NoTopic extends Component{ 7 | 8 | render(){ 9 | return ( 10 |无话题组件!
12 |Sorry, we've misplaced that URL or it's pointing to something that does not exist.
12 | */} 13 | 14 |> Head back home
15 |
17 |
18 | 住宅楼施工组织设计(作业)
19 |
20 | 正在加载...
15 | ); 16 | } else { 17 | topicsComponent = this._renderTopic(topics); 18 | } 19 | return ( 20 |'+message+'
基于Sass+React+Redux+React-Router+React-Bootstrap+Express MVC+MongoDB实现!
12 |基于Sass+React+Redux+React-Router+React-Bootstrap+Express MVC+MongoDB实现!
19 |基于Sass+React+Redux+React-Router+React-Bootstrap+Express MVC+MongoDB实现!
26 |