解决已知问题
This commit is contained in:
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
35
dockerfile
Normal file
35
dockerfile
Normal file
@@ -0,0 +1,35 @@
|
||||
# 使用官方的Node.js镜像作为基础镜像
|
||||
FROM node:20-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /thrive
|
||||
|
||||
# 复制 package.json 和 package-lock.json
|
||||
COPY package*.json /thrive/
|
||||
|
||||
# 配置 npm 镜像源
|
||||
RUN npm config set registry https://registry.npmmirror.com
|
||||
|
||||
# 安装依赖
|
||||
RUN npm install
|
||||
|
||||
# 复制项目文件
|
||||
COPY . /thrive
|
||||
|
||||
# 构建项目
|
||||
RUN npm run build
|
||||
|
||||
# 使用 Nginx 作为生产环境的基础镜像
|
||||
FROM nginx:alpine
|
||||
|
||||
# 复制构建输出到 Nginx 的默认静态文件目录
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# 复制自定义的 Nginx 配置文件(如果需要)
|
||||
# COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 9002
|
||||
|
||||
# 启动 Nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -1,5 +1,5 @@
|
||||
import Request from '@/utils/request'
|
||||
import { Footprint } from '@/types/app/footprint'
|
||||
import { FilterFootprint, Footprint } from '@/types/app/footprint'
|
||||
|
||||
// 新增路由
|
||||
export const addFootprintDataAPI = (data: Footprint) => Request<Footprint>("POST", "/footprint", { data })
|
||||
@@ -14,7 +14,7 @@ export const editFootprintDataAPI = (data: Footprint) => Request<Footprint>("PAT
|
||||
export const getFootprintDataAPI = (id?: number) => Request<Footprint>("GET", `/footprint/${id}`)
|
||||
|
||||
// 获取路由列表
|
||||
export const getFootprintListAPI = (data?: QueryData) => Request<Footprint[]>("POST", "/footprint/list", {
|
||||
export const getFootprintListAPI = (data?: QueryData<FilterFootprint>) => Request<Footprint[]>("POST", "/footprint/list", {
|
||||
data: { ...data?.query },
|
||||
params: {
|
||||
sort: data?.sort
|
||||
|
||||
4
src/types/response.d.ts
vendored
4
src/types/response.d.ts
vendored
@@ -27,11 +27,11 @@ interface FilterData {
|
||||
endDate?: string
|
||||
}
|
||||
|
||||
interface QueryData {
|
||||
interface QueryData<T = FilterData> {
|
||||
// 通用的
|
||||
sort?: "asc" | "desc",
|
||||
pattern?: "list" | "recursion",
|
||||
query?: FilterData,
|
||||
query?: T,
|
||||
pagination?: Page,
|
||||
|
||||
// 文件相关
|
||||
|
||||
@@ -3,8 +3,8 @@ import { Modal, notification } from "antd";
|
||||
import { useUserStore } from "@/stores";
|
||||
|
||||
// 配置项目API域名
|
||||
export const baseURL = "http://localhost:9999/api";
|
||||
// export const baseURL = "http://82.157.186.125:5000/api";
|
||||
// export const baseURL = "http://localhost:9999/api";
|
||||
export const baseURL = "http://api.liuyuyang.net/api";
|
||||
|
||||
// 创建 axios 实例
|
||||
export const instance = axios.create({
|
||||
|
||||
Reference in New Issue
Block a user