refactor(config): 优化演示环境中IP白名单和中间件请求IP获取逻辑

- 演示模式中增加演示白名单IP "117.10.167.220"
- 中间件中优先从X-Forwarded-For请求头获取客户端真实IP,优化IP判断逻辑
- 从日志中打印用户名称,方便追踪演示环境操作用户
- 补充IP白名单和路径白名单的判断条件,非白名单用户禁止操作
- 初始化插件中的数据库连接和初始化逻辑调整,改为单独会话完成,提升代码清晰度
- 初始化脚本中更新PostgreSQL序列时仅处理含id字段的模型,避免关联表模型错误
- 修改开发环境配置,切换数据库类型为MySQL,更新相关连接配置,匹配MySQL默认端口及用户信息
- 删除MySQL数据库的完整导出脚本,确保代码库无冗余数据库备份文件
This commit is contained in:
zhangtao
2025-09-08 22:04:00 +08:00
parent 67f194f6ca
commit ccaa94e1f2
11 changed files with 874 additions and 3975 deletions
+9 -9
View File
@@ -3,7 +3,7 @@ import request from "@/utils/request";
const ExampleAPI = {
getExampleList(query: ExamplePageQuery) {
return request<ApiResponse<PageResult<ExampleTable[]>>>({
url: `/demo/example/list`,
url: `/example/demo/list`,
method: "get",
params: query,
});
@@ -11,14 +11,14 @@ const ExampleAPI = {
getExampleDetail(query: number) {
return request<ApiResponse<ExampleTable>>({
url: `/demo/example/detail/${query}`,
url: `/example/demo/detail/${query}`,
method: "get",
});
},
createExample(body: ExampleForm) {
return request<ApiResponse>({
url: `/demo/example/create`,
url: `/example/demo/create`,
method: "post",
data: body,
});
@@ -26,7 +26,7 @@ const ExampleAPI = {
updateExample(id: number, body: ExampleForm) {
return request<ApiResponse>({
url: `/demo/example/update/${id}`,
url: `/example/demo/update/${id}`,
method: "put",
data: body,
});
@@ -34,7 +34,7 @@ const ExampleAPI = {
deleteExample(body: number[]) {
return request<ApiResponse>({
url: `/demo/example/delete`,
url: `/example/demo/delete`,
method: "delete",
data: body,
});
@@ -42,7 +42,7 @@ const ExampleAPI = {
batchAvailableExample(body: BatchType) {
return request<ApiResponse>({
url: `/demo/example/available/setting`,
url: `/example/demo/available/setting`,
method: "patch",
data: body,
});
@@ -50,7 +50,7 @@ const ExampleAPI = {
exportExample(body: ExamplePageQuery) {
return request<Blob>({
url: `/demo/example/export`,
url: `/example/demo/export`,
method: "post",
data: body,
responseType: "blob",
@@ -59,7 +59,7 @@ const ExampleAPI = {
downloadTemplate() {
return request<ApiResponse>({
url: `/demo/example/download/template`,
url: `/example/demo/download/template`,
method: "post",
responseType: "blob",
});
@@ -67,7 +67,7 @@ const ExampleAPI = {
importExample(body: any) {
return request<ApiResponse>({
url: `/demo/example/import`,
url: `/example/demo/import`,
method: "post",
data: body,
headers: {