Skip to content

Commit 682841a

Browse files
authored
Merge pull request #13 from PanJiaChen/feature/refactor
Feature/refactor
2 parents f6e8859 + 25a4be5 commit 682841a

Some content is hidden

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

57 files changed

+754
-884
lines changed

.eslintrc.js

Lines changed: 117 additions & 291 deletions
Large diffs are not rendered by default.

build/webpack.base.conf.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,19 @@ module.exports = {
4646
loader: 'babel-loader',
4747
include: [resolve('src'), resolve('test')]
4848
},
49+
{
50+
test: /\.svg$/,
51+
loader: 'svg-sprite-loader',
52+
include: [resolve('src/icons')],
53+
options: {
54+
symbolId: 'icon-[name]'
55+
}
56+
},
4957
{
5058
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
5159
loader: 'url-loader',
52-
options: {
60+
exclude: [resolve('src/icons')],
61+
query: {
5362
limit: 10000,
5463
name: utils.assetsPath('img/[name].[hash:7].[ext]')
5564
}

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
},
1313
"dependencies": {
1414
"axios": "0.16.2",
15-
"element-ui": "1.3.7",
16-
"js-cookie": "^2.1.4",
17-
"normalize.css": "3.0.2",
18-
"nprogress": "^0.2.0",
19-
"vue": "2.3.3",
20-
"vue-router": "2.5.3",
15+
"element-ui": "1.4.3",
16+
"js-cookie": "2.1.4",
17+
"normalize.css": "7.0.0",
18+
"nprogress": "0.2.0",
19+
"vue": "2.4.2",
20+
"vue-router": "2.7.0",
2121
"vuex": "2.3.1"
2222
},
2323
"devDependencies": {
@@ -53,10 +53,11 @@
5353
"rimraf": "2.6.0",
5454
"node-sass": "^4.5.0",
5555
"sass-loader": "6.0.5",
56+
"svg-sprite-loader": "3.2.4",
5657
"url-loader": "0.5.8",
57-
"vue-loader": "12.1.0",
58+
"vue-loader": "13.0.4",
5859
"vue-style-loader": "3.0.1",
59-
"vue-template-compiler": "2.3.3",
60+
"vue-template-compiler": "2.4.2",
6061
"webpack": "2.6.1",
6162
"webpack-dev-middleware": "1.10.0",
6263
"webpack-hot-middleware": "2.18.0",

src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default {
99
name: 'app'
1010
}
1111
</script>
12+
1213
<style lang="scss">
14+
@import '~normalize.css/normalize.css';// normalize.css 样式格式化
1315
@import './styles/index.scss'; // 全局自定义的css样式
1416
</style>
15-
16-

src/api/login.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
1-
import fetch from '@/utils/fetch';
1+
import fetch from '@/utils/fetch'
22

3-
export function login(email, password) {
3+
export function login(username, password) {
44
return fetch({
55
url: '/user/login',
66
method: 'post',
77
data: {
8-
email,
8+
username,
99
password
1010
}
11-
});
11+
})
1212
}
1313

1414
export function getInfo(token) {
1515
return fetch({
1616
url: '/user/info',
1717
method: 'get',
1818
params: { token }
19-
});
19+
})
2020
}
2121

2222
export function logout() {
2323
return fetch({
2424
url: '/user/logout',
2525
method: 'post'
26-
});
26+
})
2727
}
28-
29-
30-

src/api/table.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import fetch from '@/utils/fetch';
1+
import fetch from '@/utils/fetch'
22

33
export function getList(params) {
44
return fetch({
55
url: '/table/list',
66
method: 'get',
77
params
8-
});
8+
})
99
}
10-
11-

src/assets/iconfont/iconfont.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/Hamburger/index.vue

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
<template>
2-
<div>
3-
<svg t="1492500959545" @click="toggleClick" class="svg-icon hamburger" :class="{'is-active':isActive}" style="" viewBox="0 0 1024 1024"
4-
version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1691" xmlns:xlink="http://www.w3.org/1999/xlink" width="64"
5-
height="64">
6-
<path d="M966.8023 568.849776 57.196677 568.849776c-31.397081 0-56.850799-25.452695-56.850799-56.850799l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 543.397081 998.200404 568.849776 966.8023 568.849776z"
7-
p-id="1692"></path>
8-
<path d="M966.8023 881.527125 57.196677 881.527125c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 856.07443 998.200404 881.527125 966.8023 881.527125z"
9-
p-id="1693"></path>
10-
<path d="M966.8023 256.17345 57.196677 256.17345c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.850799 56.850799-56.850799l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.850799l0 0C1023.653099 230.720755 998.200404 256.17345 966.8023 256.17345z"
11-
p-id="1694"></path>
12-
</svg>
13-
</div>
2+
<div>
3+
<svg t="1492500959545" @click="toggleClick" class="svg-icon hamburger" :class="{'is-active':isActive}" style="" viewBox="0 0 1024 1024"
4+
version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1691" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64">
5+
<path d="M966.8023 568.849776 57.196677 568.849776c-31.397081 0-56.850799-25.452695-56.850799-56.850799l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 543.397081 998.200404 568.849776 966.8023 568.849776z"
6+
p-id="1692"></path>
7+
<path d="M966.8023 881.527125 57.196677 881.527125c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 856.07443 998.200404 881.527125 966.8023 881.527125z"
8+
p-id="1693"></path>
9+
<path d="M966.8023 256.17345 57.196677 256.17345c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.850799 56.850799-56.850799l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.850799l0 0C1023.653099 230.720755 998.200404 256.17345 966.8023 256.17345z"
10+
p-id="1694"></path>
11+
</svg>
12+
</div>
1413
</template>
1514

1615
<script>
17-
export default {
18-
name: 'hamburger',
19-
props: {
20-
isActive: {
21-
type: Boolean,
22-
default: false
23-
},
24-
toggleClick: {
25-
type: Function,
26-
default: null
27-
}
28-
}
16+
export default {
17+
name: 'hamburger',
18+
props: {
19+
isActive: {
20+
type: Boolean,
21+
default: false
22+
},
23+
toggleClick: {
24+
type: Function,
25+
default: null
2926
}
27+
}
28+
}
3029
</script>
3130

3231
<style scoped>

src/icons/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Vue from 'vue'
2+
import IconSvg from '@/components/Icon-svg'// svg组件
3+
4+
// register globally
5+
Vue.component('icon-svg', IconSvg)
6+
7+
const requireAll = requireContext => requireContext.keys().map(requireContext)
8+
const req = require.context('./svg', false, /\.svg$/)
9+
requireAll(req)

src/icons/svg/404.svg

Lines changed: 1 addition & 0 deletions
Loading

src/icons/svg/EXCEL.svg

Lines changed: 1 addition & 0 deletions
Loading

src/icons/svg/QQ.svg

Lines changed: 1 addition & 0 deletions
Loading

src/icons/svg/a.svg

Lines changed: 1 addition & 0 deletions
Loading

src/icons/svg/b.svg

Lines changed: 1 addition & 0 deletions
Loading

src/icons/svg/bug.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)