部署教程修改

1.配图统一改为项目内图片
2.增加laragon配置
3.增加github第三方登录配置
This commit is contained in:
wangshun
2025-09-03 10:27:57 +08:00
parent c337195b16
commit 67fae4129f
16 changed files with 84 additions and 48 deletions

View File

@@ -18,18 +18,18 @@ cd backend
以IDEA编辑器为例IDEA打开backend文件夹。
- 设置VM Option最好运行在其他端口非8080这里设置8081
- 设置jdk版本为java 17
```shell
-Dserver.port=8081
```
![CleanShot 2025-08-04 at 11.35.49.png](https://openisle-1307107697.cos.accelerate.myqcloud.com/dynamic_assert/4cf210cfc6ea478a80dfc744c85ccdc4.png)
- 设置jdk版本为java 17
![CleanShot 2025-08-04 at 11.38.03@2x.png](https://openisle-1307107697.cos.accelerate.myqcloud.com/dynamic_assert/392eeec753ae436ca12a78f750dfea2d.png)
![配置1](contributing_img\backend_img_3.png)
![配置2](contributing_img\backend_img_2.png)
- 本机配置MySQL服务网上很多教程忽略
+ 可以用Laragon,自带MySQL包括Nodejs,版本建议6.x7以后需要Lisence
+ 下载地址(https://github.com/leokhoa/laragon/releases)
- 设置环境变量.env 文件 或.properties 文件(二选一)
1. 环境变量文件生成
@@ -40,21 +40,24 @@ cp open-isle.env.example open-isle.env
修改环境变量留下需要的比如你要开发Google登录业务就需要谷歌相关的变量数据库是一定要的
![CleanShot 2025-08-04 at 11.41.36@2x.png](https://openisle-1307107697.cos.accelerate.myqcloud.com/dynamic_assert/896c8363b6e64ea19d18c12ec4dae2b4.png)
![环境变量](contributing_img\backend_img_7.png)
应用环境文件, 选择刚刚的`open-isle.env`
![CleanShot 2025-08-04 at 11.44.41.png](https://openisle-1307107697.cos.accelerate.myqcloud.com/dynamic_assert/f588e37838014a6684c141605639b9fa.png)
![环境变量](contributing_img\backend_img_6.png)
2. 直接修改 .properities 文件
1. 直接修改 .properities 文件
位置src/main/application.properties, 数据库需要修改标红处,其他按需修改
![CleanShot 2025-08-04 at 11.47.11@2x.png](https://openisle-1307107697.cos.accelerate.myqcloud.com/dynamic_assert/28c3104448a245419e0b06aee861abb4.png)
![配置数据库](contributing_img\backend_img_5.png)
执行db/init.sql脚本导入基本的数据
![初始化脚本](contributing_img\resources_img.png)
处理完环境问题直接跑起来就能通了
![CleanShot 2025-08-04 at 11.49.01@2x.png](https://openisle-1307107697.cos.accelerate.myqcloud.com/dynamic_assert/2c945eae44b1477db09e80fc96b5e02d.png)
![运行画面](contributing_img\backend_img_4.png)
> Step3 前端部署
@@ -68,46 +71,25 @@ cd ../frontend_nuxt/
copy环境.env文件
利用预发环境
**(⚠️强烈推荐只部署前端的朋友使用该环境)**
```shell
cp .env.staging.example .env
```
1. 依赖本机部署的后端:打开本文件夹,修改.env 修改为瞄准本机后端端口
```yaml
; 本地部署后端
NUXT_PUBLIC_API_BASE_URL=http://127.0.0.1:8081
; 预发环境后端
; NUXT_PUBLIC_API_BASE_URL=https://staging.open-isle.com
; 生产环境后端
; NUXT_PUBLIC_API_BASE_URL=https://www.open-isle.com
; 开发环境
NUXT_PUBLIC_WEBSITE_BASE_URL=localhost:3000
利用生产环境
```shell
cp .env.production.example .env
```
2. 依赖预发环境后台环境
**(⚠️强烈推荐只部署前端的朋友使用该环境)**
```yaml
; 本地部署后端
; NUXT_PUBLIC_API_BASE_URL=https://127.0.0.1:8081
; 预发环境后端
NUXT_PUBLIC_API_BASE_URL=https://staging.open-isle.com
; 生产环境后端
; NUXT_PUBLIC_API_BASE_URL=https://www.open-isle.com
利用本地环境
```shell
cp .env.dev.example .env
```
4. 依赖线上后台环境
```yaml
; 本地部署后端
; NUXT_PUBLIC_API_BASE_URL=https://127.0.0.1:8081
; 预发环境后端
; NUXT_PUBLIC_API_BASE_URL=https://staging.open-isle.com
; 生产环境后端
NUXT_PUBLIC_API_BASE_URL=https://www.open-isle.com
```
前端安装编译运行
```shell
# 安装依赖
@@ -118,3 +100,17 @@ npm run dev
```
如此一来,浏览器访问 http://127.0.0.1:3000 即可访问前端页面
## 其他配置
1. 配置第三方登录
这里以github为例
修改application.properties配置
![后端配置](contributing_img\backend_img.png)
修改.env配置
![前端](contributing_img\fontend_img.png)
配置第三方登录回调地址
![github配置](contributing_img\github_img.png)
![github配置2](contributing_img\github_img_2.png)