Browse Source

yshop1.7发布,后台升級eladmin2.4(前端,后台权限,代码生成器等重构),修复商品分类等一些问题

master
hupeng 5 years ago
parent
commit
b6cc8046db
  1. 17
      .babelrc
  2. 2
      .editorconfig
  3. 8
      .env.development
  4. 5
      .env.production
  5. 3
      .eslintignore
  6. 8
      .eslintrc.js
  7. 11
      .gitignore
  8. 10
      .postcssrc.js
  9. 2
      .travis.yml
  10. 2
      LICENSE
  11. 6
      README.md
  12. 11
      babel.config.js
  13. 67
      build/build.js
  14. 62
      build/check-versions.js
  15. 108
      build/utils.js
  16. 5
      build/vue-loader.conf.js
  17. 122
      build/webpack.base.conf.js
  18. 98
      build/webpack.dev.conf.js
  19. 188
      build/webpack.prod.conf.js
  20. 9
      config/dev.env.js
  21. 106
      config/index.js
  22. 5
      config/prod.env.js
  23. 1
      debug.log
  24. 22
      index.html
  25. 24
      jest.config.js
  26. 146
      package.json
  27. 7
      plopfile.js
  28. 5
      postcss.config.js
  29. 0
      public/favicon.ico
  30. 15
      public/index.html
  31. 2
      src/App.vue
  32. 12
      src/api/data.js
  33. 9
      src/api/generator.js
  34. 4
      src/api/generator/genConfig.js
  35. 33
      src/api/generator/generator.js
  36. 8
      src/api/log.js
  37. 9
      src/api/login.js
  38. 22
      src/api/mnt/app.js
  39. 17
      src/api/mnt/connect.js
  40. 35
      src/api/mnt/database.js
  41. 77
      src/api/mnt/deploy.js
  42. 21
      src/api/mnt/deployHistory.js
  43. 27
      src/api/mnt/serverDeploy.js
  44. 22
      src/api/monitor/log.js
  45. 9
      src/api/monitor/online.js
  46. 27
      src/api/monitor/server.js
  47. 22
      src/api/monitor/visits.js
  48. 16
      src/api/picture.js
  49. 0
      src/api/system/code.js
  50. 9
      src/api/system/dept.js
  51. 9
      src/api/system/dict.js
  52. 2
      src/api/system/dictDetail.js
  53. 9
      src/api/system/job.js
  54. 10
      src/api/system/menu.js
  55. 17
      src/api/system/role.js
  56. 9
      src/api/system/timing.js
  57. 35
      src/api/system/user.js
  58. 0
      src/api/tools/alipay.js
  59. 0
      src/api/tools/email.js
  60. 11
      src/api/tools/localStorage.js
  61. 18
      src/api/tools/picture.js
  62. 17
      src/api/tools/qiniu.js
  63. 1
      src/api/visits.js
  64. 2
      src/api/yxCache.js
  65. 1
      src/api/yxExpress.js
  66. 14
      src/api/yxStoreBargainUser.js
  67. 2
      src/api/yxStoreCategory.js
  68. 18
      src/api/yxStoreOrder.js
  69. 10
      src/api/yxStoreProduct.js
  70. 2
      src/api/yxSystemConfig.js
  71. 2
      src/api/yxWechatReply.js
  72. 2
      src/api/yxWechatTemplate.js
  73. BIN
      src/assets/avatar/avatar.png
  74. 4
      src/assets/icons/index.js
  75. 0
      src/assets/icons/svg/Sign.svg
  76. 0
      src/assets/icons/svg/Steve-Jobs.svg
  77. 0
      src/assets/icons/svg/add.svg
  78. 0
      src/assets/icons/svg/alipay.svg
  79. 0
      src/assets/icons/svg/anq.svg
  80. 1
      src/assets/icons/svg/app.svg
  81. 0
      src/assets/icons/svg/article.svg
  82. 1
      src/assets/icons/svg/backup.svg
  83. 0
      src/assets/icons/svg/banner.svg
  84. 0
      src/assets/icons/svg/bargain.svg
  85. 0
      src/assets/icons/svg/button.svg
  86. 0
      src/assets/icons/svg/chain.svg
  87. 1
      src/assets/icons/svg/chart.svg
  88. 0
      src/assets/icons/svg/codeConsole.svg
  89. 0
      src/assets/icons/svg/comment.svg
  90. 0
      src/assets/icons/svg/configure.svg
  91. 0
      src/assets/icons/svg/coupon.svg
  92. 0
      src/assets/icons/svg/coupon2.svg
  93. 0
      src/assets/icons/svg/dashboard.svg
  94. 1
      src/assets/icons/svg/database.svg
  95. 0
      src/assets/icons/svg/date.svg
  96. 0
      src/assets/icons/svg/dengji.svg
  97. 1
      src/assets/icons/svg/deploy.svg
  98. 0
      src/assets/icons/svg/dept.svg
  99. 0
      src/assets/icons/svg/dev.svg
  100. 0
      src/assets/icons/svg/develop.svg
  101. Some files were not shown because too many files have changed in this diff Show More

17
.babelrc

@ -1,17 +0,0 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins":["transform-vue-jsx", "transform-runtime"],
"env": {
"development":{
"plugins": ["dynamic-import-node"]
}
}
}

2
.editorconfig

@ -1,4 +1,4 @@
# http://editorconfig.org
# https://editorconfig.org
root = true
[*]

8
.env.development

@ -0,0 +1,8 @@
ENV = 'development'
# 接口地址
VUE_APP_BASE_API = 'http://localhost:8000'
VUE_APP_WS_API = 'ws://localhost:8000'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true

5
.env.production

@ -0,0 +1,5 @@
ENV = 'production'
# 接口地址
VUE_APP_BASE_API = 'https://yshopapi.dayouqiantu.cn'
VUE_APP_WS_API = 'ws://yshopapi.dayouqiantu.cn'

3
.eslintignore

