mjpic 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,6 +41,43 @@ mjpic dev
41
41
  2. 安装依赖:`npm install`
42
42
  3. 启动开发服务器:`npm run dev`
43
43
 
44
+ ## 腾讯云部署
45
+
46
+ 如果需要把网页部署到 `http://westudy.bj.cn/mjpic/` 这样的子路径,请使用带基础路径的构建命令:
47
+
48
+ ```bash
49
+ VITE_BASE_PATH=/mjpic/ npm run build
50
+ ```
51
+
52
+ 如果后端 API 也准备挂到同一路径下,可以显式指定:
53
+
54
+ ```bash
55
+ VITE_BASE_PATH=/mjpic/ VITE_API_BASE=/mjpic/ npm run build
56
+ ```
57
+
58
+ 构建完成后,将 `dist/client/` 上传到服务器,例如:
59
+
60
+ ```bash
61
+ scp -r dist/client/* <user>@<server>:/var/www/mjpic/
62
+ ```
63
+
64
+ Nginx 可参考以下配置:
65
+
66
+ ```nginx
67
+ location /mjpic/ {
68
+ alias /var/www/mjpic/;
69
+ try_files $uri $uri/ /mjpic/index.html;
70
+ }
71
+
72
+ location /mjpic/api/ {
73
+ proxy_pass http://127.0.0.1:3002/api/;
74
+ proxy_set_header Host $host;
75
+ proxy_set_header X-Real-IP $remote_addr;
76
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
77
+ proxy_set_header X-Forwarded-Proto $scheme;
78
+ }
79
+ ```
80
+
44
81
 
45
82
  ## 安装使用
46
83