Skip to content

Commit 506be79

Browse files
committed
Initialize commit
0 parents  commit 506be79

92 files changed

Lines changed: 7623 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab

.eslintrc.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
extends: ['airbnb', 'prettier', 'plugin:compat/recommended'],
4+
env: {
5+
browser: true,
6+
node: true,
7+
es6: true,
8+
mocha: true,
9+
jest: true,
10+
jasmine: true,
11+
},
12+
globals: {
13+
APP_TYPE: true,
14+
page: true,
15+
},
16+
rules: {
17+
'react/jsx-filename-extension': [1, { extensions: ['.js'] }],
18+
'react/jsx-wrap-multilines': 0,
19+
'react/prop-types': 0,
20+
'react/forbid-prop-types': 0,
21+
'react/jsx-one-expression-per-line': 0,
22+
'import/no-unresolved': [2, { ignore: ['^@/', '^umi/'] }],
23+
'import/no-extraneous-dependencies': [
24+
2,
25+
{
26+
optionalDependencies: true,
27+
devDependencies: ['**/tests/**.js', '/mock/**.js', '**/**.test.js'],
28+
},
29+
],
30+
'jsx-a11y/no-noninteractive-element-interactions': 0,
31+
'jsx-a11y/click-events-have-key-events': 0,
32+
'jsx-a11y/no-static-element-interactions': 0,
33+
'jsx-a11y/anchor-is-valid': 0,
34+
'linebreak-style': 0,
35+
},
36+
settings: {
37+
polyfills: ['fetch', 'promises', 'url'],
38+
},
39+
};

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
# roadhog-api-doc ignore
6+
/src/utils/request-temp.js
7+
_roadhog-api-doc
8+
9+
# production
10+
/dist
11+
/.vscode
12+
13+
# misc
14+
.DS_Store
15+
npm-debug.log*
16+
yarn-error.log
17+
18+
/coverage
19+
.idea
20+
yarn.lock
21+
package-lock.json
22+
*bak
23+
# visual studio code
24+
.history
25+
.umi
26+
.umi-production

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/*.md
2+
**/*.svg
3+
**/*.ejs
4+
**/*.html
5+
package.json
6+
.umi
7+
.umi-production

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5",
4+
"printWidth": 100,
5+
"overrides": [
6+
{
7+
"files": ".prettierrc",
8+
"options": { "parser": "json" }
9+
}
10+
]
11+
}

.stylelintrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": "stylelint-config-standard",
3+
"rules": {
4+
"selector-pseudo-class-no-unknown": null,
5+
"shorthand-property-no-redundant-values": null,
6+
"at-rule-empty-line-before": null,
7+
"at-rule-name-space-after": null,
8+
"comment-empty-line-before": null,
9+
"declaration-bang-space-before": null,
10+
"declaration-empty-line-before": null,
11+
"function-comma-newline-after": null,
12+
"function-name-case": null,
13+
"function-parentheses-newline-inside": null,
14+
"function-max-empty-lines": null,
15+
"function-whitespace-after": null,
16+
"number-leading-zero": null,
17+
"number-no-trailing-zeros": null,
18+
"rule-empty-line-before": null,
19+
"selector-combinator-space-after": null,
20+
"selector-list-comma-newline-after": null,
21+
"selector-pseudo-element-colon-notation": null,
22+
"unit-no-unknown": null,
23+
"value-list-max-empty-lines": null
24+
}
25+
}

.stylelintrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
3+
"rules": {
4+
"declaration-empty-line-before": null,
5+
"no-descending-specificity": null,
6+
"selector-pseudo-class-no-unknown": null,
7+
"selector-pseudo-element-colon-notation": null
8+
}
9+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Lyric
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.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<h1 align="center">Gin Admin React</h1>
2+
3+
<div align="center">
4+
基于 Ant Design React 实现的RBAC权限管理脚手架,目的是提供一套轻量的中后台开发框架,方便、快速的完成业务需求的开发。
5+
<br/>
6+
7+
</div>
8+
9+
- [在线演示地址](https://demo.tiannianshou.com) (用户名:root,密码:abc-123)(`温馨提醒:为了达到更好的演示效果,这里给出了拥有最高权限的用户,请手下留情,只操作自己新增的数据,不要动平台本身的数据!谢谢!`
10+
11+
## 获取并运行
12+
13+
```
14+
git clone https://github.com/LyricTian/gin-admin-react.git
15+
cd gin-admin-react
16+
npm install
17+
npm start
18+
```
19+
20+
## 打包编译
21+
22+
```
23+
npm run build
24+
```
25+
26+
## MIT License
27+
28+
Copyright (c) 2019 Lyric
29+

config/config.js

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// https://umijs.org/config/
2+
import os from 'os';
3+
import pageRoutes from './router.config';
4+
5+
const plugins = [
6+
[
7+
'umi-plugin-react',
8+
{
9+
antd: true,
10+
dva: {
11+
hmr: true,
12+
},
13+
targets: {
14+
ie: 11,
15+
},
16+
locale: {
17+
enable: true, // default false
18+
default: 'zh-CN', // default zh-CN
19+
},
20+
dynamicImport: {
21+
loadingComponent: './components/PageLoading/index',
22+
},
23+
...(!process.env.TEST && os.platform() === 'darwin'
24+
? {
25+
dll: {
26+
include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'],
27+
exclude: ['@babel/runtime'],
28+
},
29+
hardSource: true,
30+
}
31+
: {}),
32+
},
33+
],
34+
];
35+
36+
export default {
37+
// add for transfer to umi
38+
plugins,
39+
targets: {
40+
ie: 11,
41+
},
42+
// 路由配置
43+
routes: pageRoutes,
44+
hash: true,
45+
// Theme for antd
46+
// https://ant.design/docs/react/customize-theme-cn
47+
theme: {
48+
'primary-color': '#FA8C16',
49+
},
50+
proxy: {
51+
'/api/': {
52+
target: 'http://127.0.0.1:10088/',
53+
changeOrigin: true,
54+
},
55+
},
56+
ignoreMomentLocale: true,
57+
lessLoaderOptions: {
58+
javascriptEnabled: true,
59+
},
60+
disableRedirectHoist: true,
61+
cssLoaderOptions: {
62+
modules: true,
63+
getLocalIdent: (context, _, localName) => {
64+
if (
65+
context.resourcePath.includes('node_modules') ||
66+
context.resourcePath.includes('global.less')
67+
) {
68+
return localName;
69+
}
70+
const match = context.resourcePath.match(/src(.*)/);
71+
if (match && match[1]) {
72+
const antdProPath = match[1].replace('.less', '');
73+
const arr = antdProPath
74+
.split('/')
75+
.map(a => a.replace(/([A-Z])/g, '-$1'))
76+
.map(a => a.toLowerCase());
77+
return `web${arr.join('-')}-${localName}`.replace(/--/g, '-');
78+
}
79+
return localName;
80+
},
81+
},
82+
manifest: {
83+
basePath: '/',
84+
},
85+
};

0 commit comments

Comments
 (0)