Skip to content

Commit cb9b38a

Browse files
committed
简单修改
1 parent 9cfda47 commit cb9b38a

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,25 @@ npm run build --report
8282
├── ...
8383
```
8484

85+
## Nginx简单部署配置
86+
```
87+
...
88+
# 以上保持默认配置即可
89+
90+
server {
91+
listen 9090;
92+
server_name localhost;
93+
# 项目文件目录
94+
root html/vue-backend;
95+
index index.html index.htm;
96+
97+
location / {
98+
# vue-router使用history模式下的必须配置
99+
try_files $uri $uri/ /index.html;
100+
index index.html;
101+
}
102+
}
103+
```
104+
85105
## 其他
86106
欢迎反馈及探讨各种问题,同时请注意issue规则

config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
index: path.resolve(__dirname, '../dist/index.html'),
1010
assetsRoot: path.resolve(__dirname, '../dist'),
1111
assetsSubDirectory: 'static',
12-
assetsPublicPath: './',
12+
assetsPublicPath: '/',
1313
productionSourceMap: false,
1414
// Gzip off by default as many popular static hosts such as
1515
// Surge or Netlify already gzip all static assets for you.

src/router/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import Vue from 'vue'
22
import VueRouter from 'vue-router'
3-
import store from '../store'
43
import NProgress from 'nprogress'
54
import 'nprogress/nprogress.css'
5+
import { Message } from 'element-ui'
6+
import Auth from '@/util/auth'
7+
import store from '../store'
68
import staticRoute from './staticRoute'
79
import { asyncLayout, asyncRoute, redirectRoute} from './asyncRoute'
810
import whiteList from './whiteList'
9-
import Auth from '@/util/auth'
10-
import { Message } from 'element-ui'
1111

1212
NProgress.configure({ showSpinner: false });
1313

0 commit comments

Comments
 (0)