@ -1,3 +1,4 @@
build/*.js
config/*.js
src/assets
public
dist

8
.eslintrc.js

@ -21,7 +21,10 @@ module.exports = {
"allowFirstLine": false
}
}],
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline":"off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off",
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
@ -44,7 +47,7 @@ module.exports = {
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': [2, 'allow-null'],
'eqeqeq': ["error", "always", {"null": "ignore"}],
'generator-star-spacing': [2, {
'before': true,
'after': true
@ -73,7 +76,7 @@ module.exports = {
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
@ -193,4 +196,3 @@ module.exports = {
'array-bracket-spacing': [2, 'never']
}
}

11
.gitignore vendored

@ -4,8 +4,11 @@ dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
yarn.lock
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
@ -14,3 +17,7 @@ yarn.lock
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
yarn.lock

10
.postcssrc.js

@ -1,10 +0,0 @@
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}

2
.travis.yml

@ -1,5 +1,5 @@
language: node_js
node_js: stable
node_js: 10
script: npm run test
notifications:
email: false

2
LICENSE

@ -176,7 +176,7 @@ recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
Copyright 2018 Elune
Copyright 2019 Zheng Jie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

6
README.md

@ -147,6 +147,12 @@ yshop基于当前流行技术组合的前后端分离商城系统: SpringBoot2
- 2.订单新增快递查询
- 1.4.3版本,后台图标更新,后台模块重新拆分,物流快递单独管理,导出最新sql
- 1.4.4版本,新增模板消息通知、H5端商家管理发货修改及其列表时间显示修复
- yshop1.7 发布更新如下:
- 1.后台升級eladmin2.4(前端,后台权限,代码生成器等重构,新增服务器监控等)
- 2.修复商品分类一些问题
- 3.修复redis缓存问题
- 4.修复菜单控制台报error问题
#### 反馈交流

11
babel.config.js

@ -0,0 +1,11 @@
const plugins = ['@vue/babel-plugin-transform-vue-jsx']
// 生产环境移除console
if (process.env.NODE_ENV === 'production') {
plugins.push('transform-remove-console')
}
module.exports = {
plugins: plugins,
presets: [
'@vue/app'
]
}

67
build/build.js

@ -1,67 +0,0 @@
'use strict'
require('./check-versions')()
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
var connect = require('connect')
var serveStatic = require('serve-static')
const spinner = ora(
'building for ' + process.env.env_config + ' environment...'
)
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(
stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n'
)
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(
chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
" Opening index.html over file:// won't work.\n"
)
)
if (process.env.npm_config_preview) {
const port = 9526
const host = 'http://localhost:' + port
const basePath = config.build.assetsPublicPath
const app = connect()
app.use(
basePath,
serveStatic('./dist', {
index: ['index.html', '/']
})
)
app.listen(port, function() {
console.log(
chalk.green(`> Listening at http://localhost:${port}${basePath}`)
)
})
}
})
})

62
build/check-versions.js

@ -1,62 +0,0 @@
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
function exec(cmd) {
return require('child_process')
.execSync(cmd)
.toString()
.trim()
}
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}
module.exports = function() {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(
mod.name +
': ' +
chalk.red(mod.currentVersion) +
' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(
chalk.yellow(
'To use this template, you must update following to modules:'
)
)
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
process.exit(1)
}
}

108
build/utils.js

@ -1,108 +0,0 @@
'use strict'
const path = require('path')
const config = require('../config')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const packageConfig = require('../package.json')
exports.assetsPath = function(_path) {
const assetsSubDirectory =
process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function(options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders(loader, loaderOptions) {
const loaders = []
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
loaders.push(MiniCssExtractPlugin.loader)
} else {
loaders.push('vue-style-loader')
}
loaders.push(cssLoader)
if (options.usePostCSS) {
loaders.push(postcssLoader)
}
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
return loaders
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', {
indentedSyntax: true
}),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function(options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}

5
build/vue-loader.conf.js

@ -1,5 +0,0 @@
'use strict'
module.exports = {
//You can set the vue-loader configuration by yourself.
}

122
build/webpack.base.conf.js

@ -1,122 +0,0 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const { VueLoaderPlugin } = require('vue-loader')
const os = require('os');
const HappyPack = require('happypack');
const happThreadPool = HappyPack.ThreadPool({size: os.cpus().length});
function resolve(dir) {
return path.join(__dirname, '..', dir)
}
const createLintingRule = () => ({
// test: /\.(js|vue)$/,
// loader: 'eslint-loader',
// enforce: 'pre',
// include: [resolve('src'), resolve('test')],
// options: {
// formatter: require('eslint-friendly-formatter'),
// emitWarning: !config.dev.showEslintErrorsInOverlay
// }
})
module.exports = {
cache: true,
context: path.resolve(__dirname, '../'),
entry:["babel-polyfill","./src/main.js"],
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath:
process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
modules: [path.resolve(__dirname, '../node_modules')],
extensions: ['.js', '.vue', '.json'],
alias: {
'@': resolve('src'),
api: path.resolve(__dirname, '../src/api')
}
},
module: {
rules: [
...(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
js: 'happypack/loader?id=js' // 将loader换成happypack
}
}
},
{
test: /\.js$/,
loader: ['happypack/loader?id=js'], // 将loader换成happypack
include: [
resolve('src')
], // src是项目开发的目录
exclude: [path.resolve('../node_modules')] // 不需要编译node_modules下的js
},
{
test: /\.svg$/,
loader: 'svg-sprite-loader',
include: [resolve('src/icons')],
options: {
symbolId: 'icon-[name]'
}
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
exclude: [resolve('src/icons')],
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
plugins: [
new VueLoaderPlugin(),
new HappyPack({
id: 'js',
cache: true,
loaders: ['babel-loader?cacheDirectory=true'],
threadPool: happThreadPool
})
],
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}

98
build/webpack.dev.conf.js

@ -1,98 +0,0 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
function resolve(dir) {
return path.join(__dirname, '..', dir)
}
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
const devWebpackConfig = merge(baseWebpackConfig, {
mode: 'development',
module: {
rules: utils.styleLoaders({
sourceMap: config.dev.cssSourceMap,
usePostCSS: true
})
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
devServer: {
clientLogLevel: 'warning',
historyApiFallback: true,
hot: true,
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true,
favicon: resolve('favicon.ico'),
title: 'vue-element-admin',
templateParameters: {
BASE_URL: config.dev.assetsPublicPath + config.dev.assetsSubDirectory,
},
}),
]
})
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(
new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [
`Your application is running here: http://${
devWebpackConfig.devServer.host
}:${port}`
]
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
: undefined
})
)
resolve(devWebpackConfig)
}
})
})

188
build/webpack.prod.conf.js

@ -1,188 +0,0 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
function resolve(dir) {
return path.join(__dirname, '..', dir)
}
const env = require('../config/' + process.env.env_config + '.env')
// For NamedChunksPlugin
const seen = new Set()
const nameLength = 4
const webpackConfig = merge(baseWebpackConfig, {
mode: 'production',
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash:8].js'),
chunkFilename: utils.assetsPath('js/[name].[chunkhash:8].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
// extract css into its own file
new MiniCssExtractPlugin({
filename: utils.assetsPath('css/[name].[contenthash:8].css'),
chunkFilename: utils.assetsPath('css/[name].[contenthash:8].css')
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
favicon: resolve('favicon.ico'),
title: 'vue-element-admin',
templateParameters: {
BASE_URL: config.build.assetsPublicPath + config.build.assetsSubDirectory,
},
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
}
// default sort mode uses toposort which cannot handle cyclic deps
// in certain cases, and in webpack 4, chunk order in HTML doesn't
// matter anyway
}),
new ScriptExtHtmlWebpackPlugin({
//`runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}),
// keep chunk.id stable when chunk has no name
new webpack.NamedChunksPlugin(chunk => {
if (chunk.name) {
return chunk.name
}
const modules = Array.from(chunk.modulesIterable)
if (modules.length > 1) {
const hash = require('hash-sum')
const joinedHash = hash(modules.map(m => m.id).join('_'))
let len = nameLength
while (seen.has(joinedHash.substr(0, len))) len++
seen.add(joinedHash.substr(0, len))
return `chunk-${joinedHash.substr(0, len)}`
} else {
return modules[0].id
}
}),
// keep module.id stable when vender modules does not change
new webpack.HashedModuleIdsPlugin(),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
],
optimization: {
splitChunks: {
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // 只打包初始时依赖的第三方
},
elementUI: {
name: 'chunk-elementUI', // 单独将 elementUI 拆包
priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
test: /[\\/]node_modules[\\/]element-ui[\\/]/
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // 可自定义拓展你的规则
minChunks: 3, // 最小公用次数
priority: 5,
reuseExistingChunk: true
}
}
},
runtimeChunk: 'single',
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
mangle: {
safari10: true
}
},
sourceMap: config.build.productionSourceMap,
cache: true,
parallel: true
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSAssetsPlugin()
]
}
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' + config.build.productionGzipExtensions.join('|') + ')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.generateAnalyzerReport || config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin
if (config.build.bundleAnalyzerReport) {
webpackConfig.plugins.push(
new BundleAnalyzerPlugin({
analyzerPort: 8080,
generateStatsFile: false
})
)
}
if (config.build.generateAnalyzerReport) {
webpackConfig.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: 'bundle-report.html',
openAnalyzer: false
})
)
}
}
module.exports = webpackConfig

9
config/dev.env.js

@ -1,9 +0,0 @@
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://localhost:8000"'
//BASE_API: '"https://yshopapi.dayouqiantu.cn"'
})

106
config/index.js

@ -1,106 +0,0 @@
'use strict'
// Template version: 1.2.6
const devEnv = require('./dev.env')
// 获取接口地址
const base_url = devEnv.BASE_API.replace(/"/g,'')
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
// 配置代理
proxyTable: {
'/auth': {
// 测试环境
target: base_url,
secure: true,
changeOrigin: true,
pathRewrite: {
'^/auth': 'auth'
}
},
'/api': {
// 测试环境
target: base_url,
secure: true,
changeOrigin: true,
pathRewrite: {
'^/api': 'api'
}
}
},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8013, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true,
errorOverlay: true,
notifyOnErrors: false,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-source-map',
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
/**
* You can set by youself according to actual condition
* You will need to set this if you plan to deploy your site under a sub path,
* for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/,
* then assetsPublicPath should be set to "/bar/".
* In most cases please use '/' !!!
*/
assetsPublicPath: '/',
/**
* Source Maps
*/
productionSourceMap: false,
// https://webpack.js.org/configuration/devtool/#production
devtool: 'source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report || false,
// `npm run build:prod --generate_report`
generateAnalyzerReport: process.env.npm_config_generate_report || false
}
}

