Compare commits

...

2 Commits

Author SHA1 Message Date
bunny af2c9e82f1 📝 修改文档 2025-06-01 22:36:29 +08:00
bunny 62a6ae474e 👷 添加CI/CD 2025-05-29 19:55:41 +08:00
4 changed files with 67 additions and 13 deletions

54
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,54 @@
# 定义CI/CD流水线的阶段
stages:
- build # 第一阶段:构建应用程序
- build-docker # 第二阶段构建Docker镜像
- deploy # 第三阶段:部署应用程序
cache: # 缓存内容
paths:
- node_modules/
- docker/dist/
# 定义全局变量
variables:
CONTAINER_NAME: 'auth-web' # Docker容器名称
DOCKER_TAG: '1.0.0' # Docker镜像标签版本
# 构建任务
build-job:
stage: build # 指定此任务属于build阶段
script:
# 打印编译开始信息
- echo "Compiling the code..."
# 使用Maven编译Java项目跳过测试
- npm i -g pnpm && pnpm i && pnpm build
# 打印编译完成信息
- echo "Compile complete."
# 从Docker Hub拉取OpenJDK基础镜像
- docker pull nginx:1.27.3
# 打印拉取完成信息
- echo "docker pull complete."
# 使用Dockerfile构建Docker镜像并打上标签
- cd docker && docker build -f Dockerfile -t $CONTAINER_NAME:$DOCKER_TAG .
# 打印构建成功信息
- echo "Application successfully deployed."
# 部署任务
deploy-job:
stage: deploy # 指定此任务属于deploy阶段
environment: production # 指定部署环境为production
script:
# 打印部署开始信息
- echo "Deploying application..."
# 停止正在运行的容器(如果存在),|| true确保命令失败不会中断脚本
- docker stop $CONTAINER_NAME || true
# 删除容器(如果存在)
- docker rm $CONTAINER_NAME || true
# 运行新的Docker容器
# -d: 后台运行
# -p: 端口映射7070和8000
# --name: 容器名称
# --restart always: 总是自动重启
- docker run -d -p 8800:80 --name $CONTAINER_NAME --restart always $CONTAINER_NAME:$DOCKER_TAG
# 打印部署成功信息
- echo "Application successfully deployed."

View File

@ -126,13 +126,13 @@ http.authorizeHttpRequests(auth -> auth
```
bunny-auth/
├── auth-api # Interface Layer
├── auth-core # Core Module
│ ├── config # Security Configuration
│ └── domain # Domain
├── auth-system # System Module
├── core-common # Core and base...
│ ├── context # Context
│ └── exception # Exception
│ └── ...... # And more...
├── service # Business Implementation
└── dao # Data Persistence Layer
├── domain # Domain
└─services # Service and Mapper
```
## 🛠️ Use Cases

View File

@ -129,13 +129,13 @@ http.authorizeHttpRequests(auth -> auth
```
bunny-auth/
├── auth-api # 接口定义层
├── auth-core # 核心模块
│ ├── config # 安全配置
│ └── domain # domain
├── auth-system # 系统模块
├── core-common # 配置和基础模块
│ ├── exception # exception
│ └── context # context
│ └── ...... # 还要很多...
├── service # 业务实现
└── dao # 数据持久层
├── domain # domain
└─services # 服务和mapper
```
## 🛠️ 应用场景

View File

@ -81,7 +81,7 @@ export const userLogin = (data?: object) => {
/** 刷新`token` */
export const refreshTokenApi = (data?: object) => {
return http.request<BaseResult<RefreshTokenResult>>('post', 'user/public/refresh-token', { data });
return http.request<BaseResult<RefreshTokenResult>>('post', 'user/private/refresh-token', { data });
};
/** 发送邮件 */