├── .eslintrc.js
├── .gitignore
├── LICENSE
├── README.md
├── debug.log
├── manifest.json
├── npm-scripts
├── before-build-dll.script.js
└── before-build.script.js
├── package-lock.json
├── package.json
├── src
├── dll
│ ├── dll.css
│ └── dll.js
├── index.html
├── pages
│ ├── alert
│ │ └── index
│ │ │ ├── content.ejs
│ │ │ ├── html.js
│ │ │ └── page.js
│ ├── index
│ │ ├── index
│ │ │ ├── content.ejs
│ │ │ ├── html.js
│ │ │ └── page.js
│ │ └── login
│ │ │ ├── html.js
│ │ │ ├── page.js
│ │ │ ├── page.less
│ │ │ └── templates
│ │ │ ├── forget-password-box.html
│ │ │ ├── login-box.ejs
│ │ │ └── main.ejs
│ └── user
│ │ ├── edit-password
│ │ ├── content.ejs
│ │ ├── html.js
│ │ └── page.js
│ │ └── modify-info
│ │ ├── content.ejs
│ │ ├── html.js
│ │ └── page.js
└── public-resource
│ ├── components
│ ├── footer
│ │ └── html.ejs
│ ├── header
│ │ └── html.ejs
│ ├── side-menu
│ │ └── html.ejs
│ └── top-nav
│ │ └── html.ejs
│ ├── config
│ ├── build-file.config.js
│ └── common.config.js
│ ├── iconfont
│ ├── demo.css
│ ├── demo.html
│ ├── iconfont.css
│ ├── iconfont.eot
│ ├── iconfont.svg
│ ├── iconfont.ttf
│ └── iconfont.woff
│ ├── imgs
│ └── login-bg.jpg
│ ├── layout
│ ├── layout-without-nav
│ │ ├── html.ejs
│ │ └── html.js
│ └── layout
│ │ ├── html.ejs
│ │ └── html.js
│ ├── less
│ ├── base-dir
│ │ ├── _badge.less
│ │ ├── _button.less
│ │ ├── _form.less
│ │ ├── _global.less
│ │ ├── _iconfont.less
│ │ ├── _mixins.less
│ │ ├── _panel.less
│ │ ├── _table.less
│ │ └── _variables.less
│ ├── base.less
│ ├── components-dir
│ │ ├── _modal.less
│ │ ├── _side-nav.less
│ │ ├── _tab.less
│ │ └── _top-menu.less
│ └── vendor-dir
│ │ └── bootstrap
│ │ ├── css
│ │ └── bootstrap.min.css
│ │ └── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
│ ├── libs
│ ├── libs.module.js
│ └── without-jquery.module.js
│ └── logic
│ └── common.page.js
├── stats.json
├── vendor
├── ie-fix
│ ├── html5shiv.min.js
│ ├── jquery.xdomainrequest.min.js
│ ├── respond-proxy.html
│ ├── respond.min.js
│ ├── respond.proxy.gif
│ ├── respond.proxy.js
│ └── xdomain.all.js
├── metisMenu
│ ├── metisMenu.min.css
│ └── metisMenu.min.js
└── promise.min.js
├── webpack-config
├── base
│ ├── dir-vars.config.js
│ └── page-entries.config.js
├── devServer.config.js
├── entry.config.js
├── externals.config.js
├── inherit
│ ├── module.config.js
│ └── plugins.config.js
├── module.dev.config.js
├── module.product.config.js
├── output.config.js
├── plugins.dev.config.js
├── plugins.product.config.js
├── resolve.config.js
└── vendor
│ ├── eslint.config.js
│ └── postcss.config.js
├── webpack-dll.config.js
├── webpack.config.js
└── webpack.dev.config.js
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // http://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | extends: 'standard',
6 | parser: 'babel-eslint',
7 | parserOptions: {
8 | sourceType: 'module'
9 | },
10 | globals: {
11 | // Put things like jQuery, etc
12 | jQuery: true,
13 | $: true,
14 | },
15 | env: {
16 | browser: true,
17 | jquery: true,
18 | },
19 | // required to lint *.vue files
20 | plugins: [
21 | 'html'
22 | ],
23 | // add your custom rules here
24 | rules: {
25 | // allow debugger during development
26 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
27 | "camelcase": 0,
28 | "no-extra-boolean-cast": 0,
29 | "space-before-function-paren": ["error", "never"],
30 | "semi": ["error", "always"],
31 | "comma-dangle": [2, "always-multiline"],
32 | "no-console": 0, //console 未删除
33 | "no-var": 0,
34 | "no-new": 0,
35 | "import/no-unresolved": 0,
36 | "no-underscore-dangle": [0],
37 | "prefer-template": 0,
38 | "object-shorthand": [0],
39 | "prefer-arrow-callback": 0,
40 | "prefer-rest-params": 0,
41 | "no-param-reassign": 0,
42 | "max-len": ["error", {
43 | "code": 200,
44 | "tabWidth": 2,
45 | "comments": 200,
46 | "ignoreComments": false,
47 | "ignoreTrailingComments": false,
48 | "ignoreUrls": true
49 | }],
50 | "global-require": 0,
51 | 'no-restricted-syntax': [
52 | 2,
53 | 'LabeledStatement',
54 | 'WithStatement',
55 | ]
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 | node_modules
11 | build
12 |
13 | # Windows Installer files
14 | *.cab
15 | *.msi
16 | *.msm
17 | *.msp
18 |
19 | # Windows shortcuts
20 | *.lnk
21 |
22 | *.sublime-project
23 | *.sublime-workspace
24 | npm-debug.log
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Array Huang
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # webpack-seed
2 |
3 | ## 注意
4 | 本项目master分支已升级到`webpack2`版本,如需查看`webpack1`版本,请查看[webpack1_version](https://github.com/Array-Huang/webpack-seed/tree/webpack1_version)分支。
5 |
6 | ## 项目介绍
7 | 本项目是一个基于webpack架构的**web app**脚手架,其特点如下:
8 | - 更适合多页应用。
9 | - 既可实现全后端分离,也可以生成后端渲染所需要的模板。
10 | - 引入layout和component的概念,方便多页面间对布局、组件的重用,妈妈再也不用担心我是选SPA呢还是Iframe了,咱们都!不!需!要!
11 | - 编译后的程序不依赖于外部的资源(包括css、font、图片等资源都做了迁移),可以整体放到CDN上。
12 | - 整合Bootstrap3及主题SB-Admin,但其实换掉也很简单,或者干脆不用CSS框架也行。
13 | - 不含Js框架(jQuery不算框架,谢谢)。
14 | - 本项目基于 ***webpack v2*** 和 ***webpack-dev-server v2***,全局和项目局部依赖都一样。
15 |
16 | ## 使用说明
17 | - 本项目使用包管理工具NPM,因此需要先把本项目所依赖的包下载下来:
18 | ```
19 | $ npm install
20 | ```
21 |
22 | - 启动服务器,推荐直接使用webpack-dev-server
23 | ```
24 | $ npm run start
25 | ```
26 |
27 | - 理论上来说,webpack-dev-server会自动帮你打开浏览器并展示示例页面;如果没有的话,请手动打开浏览器,在地址栏里输入`http://localhost:8080`,Duang!页面就出来了!
28 |
29 | ## CLI命令(npm scripts)
30 | | 命令 | 作用&效果 |
31 | | --------------- | ------------- |
32 | | npm run build | 根据`webpack.config.js`,build出一份生产环境的代码 |
33 | | npm run dev | 根据`webpack.dev.config.js`,build出一份开发环境的代码 |
34 | | npm run start | 开启webpack-dev-server并自动打开浏览器,自动监测源码变动并实现LiveReload,**推荐实际开发时使用此项** |
35 | | npm run profile | 显示编译过程中每一项资源的耗时,用来调优的 |
36 | | npm run dll | 生成Dll文件,每次升级第三方库时都需要重新执行一遍 |
37 | | npm run analyse | 生成打包文件结构的可视化分析报告;注意请在`npm run build`或`npm run dev`后再执行 |
38 | | npm run analyze | 作用同上 |
39 |
40 | ## 目录结构说明
41 | ```
42 | ├─build # 编译后生成的所有代码、资源(图片、字体等,虽然只是简单的从源目录迁移过来)
43 | ├─node_modules # 利用npm管理的所有包及其依赖
44 | ├─vendor # 所有不能用npm管理的第三方库
45 | ├─.babelrc # babel的配置文件
46 | ├─.eslintrc # ESLint的配置文件
47 | ├─index.html # 仅作为重定向使用
48 | ├─package.json # npm的配置文件
49 | ├─webpack-config # 存放分拆后的webpack配置文件
50 | │ ├─base # 主要是存放一些变量
51 | │ ├─inherit # 存放生产环境和开发环境相同的部分,以供继承
52 | │ └─vendor # 存放webpack兼容第三方库所需的配置文件
53 | ├─webpack.config.js # 生产环境的webpack配置文件(无实质内容,仅为组织整理)
54 | ├─webpack.dev.config.js # 开发环境的webpack配置文件(无实质内容,仅为组织整理)
55 | ├─src # 当前项目的源码
56 | ├─pages # 各个页面独有的部分,如入口文件、只有该页面使用到的css、模板文件等
57 | │ ├─alert # 业务模块
58 | │ │ └─index # 具体页面
59 | │ ├─index # 业务模块
60 | │ │ ├─index # 具体页面
61 | │ │ └─login # 具体页面
62 | │ │ └─templates # 如果一个页面的HTML比较复杂,可以分成多块再拼在一起
63 | │ └─user # 业务模块
64 | │ ├─edit-password # 具体页面
65 | │ └─modify-info # 具体页面
66 | └─public-resource # 各个页面使用到的公共资源
67 | ├─components # 组件,可以是纯HTML,也可以包含js/css/image等,看自己需要
68 | │ ├─footer # 页尾
69 | │ ├─header # 页头
70 | │ ├─side-menu # 侧边栏
71 | │ └─top-nav # 顶部菜单
72 | ├─config # 各种配置文件
73 | ├─iconfont # iconfont的字体文件
74 | ├─imgs # 公用的图片资源
75 | ├─layout # UI布局,组织各个组件拼起来,因应需要可以有不同的布局套路
76 | │ ├─layout # 具体的布局套路
77 | │ └─layout-without-nav # 具体的布局套路
78 | ├─less # less文件,用sass的也可以,又或者是纯css
79 | │ ├─base-dir
80 | │ ├─components-dir # 如果组件本身不需要js的,那么要加载组件的css比较困难,我建议可以直接用less来加载
81 | │ └─base.less # 组织所有的less文件
82 | ├─libs # 与业务逻辑无关的库都可以放到这里
83 | └─logic # 业务逻辑
84 | ```
85 |
86 | ## 更新日志
87 | ### 2.1.0 (2017-07-26)
88 | 更新了一批浏览器缓存相关配置,详情请看[webpack多页应用架构系列(十六):善用浏览器缓存,该去则去,该留则留](https://segmentfault.com/a/1190000010317802)
89 |
90 | ### 2.0.0 (2017-03-05)
91 | webpack及webpack-dev-server升级到v2版本,并相应修改webpack配置文件。
92 |
93 | ### 1.4.1 (2017-01-24)
94 | 支持js/css/less文件的热更新,但暂未支持模板文件。
95 |
96 | ### 1.3.1 (2016-12-01)
97 | 改为利用`webpack --json`来生成**webpack-bundle-analyzer**生成包文件结构的可视化分析报告所需的json文件。
98 |
99 | ### 1.3.0 (2016-11-22)
100 | 引入**webpack-bundle-analyzer**,用以生成打包文件结构的可视化分析报告。
101 |
102 | ### 2.0.0 (2016-10-21)
103 | 把基础设施从项目里抽离出来,实现多项目共用同一套架构/基础设施。由于本项目肩负有教程示例的责任,且2.x版本变化极大,因此另辟一个新repo([Array-Huang/webpack-seed-v2](https://github.com/Array-Huang/webpack-seed-v2))来放置。
104 |
105 | ### 1.2.2 (2016-10-16)
106 | 考虑到多个页面可能会共用html/js/css(例如**添加页面**和**修改页面**),在自动查找页面入口时,忽略以`_`开头的目录,因此,可以使用以`_`开头的目录来放置页面复用的资源。
107 |
108 | ### 1.2.0 (2016-10-14)
109 | 利用[`isaacs/node-glob`](https://github.com/isaacs/node-glob)根据约定好的文件目录结构自动查找页面入口,取代过去手动指定的做法(但如果在调试过程中希望只编译某些页面,仍然可以通过手动指定来实现)。
110 |
111 | ### 1.1.0
112 | 引入Dll的概念,将第三方库进行预打包,那么在打包我们的业务代码的时候,就不需要重复打包这些第三方库了。这尤其能提现在bootstrap上,可以省一大半的时间。
113 | - 如果修改了Dll所包含的第三方库,比如说升级之类的,请使用`npm run dll`重新打包Dll文件。注意:系统会在打包Dll前先清空Dll目录。
114 | - 如果重新打包了Dll,那么也请重新打包你的业务代码,使用`npm run build`或`npm run dev`。
115 |
116 | ### 1.0.2
117 | - 编译文件前先清空build目录。
118 | - 分拆webpack配置文件,避免配置文件日益臃肿。
119 | - 分开生产环境和开发环境的webpack配置文件。其中,`npm run build`会调用生产环境的webpack配置文件(webpack.config.js),而`npm run dev`和`npm run watch`会调用开发环境的配置文件。
120 |
121 | ### 1.0.0
122 | 由于此脚手架已具备投入生产环境的能力,故直接定义版本号为1.0.0
--------------------------------------------------------------------------------
/debug.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Array-Huang/webpack-seed/511480ba0ffd9c4153c1a2e5e7b79550aac6d2e2/debug.log
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dll",
3 | "content": {
4 | "./node_modules/jquery/dist/jquery.js": {
5 | "id": 0,
6 | "meta": {}
7 | },
8 | "./node_modules/bootstrap/dist/js/bootstrap.min.js": {
9 | "id": 1,
10 | "meta": {}
11 | },
12 | "./vendor/metisMenu/metisMenu.min.css": {
13 | "id": 2,
14 | "meta": {}
15 | },
16 | "./node_modules/bootstrap/dist/css/bootstrap.min.css": {
17 | "id": 3,
18 | "meta": {}
19 | },
20 | "./vendor/metisMenu/metisMenu.min.js": {
21 | "id": 4,
22 | "meta": {}
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/npm-scripts/before-build-dll.script.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var rimraf = require('rimraf');
3 | var dirVars = require('../webpack-config/base/dir-vars.config.js');
4 | rimraf(dirVars.dllDir, fs, function cb() {
5 | console.log('dll目录已清空');
6 | });
7 |
--------------------------------------------------------------------------------
/npm-scripts/before-build.script.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var rimraf = require('rimraf');
3 | var dirVars = require('../webpack-config/base/dir-vars.config.js');
4 | rimraf(dirVars.buildDir, fs, function cb() {
5 | console.log('build目录已清空');
6 | });
7 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "webpack-seed",
3 | "version": "2.0.0",
4 | "description": "This is a seed for web application built by webpack",
5 | "scripts": {
6 | "build": "./node_modules/.bin/webpack --progress --colors --bail",
7 | "dev": "./node_modules/.bin/webpack --progress --colors --config ./webpack.dev.config.js",
8 | "start": "./node_modules/.bin/webpack-dev-server --config ./webpack.dev.config.js --open --hot",
9 | "profile": "./node_modules/.bin/webpack --colors --profile --display-modules --config ./webpack.dev.config.js",
10 | "dll": "./node_modules/.bin/webpack --progress --colors --config ./webpack-dll.config.js",
11 | "analyse": "webpack --json > ./build/stats.json && webpack-bundle-analyzer --port 8989 ./build/stats.json",
12 | "analyze": "npm run analyse"
13 | },
14 | "repository": {
15 | "type": "git",
16 | "url": "git@github.com:Array-Huang/webpack-seed.git"
17 | },
18 | "author": "Array Huang",
19 | "license": "MIT",
20 | "devDependencies": {
21 | "autoprefixer": "^6.4.0",
22 | "babel-core": "^6.25.0",
23 | "babel-eslint": "^7.2.3",
24 | "babel-loader": "^6.2.4",
25 | "babel-plugin-transform-runtime": "^6.15.0",
26 | "babel-preset-es2015": "^6.24.1",
27 | "babel-runtime": "^6.11.6",
28 | "css-loader": "^0.26.0",
29 | "ejs-loader": "^0.3.0",
30 | "eslint": "^3.19.0",
31 | "eslint-config-standard": "^7.1.0",
32 | "eslint-friendly-formatter": "^2.0.7",
33 | "eslint-loader": "^1.9.0",
34 | "eslint-plugin-html": "^2.0.3",
35 | "eslint-plugin-promise": "^3.5.0",
36 | "eslint-plugin-standard": "^2.3.1",
37 | "exports-loader": "^0.6.3",
38 | "expose-loader": "^0.7.1",
39 | "extract-text-webpack-plugin": "^2.1.2",
40 | "file-loader": "^0.10.0",
41 | "glob": "^7.1.2",
42 | "html-loader": "^0.4.3",
43 | "html-webpack-plugin": "^2.29.0",
44 | "less": "^2.7.1",
45 | "less-loader": "^2.2.3",
46 | "null-loader": "^0.1.1",
47 | "postcss-loader": "^1.2.2",
48 | "precss": "^1.4.0",
49 | "rimraf": "^2.5.4",
50 | "style-loader": "^0.13.1",
51 | "url-loader": "^0.5.9",
52 | "webpack": "^2.7.0",
53 | "webpack-bundle-analyzer": "^2.8.3",
54 | "webpack-dev-server": "^2.5.1",
55 | "webpack-plugin-hash-output": "^1.3.0"
56 | },
57 | "dependencies": {
58 | "bootstrap": "^3.3.7",
59 | "jquery": "^1.12.4"
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/pages/alert/index/content.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 消息通知筛选条件
10 |
11 |
12 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | 消息通知列表
36 |
37 |
71 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/src/pages/alert/index/html.js:
--------------------------------------------------------------------------------
1 | const content = require('./content.ejs'); // 调取存放本页面实际内容的模板文件
2 | const layout = require('layout'); // 调用管理后台内部所使用的布局方案,我在webpack配置里定义其别名为'layout'
3 | const pageTitle = '消息通知'; // 页面名称
4 |
5 | // 给layout传入“页面名称”这一参数(当然有需要的话也可以传入其它参数),同时也传入页面实际内容的HTML字符串。content({ pageTitle })的意思就是把pageTitle作为模板变量传给ejs模板引擎并返回最终生成的HTML字符串。
6 | module.exports = layout.init({ pageTitle }).run(content({ pageTitle }));
7 |
--------------------------------------------------------------------------------
/src/pages/alert/index/page.js:
--------------------------------------------------------------------------------
1 | require('cp');
2 | $(() => {
3 |
4 | });
5 |
--------------------------------------------------------------------------------
/src/pages/index/index/content.ejs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/index/index/html.js:
--------------------------------------------------------------------------------
1 | const content = require('./content.ejs');
2 | const layout = require('layout');
3 |
4 | module.exports = layout.init({
5 | pageTitle: '',
6 | }).run(content());
7 |
--------------------------------------------------------------------------------
/src/pages/index/index/page.js:
--------------------------------------------------------------------------------
1 | require('cp');
2 | const config = require('configModule');
3 |
4 | $(() => {
5 | /* global IS_PRODUCTION:true */ // 由于ESLint会检测没有定义的变量,因此需要这一个`global`注释声明IS_PRODUCTION是一个全局变量(当然在本例中并不是)来规避warning
6 | if (!IS_PRODUCTION) {
7 | console.log('如果你看到这个Log,那么这个版本实际上是开发用的版本');
8 | console.log(config.API_ROOT);
9 | }
10 | });
11 |
--------------------------------------------------------------------------------
/src/pages/index/login/html.js:
--------------------------------------------------------------------------------
1 | const config = require('configModule');
2 | const noJquery = require('withoutJqueryModule');
3 | const content = require('./templates/main.ejs');
4 | const layout = require('layout-without-nav');
5 | const dirsConfig = config.DIRS;
6 |
7 | const loginBoxHtml = require('./templates/login-box.ejs')({
8 | constructInsideUrl: noJquery.constructInsideUrl,
9 | });
10 | const forgetPasswordHtml = require('./templates/forget-password-box.html');
11 | const renderData = Object.assign({}, dirsConfig, { loginBoxHtml, forgetPasswordHtml });
12 |
13 | module.exports = layout.init({
14 | pageTitle: '',
15 | }).run(content(renderData));
16 |
--------------------------------------------------------------------------------
/src/pages/index/login/page.js:
--------------------------------------------------------------------------------
1 | require('lessDir/base.less');
2 | require('./page.less');
3 |
4 | window.switchToPage = (page) => {
5 | switch (page) {
6 | case 'login':
7 | $('#user-edit-password').hide();
8 | $('#login-box').show();
9 | break;
10 |
11 | case 'forget-password':
12 | $('#login-box').hide();
13 | $('#user-edit-password').show();
14 | break;
15 |
16 | default:
17 | }
18 | };
19 |
20 | $(() => {
21 |
22 | });
23 |
--------------------------------------------------------------------------------
/src/pages/index/login/page.less:
--------------------------------------------------------------------------------
1 | html, body {
2 | overflow-y: auto;
3 | }
4 | @media(min-width: 768px) {
5 | min-height: 945px;
6 | }
7 |
8 | @media(min-width: 768px) {
9 | #bg {
10 | width: 100%;
11 | height: 945px;
12 | position: absolute;
13 | z-index: 0;
14 | }
15 | }
16 |
17 | .register-panel, .login-panel, .forget-password-panel {
18 | margin-top: 100px;
19 | }
20 |
21 | .panel-heading {
22 | padding: 31px 15px;
23 |
24 | .panel-title {
25 | font-size: 24px;
26 | color: #333;
27 | }
28 | }
29 |
30 | .panel-body {
31 | /* max-height: 450px;
32 | overflow-y: auto; */
33 | padding: 35px 43px;
34 | }
35 |
36 | .tab-content {
37 | margin-top: 15px;
38 | }
39 |
40 | .link-container {
41 | margin-top: 15px;
42 | }
43 |
44 | .form-inline .form-group {
45 | margin-right: 10px;
46 | }
--------------------------------------------------------------------------------
/src/pages/index/login/templates/forget-password-box.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 重置密码
9 |
10 |
11 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/src/pages/index/login/templates/login-box.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 欢迎登录XXX管理后台
10 |
11 |
12 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/pages/index/login/templates/main.ejs:
--------------------------------------------------------------------------------
1 |
8 |
15 |
16 | <%= loginBoxHtml %>
17 | <%= forgetPasswordHtml %>
18 |
--------------------------------------------------------------------------------
/src/pages/user/edit-password/content.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/src/pages/user/edit-password/html.js:
--------------------------------------------------------------------------------
1 | const content = require('./content.ejs');
2 | const layout = require('layout');
3 | const pageTitle = '修改密码';
4 | module.exports = layout.init({ pageTitle }).run(content({ pageTitle }));
5 |
--------------------------------------------------------------------------------
/src/pages/user/edit-password/page.js:
--------------------------------------------------------------------------------
1 | require('cp');
2 | $(() => {
3 | });
4 |
--------------------------------------------------------------------------------
/src/pages/user/modify-info/content.ejs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/user/modify-info/html.js:
--------------------------------------------------------------------------------
1 | const content = require('./content.ejs');
2 | const layout = require('layout');
3 | const pageTitle = '修改个人信息';
4 | module.exports = layout.init({ pageTitle }).run(content({ pageTitle }));
5 |
--------------------------------------------------------------------------------
/src/pages/user/modify-info/page.js:
--------------------------------------------------------------------------------
1 | require('cp');
2 |
3 | $(() => {
4 | });
5 |
--------------------------------------------------------------------------------
/src/public-resource/components/footer/html.ejs:
--------------------------------------------------------------------------------
1 |
2 |