5
config/prod.env.js

@ -1,5 +0,0 @@
'use strict'
module.exports = {
NODE_ENV: '"production"',
BASE_API: '"https://yshopapi.dayouqiantu.cn"'
}

1
debug.log

@ -1 +0,0 @@
[1110/193651.524:ERROR:crashpad_client_win.cc(491)] CreateProcess: 页面文件太小,无法完成操作。 (0x5AF)

22
index.html

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<style>
.sampleContainer{position:fixed;top:50%;left:50%;-webkit-transform:translateX(-50%) translateY(-50%);width:75px;height:100px}.loader{position:relative;width:44px;height:8px;margin:12px auto}.dot{display:inline-block;width:8px;height:8px;border-radius:4px;background:#ccc;position:absolute}.dot_1{animation:animateDot1 1.5s linear infinite;left:12px;background:#e579b8}.dot_2{animation:animateDot2 1.5s linear infinite;animation-delay:.5s;left:24px}.dot_3{animation:animateDot3 1.5s linear infinite;left:12px}.dot_4{animation:animateDot4 1.5s linear infinite;animation-delay:.5s;left:24px}@keyframes animateDot1{0%{transform:rotate(0) translateX(-12px)}25%{transform:rotate(180deg) translateX(-12px)}75%{transform:rotate(180deg) translateX(-12px)}100%{transform:rotate(360deg) translateX(-12px)}}@keyframes animateDot2{0%{transform:rotate(0) translateX(-12px)}25%{transform:rotate(-180deg) translateX(-12px)}75%{transform:rotate(-180deg) translateX(-12px)}100%{transform:rotate(-360deg) translateX(-12px)}}@keyframes animateDot3{0%{transform:rotate(0) translateX(12px)}25%{transform:rotate(180deg) translateX(12px)}75%{transform:rotate(180deg) translateX(12px)}100%{transform:rotate(360deg) translateX(12px)}}@keyframes animateDot4{0%{transform:rotate(0) translateX(12px)}25%{transform:rotate(-180deg) translateX(12px)}75%{transform:rotate(-180deg) translateX(12px)}100%{transform:rotate(-360deg) translateX(12px)}}
</style>
</head>
<body>
<div id="app">
<div class="sampleContainer">
<div class="loader">
<span class="dot dot_1"></span>
<span class="dot dot_2"></span>
<span class="dot dot_3"></span>
<span class="dot dot_4"></span>
</div>
</div>
</div>
</body>
</html>

24
jest.config.js

@ -0,0 +1,24 @@
module.exports = {
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest'
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
snapshotSerializers: ['jest-serializer-vue'],
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
],
collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
coverageDirectory: '<rootDir>/tests/unit/coverage',
// 'collectCoverage': true,
'coverageReporters': [
'lcov',
'text-summary'
],
testURL: 'http://localhost/'
}

