奇淼(piexlmax
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 588 additions and 467 deletions
-
8server/model/system/sys_user.go
-
8web/.env.development
-
8web/.env.production
-
15web/index.html
-
262web/package-lock.json
-
15web/package.json
-
2web/src/components/customPic/index.vue
-
2web/src/components/dashbordCharts/echartsLine.vue
-
2web/src/components/upload/image.vue
-
11web/src/core/gin-vue-admin.js
-
2web/src/directive/auth.js
-
4web/src/router/index.js
-
26web/src/style/login.scss
-
4web/src/style/newLogin.scss
-
3web/src/utils/_import.js
-
19web/src/utils/asyncRouter.js
-
6web/src/utils/request.js
-
2web/src/view/example/breakpoint/breakpoint.vue
-
2web/src/view/example/excel/excel.vue
-
4web/src/view/example/upload/upload.vue
-
2web/src/view/init/index.vue
-
4web/src/view/layout/aside/asideComponent/index.vue
-
2web/src/view/layout/aside/index.vue
-
14web/src/view/layout/index.vue
-
6web/src/view/person/person.vue
-
6web/src/view/superAdmin/authority/authority.vue
-
2web/src/view/superAdmin/menu/menu.vue
-
8web/src/view/superAdmin/user/user.vue
-
2web/src/view/systemTools/formCreate/index.vue
-
83web/vite.config.js
-
89web/vue.config.js
@ -1,6 +1,6 @@ |
|||||
ENV = 'development' |
ENV = 'development' |
||||
|
|
||||
VUE_APP_CLI_PORT = 8080 |
|
||||
VUE_APP_SERVER_PORT = 8888 |
|
||||
VUE_APP_BASE_API = /api |
|
||||
VUE_APP_BASE_PATH = http://127.0.0.1 |
|
||||
|
VITE_CLI_PORT = 8080 |
||||
|
VITE_SERVER_PORT = 8888 |
||||
|
VITE_BASE_API = /api |
||||
|
VITE_BASE_PATH = http://127.0.0.1 |
@ -1,7 +1,7 @@ |
|||||
ENV = 'production' |
ENV = 'production' |
||||
|
|
||||
VUE_APP_CLI_PORT = 8080 |
|
||||
VUE_APP_SERVER_PORT = 8888 |
|
||||
VUE_APP_BASE_API = /api |
|
||||
|
VITE_CLI_PORT = 8080 |
||||
|
VITE_SERVER_PORT = 8888 |
||||
|
VITE_BASE_API = /api |
||||
#下方修改为你的线上ip |
#下方修改为你的线上ip |
||||
VUE_APP_BASE_PATH = http://8.141.61.63 |
|
||||
|
VITE_BASE_PATH = http://8.141.61.63 |
@ -0,0 +1,15 @@ |
|||||
|
|
||||
|
<!DOCTYPE html> |
||||
|
<html lang="en"> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0"> |
||||
|
<link rel="icon" href="favicon.ico"> |
||||
|
<title></title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div id="app"></div> |
||||
|
<script type="module" src="./src/main.js"></script> |
||||
|
</body> |
||||
|
</html> |
@ -1,3 +0,0 @@ |
|||||
module.exports = file => () => { |
|
||||
return import ('@/' + file) |
|
||||
} |
|
@ -0,0 +1,83 @@ |
|||||
|
/* eslint-disable */ |
||||
|
import legacyPlugin from '@vitejs/plugin-legacy'; |
||||
|
// import usePluginImport from 'vite-plugin-importer';
|
||||
|
import * as path from 'path'; |
||||
|
import * as dotenv from 'dotenv'; |
||||
|
import * as fs from 'fs'; |
||||
|
import vuePlugin from '@vitejs/plugin-vue'; |
||||
|
// @see https://cn.vitejs.dev/config/
|
||||
|
export default ({ |
||||
|
command, |
||||
|
mode |
||||
|
}) => { |
||||
|
let NODE_ENV = process.env.NODE_ENV || 'development' |
||||
|
let envFiles=[ |
||||
|
`.env.${NODE_ENV}` |
||||
|
] |
||||
|
for (const file of envFiles) { |
||||
|
const envConfig = dotenv.parse(fs.readFileSync(file)) |
||||
|
for (const k in envConfig) { |
||||
|
process.env[k] = envConfig[k] |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
let rollupOptions = {}; |
||||
|
|
||||
|
|
||||
|
let optimizeDeps = {}; |
||||
|
|
||||
|
|
||||
|
let alias = { |
||||
|
'@': path.resolve(__dirname, './src'), |
||||
|
'vue$': 'vue/dist/vue.runtime.esm-bundler.js', |
||||
|
} |
||||
|
|
||||
|
let esbuild = {} |
||||
|
|
||||
|
return { |
||||
|
base: './', // index.html文件所在位置
|
||||
|
root: './', // js导入的资源路径,src
|
||||
|
resolve: { |
||||
|
alias, |
||||
|
}, |
||||
|
define: { |
||||
|
'process.env': {} |
||||
|
}, |
||||
|
server: { |
||||
|
open:true, |
||||
|
port: process.env.VITE_CLI_PORT, |
||||
|
proxy:{ |
||||
|
// 把key的路径代理到target位置
|
||||
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
|
[process.env.VITE_BASE_API]: { // 需要代理的路径 例如 '/api'
|
||||
|
target: `${process.env.VITE_BASE_PATH}:${process.env.VITE_SERVER_PORT}/`, // 代理到 目标路径
|
||||
|
changeOrigin: true, |
||||
|
rewrite: path => path.replace(new RegExp('^' + process.env.VITE_BASE_API), ''), |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
build: { |
||||
|
target: 'es2015', |
||||
|
minify: 'terser', // 是否进行压缩,boolean | 'terser' | 'esbuild',默认使用terser
|
||||
|
manifest: false, // 是否产出maifest.json
|
||||
|
sourcemap: false, // 是否产出soucemap.json
|
||||
|
outDir: 'dist', // 产出目录
|
||||
|
rollupOptions, |
||||
|
}, |
||||
|
esbuild, |
||||
|
optimizeDeps, |
||||
|
plugins: [ |
||||
|
legacyPlugin({ |
||||
|
targets: ['Android > 39', 'Chrome >= 60', 'Safari >= 10.1', 'iOS >= 10.3', 'Firefox >= 54', 'Edge >= 15'], |
||||
|
}), vuePlugin(), |
||||
|
], |
||||
|
css: { |
||||
|
preprocessorOptions: { |
||||
|
less: { |
||||
|
// 支持内联 JavaScript
|
||||
|
javascriptEnabled: true, |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
} |
@ -1,89 +0,0 @@ |
|||||
'use strict' |
|
||||
|
|
||||
const path = require('path') |
|
||||
|
|
||||
function resolve(dir) { |
|
||||
return path.join(__dirname, dir) |
|
||||
} |
|
||||
module.exports = { |
|
||||
// 基础配置 详情看文档
|
|
||||
publicPath: './', |
|
||||
outputDir: 'dist', |
|
||||
assetsDir: 'static', |
|
||||
lintOnSave: process.env.NODE_ENV === 'development', |
|
||||
productionSourceMap: false, |
|
||||
devServer: { |
|
||||
port: process.env.VUE_APP_CLI_PORT, |
|
||||
open: true, |
|
||||
overlay: { |
|
||||
warnings: false, |
|
||||
errors: true |
|
||||
}, |
|
||||
proxy: { |
|
||||
// 把key的路径代理到target位置
|
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
|
||||
[process.env.VUE_APP_BASE_API]: { // 需要代理的路径 例如 '/api'
|
|
||||
target: `${process.env.VUE_APP_BASE_PATH}:${process.env.VUE_APP_SERVER_PORT}/`, // 代理到 目标路径
|
|
||||
changeOrigin: true, |
|
||||
pathRewrite: { // 修改路径数据
|
|
||||
['^' + process.env.VUE_APP_BASE_API]: '' // 举例 '^/api:""' 把路径中的/api字符串删除
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
configureWebpack: { |
|
||||
// @路径走src文件夹
|
|
||||
resolve: { |
|
||||
alias: { |
|
||||
'@': resolve('src') |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
chainWebpack(config) { |
|
||||
config |
|
||||
// https://webpack.js.org/configuration/devtool/#development
|
|
||||
.when(process.env.NODE_ENV === 'development', |
|
||||
config => config.devtool('cheap-source-map') |
|
||||
) |
|
||||
|
|
||||
config |
|
||||
.when(process.env.NODE_ENV !== 'development', |
|
||||
config => { |
|
||||
config.plugin('html') |
|
||||
.tap(args => { |
|
||||
args[0].title = 'GIN-VUE-ADMIN' |
|
||||
return args |
|
||||
}) |
|
||||
|
|
||||
config |
|
||||
.plugin('ScriptExtHtmlWebpackPlugin') |
|
||||
.after('html') |
|
||||
.use('script-ext-html-webpack-plugin', [{ |
|
||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
|
||||
inline: /single\..*\.js$/ |
|
||||
}]) |
|
||||
.end() |
|
||||
config |
|
||||
.optimization.splitChunks({ |
|
||||
chunks: 'all', |
|
||||
cacheGroups: { |
|
||||
libs: { |
|
||||
name: 'chunk-libs', |
|
||||
test: /[\\/]node_modules[\\/]/, |
|
||||
priority: 10, |
|
||||
chunks: 'initial' // only package third parties that are initially dependent
|
|
||||
}, |
|
||||
commons: { |
|
||||
name: 'chunk-commons', |
|
||||
test: resolve('src/components'), // can customize your rules
|
|
||||
minChunks: 3, // minimum common number
|
|
||||
priority: 5, |
|
||||
reuseExistingChunk: true |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
config.optimization.runtimeChunk('single') |
|
||||
} |
|
||||
) |
|
||||
} |
|
||||
} |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue