fix: 修复编译错误 + 新增后台管理前端Docker部署配置
- OdfCheckinService: 添加 using Infrastructure 引入 CustomException - OdfCableFaultsService: 修复匿名类型 ToPage 返回类型不匹配问题 - ZR.Vue: 新增 Dockerfile、nginx.conf、.env.production 用于Docker部署
This commit is contained in:
parent
343dd2d6ad
commit
a20a6b869c
|
|
@ -24,7 +24,8 @@ namespace ZR.Service.Business
|
|||
{
|
||||
var predicate = QueryExp(parm);
|
||||
|
||||
var response = Queryable()
|
||||
var total = 0;
|
||||
var list = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.LeftJoin<OdfCables>((f, c) => f.CableId == c.Id)
|
||||
.OrderByDescending((f, c) => f.FaultTime)
|
||||
|
|
@ -43,9 +44,16 @@ namespace ZR.Service.Business
|
|||
f.CreatedAt,
|
||||
CableName = c.CableName
|
||||
})
|
||||
.ToPage<dynamic>(parm);
|
||||
.MergeTable()
|
||||
.ToPageList(parm.PageNum, parm.PageSize, ref total);
|
||||
|
||||
return response;
|
||||
return new PagedInfo<dynamic>
|
||||
{
|
||||
Result = list.Cast<dynamic>().ToList(),
|
||||
TotalNum = total,
|
||||
PageIndex = parm.PageNum,
|
||||
PageSize = parm.PageSize
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Infrastructure;
|
||||
using Infrastructure.Attribute;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Business;
|
||||
|
|
|
|||
14
server/ZR.Vue/Dockerfile
Normal file
14
server/ZR.Vue/Dockerfile
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# 构建阶段
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN rm -f package-lock.json && npm install
|
||||
COPY . .
|
||||
RUN npm run build:prod
|
||||
|
||||
# 生产阶段
|
||||
FROM nginx:alpine
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
27
server/ZR.Vue/nginx.conf
Normal file
27
server/ZR.Vue/nginx.conf
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /prod-api/ {
|
||||
proxy_pass http://odf-new-server:8888/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /msghub {
|
||||
proxy_pass http://odf-new-server:8888/msghub;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user