146
package.json

@ -1,30 +1,49 @@
{
"name": "YSHOP",
"version": "2.2.0",
"name": "yshop-web",
"version": "2.4.0",
"description": "yshop 前端源码",
"author": "Zheng Jie",
"license": "Apache-2.0",
"description": "YSHOP 前端代码",
"author": "hupeng <610796224@qq.com>",
"scripts": {
"dev": "cross-env BABEL_ENV=development webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"build": "cross-env NODE_ENV=production env_config=prod node build/build.js",
"lint": "eslint --ext .js,.vue src",
"test": "npm run lint",
"precommit": "lint-staged",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --fix --ext .js,.vue src",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"svgo": "svgo -f src/assets/icons/svg --config=src/assets/icons/svgo.yml",
"new": "plop"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"repository": {
"type": "git",
"url": "https://github.com/elunez/eladmin-qd"
"url": "https://gitee.com/guchengwuyue/yshopmall"
},
"bugs": {
"url": "https://gitee.com/guchengwuyue/yshopmall/issues"
},
"dependencies": {
"@riophae/vue-treeselect": "0.0.38",
"axios": "^0.19.0",
"clipboard": "1.7.1",
"codemirror": "^5.38.0",
"@riophae/vue-treeselect": "0.1.0",
"axios": "0.18.1",
"clipboard": "2.0.4",
"codemirror": "^5.49.2",
"connect": "3.6.6",
"echarts": "4.1.0",
"echarts": "4.2.1",
"echarts-gl": "^1.1.1",
"echarts-wordcloud": "^1.1.3",
"element-ui": "^2.12.0",
"file-saver": "1.3.8",
"fuse.js": "3.4.4",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"jszip": "3.1.5",
@ -32,75 +51,56 @@
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"screenfull": "3.3.3",
"vue": "2.5.17",
"qs": "^6.9.1",
"screenfull": "4.2.0",
"vue": "2.6.10",
"vue-count-to": "1.0.13",
"vue-router": "3.1.3",
"vuex": "3.0.1",
"vue-cropper": "0.4.9",
"vue-highlightjs": "^1.3.3",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vuex": "3.1.0",
"wangeditor": ">=3.0.0",
"xlsx": "^0.11.16"
},
"devDependencies": {
"autoprefixer": "8.5.0",
"babel-core": "6.26.3",
"@babel/core": "7.0.0",
"@babel/register": "7.0.0",
"@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-eslint": "3.5.1",
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "8.2.6",
"babel-helper-vue-jsx-merge-props": "2.0.3",
"babel-loader": "7.1.5",
"babel-plugin-dynamic-import-node": "2.0.0",
"babel-plugin-syntax-jsx": "6.18.0",
"babel-plugin-transform-runtime": "6.23.0",
"babel-plugin-transform-vue-jsx": "3.7.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "1.7.0",
"babel-preset-stage-2": "6.24.1",
"chalk": "2.4.1",
"copy-webpack-plugin": "4.5.2",
"cross-env": "5.2.0",
"css-loader": "1.0.0",
"eslint": "4.19.1",
"eslint-friendly-formatter": "4.0.1",
"eslint-loader": "2.0.0",
"eslint-plugin-vue": "4.7.1",
"eventsource-polyfill": "0.9.6",
"file-loader": "1.1.11",
"friendly-errors-webpack-plugin": "1.7.0",
"happypack": "^5.0.1",
"html-webpack-plugin": "4.0.0-alpha",
"mini-css-extract-plugin": "0.4.1",
"node-notifier": "5.2.1",
"node-sass": "^4.7.2",
"optimize-css-assets-webpack-plugin": "5.0.0",
"ora": "3.0.0",
"portfinder": "1.0.16",
"postcss-import": "12.0.0",
"postcss-loader": "2.1.6",
"postcss-url": "7.3.2",
"rimraf": "2.6.2",
"sass-loader": "7.0.3",
"script-ext-html-webpack-plugin": "2.0.1",
"babel-jest": "23.6.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"chalk": "2.4.2",
"chokidar": "2.1.5",
"connect": "3.6.6",
"eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2",
"html-webpack-plugin": "3.2.0",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"node-sass": "^4.13.0",
"plop": "2.3.0",
"runjs": "^4.3.2",
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
"semver": "5.5.0",
"shelljs": "^0.8.3",
"svg-sprite-loader": "3.8.0",
"svgo": "1.2.2",
"uglifyjs-webpack-plugin": "1.2.7",
"url-loader": "1.0.1",
"vue-loader": "15.3.0",
"vue-style-loader": "4.1.2",
"vue-template-compiler": "2.5.17",
"webpack": "4.16.5",
"webpack-bundle-analyzer": "3.3.2",
"webpack-cli": "3.1.0",
"webpack-dev-server": "3.3.1",
"webpack-merge": "4.1.4"
"serve-static": "^1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"vue-template-compiler": "2.6.10"
},
"engines": {
"node": ">= 6.0.0",
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
"last 2 versions"
]
}

7
plopfile.js

@ -0,0 +1,7 @@
const viewGenerator = require('./plop-templates/view/prompt')
const componentGenerator = require('./plop-templates/component/prompt')
module.exports = function(plop) {
plop.setGenerator('view', viewGenerator)
plop.setGenerator('component', componentGenerator)
}

5
postcss.config.js

@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}

