-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor whole source code following coding style
- Loading branch information
Showing
165 changed files
with
4,637 additions
and
3,249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
root: true, | ||
parserOptions: { | ||
ecmaVersion: 6, | ||
}, | ||
env: { | ||
node: true, | ||
mocha: true, | ||
}, | ||
extends: ['plugin:eslint-plugin/recommended', 'plugin:vue-libs/recommended'], | ||
plugins: ['eslint-plugin'], | ||
rules: { | ||
'eslint-plugin/report-message-format': ['error', "^[A-Z`'{].*\\.$"], | ||
'eslint-plugin/prefer-placeholders': 'error', | ||
'eslint-plugin/consistent-output': 'error', | ||
'no-mixed-operators': 'error', | ||
'space-before-function-paren': 'off', | ||
'vue/comma-dangle': ['error', 'always-multiline'], | ||
'comma-dangle': ['error', 'always-multiline'], | ||
'semi': ['error', 'always'], | ||
"no-mixed-operators": [ | ||
"error", | ||
{ | ||
"groups": [ | ||
["&", "|", "^", "~", "<<", ">>", ">>>"], | ||
["==", "!=", "===", "!==", ">", ">=", "<", "<="], | ||
["&&", "||"], | ||
["in", "instanceof"] | ||
], | ||
"allowSamePrecedence": true | ||
} | ||
] | ||
}, | ||
|
||
overrides: [ | ||
{ | ||
files: ['lib/rules/*.js'], | ||
rules: { | ||
'consistent-docs-description': 'error', | ||
'no-invalid-meta': 'error', | ||
'eslint-plugin/require-meta-type': 'error', | ||
'require-meta-docs-url': [ | ||
'error', | ||
{ | ||
pattern: `https://eslint.vuejs.org/rules/{{name}}.html`, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
singleQuote: true, | ||
semi: true, | ||
tabWidth: 2, | ||
trailingComma: 'es5', | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,73 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"dev": "npm run development", | ||
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"watch": "npm run development -- --watch", | ||
"watch-poll": "npm run watch -- --watch-poll", | ||
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"prod": "npm run production", | ||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.3.3", | ||
"@babel/plugin-transform-runtime": "^7.2.0", | ||
"@babel/polyfill": "^7.2.5", | ||
"@babel/preset-env": "^7.3.1", | ||
"babel-core": "^6.26.3", | ||
"babel-helper-vue-jsx-merge-props": "^2.0.3", | ||
"babel-loader": "^8.0.5", | ||
"babel-plugin-syntax-dynamic-import": "^6.18.0", | ||
"babel-plugin-syntax-jsx": "^6.18.0", | ||
"babel-plugin-transform-vue-jsx": "^3.7.0", | ||
"babel-preset-env": "^1.7.0", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"laravel-mix": "^4.0.7", | ||
"lodash": "^4.17.5", | ||
"popper.js": "^1.14.7", | ||
"resolve-url-loader": "^2.3.2", | ||
"sass": "^1.17.0", | ||
"sass-loader": "^7.1.0", | ||
"webpack": "^4.29.4", | ||
"webpack-cli": "^3.2.3" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.18", | ||
"clipboard": "^2.0.4", | ||
"cross-env": "^5.1", | ||
"driver.js": "^0.9.2", | ||
"dropzone": "^5.5.1", | ||
"echarts": "^4.2.0-rc.2", | ||
"element-ui": "^2.5.4", | ||
"file-saver": "^2.0.0", | ||
"js-cookie": "^2.2.0", | ||
"jsonlint": "^1.6.3", | ||
"jszip": "^3.1.5", | ||
"normalize.css": "^8.0.1", | ||
"nprogress": "^0.2.0", | ||
"optimize-css-assets-webpack-plugin": "^5.0.1", | ||
"script-loader": "^0.7.2", | ||
"sortablejs": "^1.8.3", | ||
"svg-sprite-loader": "^4.1.3", | ||
"svgo": "^1.1.1", | ||
"tui-editor": "^1.3.0", | ||
"uglifyjs-webpack-plugin": "^2.1.1", | ||
"url-loader": "^1.1.2", | ||
"vue": "^2.6.6", | ||
"vue-count-to": "^1.0.13", | ||
"vue-i18n": "^8.8.2", | ||
"vue-router": "^3.0.2", | ||
"vue-splitpane": "^1.0.2", | ||
"vue-template-compiler": "^2.6.6", | ||
"vuex": "^3.1.0", | ||
"xlsx": "^0.14.1" | ||
}, | ||
"resolutions": { | ||
"ajv": "6.8.1" | ||
} | ||
"private": true, | ||
"scripts": { | ||
"dev": "npm run development", | ||
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"watch": "npm run development -- --watch", | ||
"watch-poll": "npm run watch -- --watch-poll", | ||
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"prod": "npm run production", | ||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.3.3", | ||
"@babel/plugin-transform-runtime": "^7.2.0", | ||
"@babel/polyfill": "^7.2.5", | ||
"@babel/preset-env": "^7.3.1", | ||
"babel-core": "^6.26.3", | ||
"babel-helper-vue-jsx-merge-props": "^2.0.3", | ||
"babel-loader": "^8.0.5", | ||
"babel-plugin-syntax-dynamic-import": "^6.18.0", | ||
"babel-plugin-syntax-jsx": "^6.18.0", | ||
"babel-plugin-transform-vue-jsx": "^3.7.0", | ||
"babel-preset-env": "^1.7.0", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"cross-env": "^5.1", | ||
"eslint": "^5.14.1", | ||
"eslint-loader": "^2.1.2", | ||
"eslint-plugin-eslint-plugin": "^2.0.1", | ||
"eslint-plugin-vue": "^5.2.2", | ||
"eslint-plugin-vue-libs": "^3.0.0", | ||
"laravel-mix": "^4.0.7", | ||
"laravel-mix-eslint": "^0.1.2", | ||
"lodash": "^4.17.5", | ||
"optimize-css-assets-webpack-plugin": "^5.0.1", | ||
"resolve-url-loader": "^2.3.2", | ||
"sass": "^1.17.0", | ||
"sass-loader": "^7.1.0", | ||
"script-loader": "^0.7.2", | ||
"svg-sprite-loader": "^4.1.3", | ||
"uglifyjs-webpack-plugin": "^2.1.1", | ||
"url-loader": "^1.1.2", | ||
"webpack": "^4.29.4", | ||
"webpack-cli": "^3.2.3" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.18", | ||
"clipboard": "^2.0.4", | ||
"driver.js": "^0.9.2", | ||
"dropzone": "^5.5.1", | ||
"echarts": "^4.2.0-rc.2", | ||
"element-ui": "^2.5.4", | ||
"file-saver": "^2.0.0", | ||
"js-cookie": "^2.2.0", | ||
"jsonlint": "^1.6.3", | ||
"jszip": "^3.1.5", | ||
"normalize.css": "^8.0.1", | ||
"nprogress": "^0.2.0", | ||
"sortablejs": "^1.8.3", | ||
"svgo": "^1.1.1", | ||
"tui-editor": "^1.3.0", | ||
"vue": "^2.6.6", | ||
"vue-count-to": "^1.0.13", | ||
"vue-i18n": "^8.8.2", | ||
"vue-router": "^3.0.2", | ||
"vue-splitpane": "^1.0.2", | ||
"vue-template-compiler": "^2.6.6", | ||
"vuex": "^3.1.0", | ||
"xlsx": "^0.14.1" | ||
}, | ||
"resolutions": { | ||
"ajv": "6.8.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"/js/app.js": "/js/app.js?id=fafb2f1358b200e5c7f3", | ||
"/css/app.css": "/css/app.css?id=607226ae0eb62a93db16" | ||
"/js/app.js": "/js/app.js", | ||
"/css/app.css": "/css/app.css" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
import request from '@/utils/request' | ||
import request from '@/utils/request'; | ||
|
||
export function fetchList(query) { | ||
return request({ | ||
url: '/articles', | ||
method: 'get', | ||
params: query | ||
}) | ||
params: query, | ||
}); | ||
} | ||
|
||
export function fetchArticle(id) { | ||
return request({ | ||
url: '/articles/' + id, | ||
method: 'get' | ||
}) | ||
method: 'get', | ||
}); | ||
} | ||
|
||
export function fetchPv(id) { | ||
return request({ | ||
url: '/articles/' + id + '/pageviews', | ||
method: 'get' | ||
}) | ||
method: 'get', | ||
}); | ||
} | ||
|
||
export function createArticle(data) { | ||
return request({ | ||
url: '/article/create', | ||
method: 'post', | ||
data | ||
}) | ||
data, | ||
}); | ||
} | ||
|
||
export function updateArticle(data) { | ||
return request({ | ||
url: '/article/update', | ||
method: 'post', | ||
data | ||
}) | ||
data, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import request from '@/utils/request' | ||
import request from '@/utils/request'; | ||
|
||
export function login(email, password) { | ||
return request({ | ||
url: '/auth/login', | ||
method: 'post', | ||
data: { | ||
email, | ||
password | ||
} | ||
}) | ||
password, | ||
}, | ||
}); | ||
} | ||
|
||
export function getInfo(token) { | ||
return request({ | ||
url: '/auth/user', | ||
method: 'get' | ||
}) | ||
method: 'get', | ||
}); | ||
} | ||
|
||
export function logout() { | ||
return request({ | ||
url: '/auth/logout', | ||
method: 'post' | ||
}) | ||
method: 'post', | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import request from '@/utils/request' | ||
import request from '@/utils/request'; | ||
|
||
export function getToken() { | ||
return request({ | ||
url: '/qiniu/upload/token', // 假地址 自行替换 | ||
method: 'get' | ||
}) | ||
method: 'get', | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import request from '@/utils/request' | ||
import request from '@/utils/request'; | ||
|
||
export function userSearch(name) { | ||
return request({ | ||
url: '/search/user', | ||
method: 'get', | ||
params: { name } | ||
}) | ||
params: { name }, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import request from '@/utils/request' | ||
import request from '@/utils/request'; | ||
|
||
export function getList(params) { | ||
return request({ | ||
url: '/table/list', | ||
method: 'get', | ||
params | ||
}) | ||
params, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import request from '@/utils/request' | ||
import request from '@/utils/request'; | ||
|
||
export function fetchList(query) { | ||
return request({ | ||
url: '/transaction/list', | ||
method: 'get', | ||
params: query | ||
}) | ||
params: query, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import Vue from 'vue' | ||
import Cookies from 'js-cookie' | ||
import ElementUI from 'element-ui' | ||
import App from './views/App' | ||
import store from './store' | ||
import router from '@/router' | ||
import i18n from './lang' // Internationalization | ||
import '@/icons' // icon | ||
import '@/permission' // permission control | ||
import Vue from 'vue'; | ||
import Cookies from 'js-cookie'; | ||
import ElementUI from 'element-ui'; | ||
import App from './views/App'; | ||
import store from './store'; | ||
import router from '@/router'; | ||
import i18n from './lang'; // Internationalization | ||
import '@/icons'; // icon | ||
import '@/permission'; // permission control | ||
|
||
import * as filters from './filters' // global filters | ||
import * as filters from './filters'; // global filters | ||
|
||
Vue.use(ElementUI, { | ||
size: Cookies.get('size') || 'medium', // set element-ui default size | ||
i18n: (key, value) => i18n.t(key, value) | ||
}) | ||
size: Cookies.get('size') || 'medium', // set element-ui default size | ||
i18n: (key, value) => i18n.t(key, value), | ||
}); | ||
|
||
// register global utility filters. | ||
Object.keys(filters).forEach(key => { | ||
Vue.filter(key, filters[key]) | ||
}) | ||
Vue.filter(key, filters[key]); | ||
}); | ||
|
||
Vue.config.productionTip = false | ||
Vue.config.productionTip = false; | ||
|
||
new Vue({ | ||
el: '#app', | ||
router, | ||
store, | ||
i18n, | ||
render: h => h(App) | ||
}) | ||
el: '#app', | ||
router, | ||
store, | ||
i18n, | ||
render: h => h(App), | ||
}); |
Oops, something went wrong.