- . 项目地址 https://gitee.com/zscat/mallplus
- 1.后台springboot 项目 打成jar包
- 2.后台vue项目build为静态文件 npm run build
- 3.uniapp 微信小程序打包 打开hbuildx工具,选择菜单 发行-小程序微信
版,然后在打开的微信小程序开发工具中点击上传
- 4.uniapp h5打包 打开hbuildx工具,选择菜单 发行-网站h5手机版
输出框 项目 'uniapp'导出h5成功,路径为:F:/code/uniapp/unpackage/dist/build/h5 然后
后把生成的h5目录 挂载到nginx,如下图
1. 项目路径,可以改为自己的路径
![输入图片说明](https://images.gitee.com/uploads/images/2019/0705/172515_a0849184_134431.png "QQ图片20190705172439.png")
后台启动命令
nohup java -jar /root/jm/mall-portal-0.0.1-SNAPSHOT.jar >web.log 2>&1 &
nohup java -jar /root/jm/mall-admin-0.0.1-SNAPSHOT.jar >admin.log 2>&1 &
1. nginx配置
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 8090;
server_name 39.106.212.32;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /root/jm/dist;
index index.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 8082;
server_name _;
root /root/jm/h5;
index index.html;
}
}