0
favicon.ico → public/favicon.ico

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

15
public/index.html

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

2
src/App.vue

@ -1,6 +1,6 @@
<template>
<div id="app">
<router-view/>
<router-view />
</div>
</template>

12
src/api/data.js

@ -1,9 +1,17 @@
import request from '@/utils/request'
import qs from 'qs'
export function initData(url, params) {
return request({
url: url,
url: url + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export function download(url, params) {
return request({
url: url + '?' + qs.stringify(params, { indices: false }),
method: 'get',
params
responseType: 'blob'
})
}

9
src/api/generator.js

@ -1,9 +0,0 @@
import request from '@/utils/request'
export function generator(data, tableName) {
return request({
url: 'api/generator?tableName=' + tableName,
data,
method: 'post'
})
}

4
src/api/genConfig.js → src/api/generator/genConfig.js

@ -1,8 +1,8 @@
import request from '@/utils/request'
export function get() {
export function get(tableName) {
return request({
url: 'api/genConfig',
url: 'api/genConfig/' + tableName,
method: 'get'
})
}

33
src/api/generator/generator.js

@ -0,0 +1,33 @@
import request from '@/utils/request'
export function getAllTable() {
return request({
url: 'api/generator/tables/all',
method: 'get'
})
}
export function generator(tableName, type) {
return request({
url: 'api/generator/' + tableName + '/' + type,
method: 'post',
responseType: type === 2 ? 'blob' : ''
})
}
export function save(data) {
return request({
url: 'api/generator',
data,
method: 'put'
})
}
export function sync(tables) {
return request({
url: 'api/generator/sync',
method: 'post',
data: tables
})
}

8
src/api/log.js

@ -1,8 +0,0 @@
import request from '@/utils/request'
export function getErrDetail(id) {
return request({
url: 'api/logs/error/' + id,
method: 'get'
})
}

9
src/api/login.js

@ -22,7 +22,14 @@ export function getInfo() {
export function getCodeImg() {
return request({
url: 'auth/vCode',
url: 'auth/code',
method: 'get'
})
}
export function logout() {
return request({
url: 'auth/logout',
method: 'delete'
})
}

22
src/api/redis.js → src/api/mnt/app.js

@ -2,34 +2,26 @@ import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/redis',
url: 'api/app',
method: 'post',
data
})
}
export function del(key) {
const data = {
key
}
export function del(ids) {
return request({
url: 'api/redis/',
url: 'api/app',
method: 'delete',
data
})
}
export function delAll() {
return request({
url: 'api/redis/all',
method: 'delete'
data: ids
})
}
export function edit(data) {
return request({
url: 'api/redis',
url: 'api/app',
method: 'put',
data
})
}
export default { add, edit, del }

17
src/api/mnt/connect.js

@ -0,0 +1,17 @@
import request from '@/utils/request'
export function testDbConnect(data) {
return request({
url: 'api/database/testConnect',
method: 'post',
data
})
}
export function testServerConnect(data) {
return request({
url: 'api/serverDeploy/testConnect',
method: 'post',
data
})
}

35
src/api/mnt/database.js

@ -0,0 +1,35 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/database',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/database',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/database',
method: 'put',
data
})
}
export function testDbConnection(data) {
return request({
url: 'api/database/testConnect',
method: 'post',
data
})
}
export default { add, edit, del, testDbConnection }

77
src/api/mnt/deploy.js

@ -0,0 +1,77 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/deploy',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/deploy',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/deploy',
method: 'put',
data
})
}
export function getApps() {
return request({
url: 'api/app',
method: 'get'
})
}
export function getServers() {
return request({
url: 'api/serverDeploy',
method: 'get'
})
}
/**
* 启动服务
* @param data 选中行
*/
export function startServer(data) {
return request({
url: 'api/deploy/startServer',
method: 'post',
data
})
}
/**
* 停止服务
* @param data 选中行
*/
export function stopServer(data) {
return request({
url: 'api/deploy/stopServer',
method: 'post',
data
})
}
/**
* 停止服务
* @param data 选中行
*/
export function serverStatus(data) {
return request({
url: 'api/deploy/serverStatus',
method: 'post',
data
})
}
export default { add, edit, del, stopServer, serverStatus, startServer, getServers, getApps }

21
src/api/mnt/deployHistory.js

@ -0,0 +1,21 @@
import request from '@/utils/request'
export function del(ids) {
return request({
url: 'api/deployHistory',
method: 'delete',
data: ids
})
}
/**
* 版本回退
* @param data 选中行
*/
export function reducte(data) {
return request({
url: 'api/deploy/serverReduction',
method: 'post',
data
})
}

27
src/api/mnt/serverDeploy.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/serverDeploy',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/serverDeploy',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/serverDeploy',
method: 'put',
data
})
}
export default { add, edit, del }

22
src/api/monitor/log.js

@ -0,0 +1,22 @@
import request from '@/utils/request'
export function getErrDetail(id) {
return request({
url: 'api/logs/error/' + id,
method: 'get'
})
}
export function delAllError() {
return request({
url: 'api/logs/del/error',
method: 'delete'
})
}
export function delAllInfo() {
return request({
url: 'api/logs/del/info',
method: 'delete'
})
}

9
src/api/monitor/online.js

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function del(keys) {
return request({
url: 'auth/online',
method: 'delete',
data: keys
})
}

27
src/api/monitor/server.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/server',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/server',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/server',
method: 'put',
data
})
}
export default { add, edit, del }

22
src/api/monitor/visits.js

@ -0,0 +1,22 @@
import request from '@/utils/request'
export function count() {
return request({
url: 'api/visits',
method: 'post'
})
}
export function get() {
return request({
url: 'api/visits',
method: 'get'
})
}
export function getChartData() {
return request({
url: 'api/visits/chartData',
method: 'get'
})
}

16
src/api/picture.js

