Browse Source

配置修改

master
mk 4 months ago
parent
commit
b08ed9b33a
  1. 2
      .env.development
  2. 2
      .env.production
  3. 2
      .env.staging
  4. 2
      .gitignore
  5. 2
      build/index.js
  6. 2
      src/router/index.js
  7. 2
      src/views/login.vue
  8. 6
      vue.config.js

2
.env.development

@ -5,7 +5,7 @@ VUE_APP_TITLE = 人力发展集团管理系统
ENV = 'development' ENV = 'development'
# 人力发展集团管理系统/开发环境 # 人力发展集团管理系统/开发环境
VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = 'http://192.168.1.144:8080/api'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

2
.env.production

@ -5,4 +5,4 @@ VUE_APP_TITLE = 人力发展集团管理系统
ENV = 'production' ENV = 'production'
# 人力发展集团管理系统/生产环境 # 人力发展集团管理系统/生产环境
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = 'http://192.168.1.144:8080/api'

2
.env.staging

@ -7,4 +7,4 @@ NODE_ENV = production
ENV = 'staging' ENV = 'staging'
# 人力发展集团管理系统/测试环境 # 人力发展集团管理系统/测试环境
VUE_APP_BASE_API = '/stage-api' VUE_APP_BASE_API = 'http://192.168.1.144:8088/api'

2
.gitignore

@ -1,6 +1,6 @@
.DS_Store .DS_Store
node_modules/ node_modules/
dist/ epmet-apartment-ui/
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*

2
build/index.js

@ -18,7 +18,7 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
app.use( app.use(
publicPath, publicPath,
serveStatic('./dist', { serveStatic('./epmet-apartment-ui', {
index: ['index.html', '/'] index: ['index.html', '/']
}) })
) )

2
src/router/index.js

@ -177,7 +177,7 @@ Router.prototype.replace = function push(location) {
} }
export default new Router({ export default new Router({
mode: 'history', // 去掉url中的# mode: 'hash',
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes routes: constantRoutes
}) })

2
src/views/login.vue

@ -56,7 +56,7 @@
</el-form> </el-form>
<!-- 底部 --> <!-- 底部 -->
<div class="el-login-footer"> <div class="el-login-footer">
<span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span> <!-- <span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span> -->
</div> </div>
</div> </div>
</template> </template>

6
vue.config.js

@ -18,9 +18,9 @@ module.exports = {
// 部署生产环境和开发环境下的URL。 // 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/", publicPath: process.env.NODE_ENV === "production" ? "/epmet-apartment-ui" : "/",
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: 'dist', outputDir: 'epmet-apartment-ui',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: 'static', assetsDir: 'static',
// 是否开启eslint保存检测,有效值:ture | false | 'error' // 是否开启eslint保存检测,有效值:ture | false | 'error'
@ -35,7 +35,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`, target: `http://192.168.1.144:8088`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save