@ -1,16 +0,0 @@
import request from '@/utils/request'
export function del(id) {
return request({
url: 'api/pictures/' + id,
method: 'delete'
})
}
export function delAll(ids) {
return request({
url: 'api/pictures/',
method: 'delete',
data: ids
})
}

0
src/api/code.js → src/api/system/code.js

9
src/api/dept.js → src/api/system/dept.js

@ -16,10 +16,11 @@ export function add(data) {
})
}
export function del(id) {
export function del(ids) {
return request({
url: 'api/dept/' + id,
method: 'delete'
url: 'api/dept',
method: 'delete',
data: ids
})
}
@ -30,3 +31,5 @@ export function edit(data) {
data
})
}
export default { add, edit, del, getDepts }

9
src/api/dict.js → src/api/system/dict.js

@ -1,5 +1,12 @@
import request from '@/utils/request'
export function getDicts() {
return request({
url: 'api/dict/all',
method: 'get'
})
}
export function add(data) {
return request({
url: 'api/dict',
@ -22,3 +29,5 @@ export function edit(data) {
data
})
}
export default { add, edit, del }

2
src/api/dictDetail.js → src/api/system/dictDetail.js

@ -48,3 +48,5 @@ export function edit(data) {
data
})
}
export default { add, edit, del }

9
src/api/job.js → src/api/system/job.js

@ -21,10 +21,11 @@ export function add(data) {
})
}
export function del(id) {
export function del(ids) {
return request({
url: 'api/job/' + id,
method: 'delete'
url: 'api/job',
method: 'delete',
data: ids
})
}
@ -35,3 +36,5 @@ export function edit(data) {
data
})
}
export default { add, edit, del }

10
src/api/menu.js → src/api/system/menu.js

@ -1,6 +1,5 @@
import request from '@/utils/request'
// 获取所有的菜单树
export function getMenusTree() {
return request({
url: 'api/menus/tree',
@ -23,10 +22,11 @@ export function add(data) {
})
}
export function del(id) {
export function del(ids) {
return request({
url: 'api/menus/' + id,
method: 'delete'
url: 'api/menus',
method: 'delete',
data: ids
})
}
@ -37,3 +37,5 @@ export function edit(data) {
data
})
}
export default { add, edit, del, getMenusTree }

17
src/api/role.js → src/api/system/role.js

@ -30,10 +30,11 @@ export function getLevel() {
})
}
export function del(id) {
export function del(ids) {
return request({
url: 'api/roles/' + id,
method: 'delete'
url: 'api/roles',
method: 'delete',
data: ids
})
}
@ -45,14 +46,6 @@ export function edit(data) {
})
}
export function editPermission(data) {
return request({
url: 'api/roles/permission',
method: 'put',
data
})
}
export function editMenu(data) {
return request({
url: 'api/roles/menu',
@ -60,3 +53,5 @@ export function editMenu(data) {
data
})
}
export default { add, edit, del, get, editMenu, getLevel }

9
src/api/timing.js → src/api/system/timing.js

@ -8,10 +8,11 @@ export function add(data) {
})
}
export function del(id) {
export function del(ids) {
return request({
url: 'api/jobs/' + id,
method: 'delete'
url: 'api/jobs',
method: 'delete',
data: ids
})
}
@ -36,3 +37,5 @@ export function execution(id) {
method: 'put'
})
}
export default { del, updateIsPause, execution, add, edit }

35
src/api/user.js → src/api/system/user.js

@ -1,4 +1,5 @@
import request from '@/utils/request'
import { encrypt } from '@/utils/rsaEncrypt'
export function add(data) {
return request({
@ -7,24 +8,26 @@ export function add(data) {
data
})
}
export function downloadUser() {
export function del(ids) {
return request({
url: 'api/users/download',
method: 'get',
responseType: 'blob'
url: 'api/users',
method: 'delete',
data: ids
})
}
export function del(id) {
export function edit(data) {
return request({
url: 'api/users/' + id,
method: 'delete'
url: 'api/users',
method: 'put',
data
})
}
export function edit(data) {
export function editUser(data) {
return request({
url: 'api/users',
url: 'api/users/center',
method: 'put',
data
})
@ -32,8 +35,8 @@ export function edit(data) {
export function updatePass(user) {
const data = {
oldPass: user.oldPass,
newPass: user.newPass
oldPass: encrypt(user.oldPass),
newPass: encrypt(user.newPass)
}
return request({
url: 'api/users/updatePass/',
@ -42,11 +45,17 @@ export function updatePass(user) {
})
}
export function updateEmail(code, data) {
export function updateEmail(form) {
const data = {
password: encrypt(form.pass),
email: form.email
}
return request({
url: 'api/users/updateEmail/' + code,
url: 'api/users/updateEmail/' + form.code,
method: 'post',
data
})
}
export default { add, edit, del }

0
src/api/alipay.js → src/api/tools/alipay.js

0
src/api/email.js → src/api/tools/email.js

11
src/api/localStorage.js → src/api/tools/localStorage.js

@ -8,14 +8,7 @@ export function add(data) {
})
}
export function del(id) {
return request({
url: 'api/localStorage/' + id,
method: 'delete'
})
}
export function delAll(ids) {
export function del(ids) {
return request({
url: 'api/localStorage/',
method: 'delete',
@ -30,3 +23,5 @@ export function edit(data) {
data
})
}
export default { add, edit, del }

18
src/api/tools/picture.js

@ -0,0 +1,18 @@
import request from '@/utils/request'
export function del(ids) {
return request({
url: 'api/pictures',
method: 'delete',
data: ids
})
}
export function sync() {
return request({
url: 'api/pictures/synchronize',
method: 'post'
})
}
export default { del, sync }

17
src/api/qiniu.js → src/api/tools/qiniu.js

@ -2,26 +2,19 @@ import request from '@/utils/request'
export function get() {
return request({
url: 'api/qiNiuConfig',
url: 'api/qiNiuContent/config',
method: 'get'
})
}
export function update(data) {
return request({
url: 'api/qiNiuConfig',
url: 'api/qiNiuContent/config',
data,
method: 'put'
})
}
export function del(id) {
return request({
url: 'api/qiNiuContent/' + id,
method: 'delete'
})
}
export function download(id) {
return request({
url: 'api/qiNiuContent/download/' + id,
@ -36,10 +29,12 @@ export function sync() {
})
}
export function delAll(ids) {
export function del(ids) {
return request({
url: 'api/qiNiuContent/',
url: 'api/qiNiuContent',
method: 'delete',
data: ids
})
}
export default { del, download, sync }

1
src/api/visits.js

@ -21,7 +21,6 @@ export function getChartData() {
})
}
export function gett() {
return request({
url: 'api/data/count',

2
src/api/yxCache.js

@ -26,6 +26,6 @@ export function edit(data) {
export function get() {
return request({
url: 'api/yxCache',
method: 'get',
method: 'get'
})
}

1
src/api/yxExpress.js

@ -23,4 +23,3 @@ export function edit(data) {
})
}

14
src/api/permission.js → src/api/yxStoreBargainUser.js

@ -1,16 +1,8 @@
import request from '@/utils/request'
// 获取所有的权限树
export function getPermissionTree() {
return request({
url: 'api/permissions/tree',
method: 'get'
})
}
export function add(data) {
return request({
url: 'api/permissions',
url: 'api/yxStoreBargainUser',
method: 'post',
data
})
@ -18,14 +10,14 @@ export function add(data) {
export function del(id) {
return request({
url: 'api/permissions/' + id,
url: 'api/yxStoreBargainUser/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/permissions',
url: 'api/yxStoreBargainUser',
method: 'put',
data
})

2
src/api/yxStoreCategory.js

@ -30,3 +30,5 @@ export function edit(data) {
data
})
}
export default { add, edit, del, getCates }

18
src/api/yxStoreOrder.js

@ -31,25 +31,9 @@ export function refund(data) {
})
}
export function editOrder(data) {
return request({
url: 'api/yxStoreOrder/edit',
method: 'post',
data
})
}
export function remark(data) {
return request({
url: 'api/yxStoreOrder/remark',
method: 'post',
data
})
}
export function get() {
return request({
url: 'api/yxExpress',
method: 'get',
method: 'get'
})
}

10
src/api/yxStoreProduct.js

@ -38,7 +38,7 @@ export function recovery(id) {
})
}
export function isFormatAttr(id,data) {
export function isFormatAttr(id, data) {
return request({
url: 'api/yxStoreProduct/isFormatAttr/' + id,
method: 'post',
@ -46,7 +46,7 @@ export function isFormatAttr(id,data) {
})
}
export function setAttr(id,data) {
export function setAttr(id, data) {
return request({
url: 'api/yxStoreProduct/setAttr/' + id,
method: 'post',
@ -54,19 +54,17 @@ export function setAttr(id,data) {
})
}
export function clearAttr(id) {
return request({
url: 'api/yxStoreProduct/clearAttr/' + id,
method: 'post',
method: 'post'
})
}
export function getAttr(id) {
return request({
url: 'api/yxStoreProduct/attr/' + id,
method: 'get',
method: 'get'
})
}

2
src/api/yxSystemConfig.js

@ -26,7 +26,7 @@ export function edit(data) {
export function get() {
return request({
url: 'api/yxSystemConfig?size=50',
method: 'get',
method: 'get'
})
}

2
src/api/yxWechatReply.js

@ -26,7 +26,7 @@ export function edit(data) {
export function get() {
return request({
url: 'api/yxWechatReply',
method: 'get',
method: 'get'
})
}

2
src/api/yxWechatTemplate.js

@ -26,7 +26,7 @@ export function edit(data) {
export function get() {
return request({
url: 'api/yxWechatTemplate',
method: 'get',
method: 'get'
})
}

BIN
src/assets/avatar/avatar.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

4
src/icons/index.js → src/assets/icons/index.js

@ -1,9 +1,9 @@
import Vue from 'vue'
import SvgIcon from '@/components/SvgIcon' // svg组件
import SvgIcon from '@/components/SvgIcon'// svg component
// register globally
Vue.component('svg-icon', SvgIcon)
const requireAll = requireContext => requireContext.keys().map(requireContext)
const req = require.context('./svg', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys().map(requireContext)
requireAll(req)

0
src/icons/svg/Sign.svg → src/assets/icons/svg/Sign.svg

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

0
src/icons/svg/Steve-Jobs.svg → src/assets/icons/svg/Steve-Jobs.svg

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

0
src/icons/svg/add.svg → src/assets/icons/svg/add.svg

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

0
src/icons/svg/alipay.svg → src/assets/icons/svg/alipay.svg

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

0
src/icons/svg/anq.svg → src/assets/icons/svg/anq.svg

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

1
src/assets/icons/svg/app.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574649142168" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1910" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M468.693333 16.725333a85.333333 85.333333 0 0 1 82.56 0l381.952 211.072a85.333333 85.333333 0 0 1 44.074667 74.666667v419.029333a85.333333 85.333333 0 0 1-44.074667 74.666667l-381.952 211.114667a85.333333 85.333333 0 0 1-82.56 0l-381.952-211.072A85.333333 85.333333 0 0 1 42.666667 721.493333V302.506667a85.333333 85.333333 0 0 1 44.074666-74.666667L468.693333 16.682667z m423.253334 285.781334l-381.994667-211.072L128 302.506667v418.986666l381.952 211.072 381.994667-211.072V302.506667z m-684.714667 42.197333a42.666667 42.666667 0 0 1 57.984-16.725333l244.736 135.253333 244.778667-135.253333a42.666667 42.666667 0 0 1 41.258666 74.666666l-243.370666 134.528v268.16a42.666667 42.666667 0 0 1-85.333334 0V537.173333L223.914667 402.688a42.666667 42.666667 0 0 1-16.682667-58.026667z" fill="#bfbfbf" p-id="1911"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

0
src/icons/svg/article.svg → src/assets/icons/svg/article.svg

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

1
src/assets/icons/svg/backup.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574649191790" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2774" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M646 1024H100A100 100 0 0 1 0 924V258a100 100 0 0 1 100-100h546a100 100 0 0 1 100 100v31a40 40 0 1 1-80 0v-31a20 20 0 0 0-20-20H100a20 20 0 0 0-20 20v666a20 20 0 0 0 20 20h546a20 20 0 0 0 20-20V713a40 40 0 0 1 80 0v211a100 100 0 0 1-100 100z" fill="#cdcdcd" p-id="2775"></path><path d="M924 866H806a40 40 0 0 1 0-80h118a20 20 0 0 0 20-20V100a20 20 0 0 0-20-20H378a20 20 0 0 0-20 20v8a40 40 0 0 1-80 0v-8A100 100 0 0 1 378 0h546a100 100 0 0 1 100 100v666a100 100 0 0 1-100 100z" fill="#cdcdcd" p-id="2776"></path><path d="M469 887a40 40 0 0 1-27-10L152 618a40 40 0 0 1 1-60l290-248a40 40 0 0 1 66 30v128a367 367 0 0 0 241-128l94-111a40 40 0 0 1 70 35l-26 109a430 430 0 0 1-379 332v142a40 40 0 0 1-40 40zM240 589l189 169v-91a40 40 0 0 1 40-40c144 0 269-85 323-214a447 447 0 0 1-323 137 40 40 0 0 1-40-40v-83z" fill="#cdcdcd" p-id="2777"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

0
src/icons/svg/banner.svg → src/assets/icons/svg/banner.svg

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

0
src/icons/svg/bargain.svg → src/assets/icons/svg/bargain.svg

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

0
src/icons/svg/button.svg → src/assets/icons/svg/button.svg

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

0
src/icons/svg/chain.svg → src/assets/icons/svg/chain.svg

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

1
src/assets/icons/svg/chart.svg

@ -0,0 +1 @@
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 54.857h36.571V128H0V54.857zM91.429 27.43H128V128H91.429V27.429zM45.714 0h36.572v128H45.714V0z"/></svg>

After

Width:  |  Height:  |  Size: 179 B

0
src/icons/svg/codeConsole.svg → src/assets/icons/svg/codeConsole.svg

Before

Width:  |  Height:  |  Size: 757 B

After

Width:  |  Height:  |  Size: 757 B

0
src/icons/svg/comment.svg → src/assets/icons/svg/comment.svg

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
src/icons/svg/configure.svg → src/assets/icons/svg/configure.svg

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
src/icons/svg/coupon.svg → src/assets/icons/svg/coupon.svg

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

0
src/icons/svg/coupon2.svg → src/assets/icons/svg/coupon2.svg

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

0
src/icons/svg/index.svg → src/assets/icons/svg/dashboard.svg

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

1
src/assets/icons/svg/database.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574649229600" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3752" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M942 191.9C939.8 128.9 748.1 78 512 78S84.2 128.9 82 191.9V831c0 63.5 192.5 115 430 115s430-51.5 430-115V191.9z m-56.7 393.8c-4.6 3.3-11.6 7.4-21.9 12.2-21.3 9.8-50.5 19.1-84.4 26.8-74 16.8-168.8 26-267 26s-193-9.2-267-26c-33.9-7.7-63.1-16.9-84.4-26.8-10.3-4.8-17.3-8.9-21.9-12.2 0.1-0.1 0.2-0.1 0.3-0.2h-7v-123c72.2 36.4 215.3 61.1 380 61.1s307.8-24.8 380-61.1v122.9h-7l0.3 0.3z m0-177c-4.6 3.3-11.6 7.4-21.9 12.2-21.3 9.8-50.5 19.1-84.4 26.8-74 16.8-168.8 26-267 26s-193-9.2-267-26c-33.9-7.7-63.1-16.9-84.4-26.8-10.3-4.8-17.3-8.9-21.9-12.2 0.1-0.1 0.2-0.1 0.3-0.2h-7V246.9c72.2 36.4 215.3 61.1 380 61.1s307.8-24.8 380-61.1v161.6h-7c0.1 0 0.2 0.1 0.3 0.2zM160.7 180.8C182 171 211.2 161.7 245 154c74-16.8 168.8-26 267-26s193 9.2 267 26c33.9 7.7 63.1 16.9 84.4 26.8 10.3 4.8 17.3 8.9 21.9 12.2-4.6 3.3-11.6 7.4-21.9 12.2C842 215 812.8 224.3 779 232c-74 16.8-168.8 26-267 26s-193-9.2-267-26c-33.9-7.7-63.1-16.9-84.4-26.8-10.3-4.8-17.3-8.9-21.9-12.2 4.7-3.3 11.7-7.4 22-12.2zM885.3 831c-4.6 3.3-11.6 7.4-21.9 12.2C842 853 812.8 862.3 779 870c-74 16.8-168.8 26-267 26s-193-9.2-267-26c-33.9-7.7-63.1-16.9-84.4-26.8-10.3-4.8-17.3-8.9-21.9-12.2 0.1-0.1 0.2-0.1 0.3-0.2h-7V639.5c72.2 36.4 215.3 61.1 380 61.1s307.8-24.8 380-61.1v191.3h-7c0.1 0.1 0.2 0.1 0.3 0.2z" fill="#cdcdcd" p-id="3753"></path></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

0
src/icons/svg/date.svg → src/assets/icons/svg/date.svg

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

0
src/icons/svg/dengji.svg → src/assets/icons/svg/dengji.svg

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

1
src/assets/icons/svg/deploy.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574649300337" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4312" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M877.952 447.616v-0.256a272 272 0 0 0-479.68-175.68 166.144 166.144 0 0 0-226.016 155.296c0 4.768 0.32 9.6 0.704 14.144A196.896 196.896 0 0 0 206.592 832H448v-256H304l208-208 208 208H576v256h241.408a196.96 196.96 0 0 0 60.544-384.384z" fill="#cdcdcd" p-id="4313"></path></svg>

After

Width:  |  Height:  |  Size: 653 B

0
src/icons/svg/dept.svg → src/assets/icons/svg/dept.svg

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

0
src/icons/svg/dev.svg → src/assets/icons/svg/dev.svg

Before

Width:  |  Height:  |  Size: 732 B

After

Width:  |  Height:  |  Size: 732 B

0
src/icons/svg/develop.svg → src/assets/icons/svg/develop.svg

Before

Width:  |  Height:  |  Size: 699 B

After

Width:  |  Height:  |  Size: 699 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save