diff --git a/.env.caddy b/.env.caddy new file mode 100644 index 0000000..54b253e --- /dev/null +++ b/.env.caddy @@ -0,0 +1,8 @@ +# 页面标题 +VITE_APP_TITLE = 木鸢物联平台 + +# 开发环境配置 +VITE_APP_ENV = 'caddy' + +# 木鸢物联平台/开发环境 +VITE_APP_BASE_API = '/prod-api' diff --git a/.env.production b/.env.production index 7f0f858..6f821fa 100644 --- a/.env.production +++ b/.env.production @@ -5,7 +5,7 @@ VITE_APP_TITLE = 木鸢物联平台 VITE_APP_ENV = 'production' # 木鸢物联平台/生产环境 -VITE_APP_BASE_API = '/prod-api' +VITE_APP_BASE_API = '/api' # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/Caddyfile b/Caddyfile index 79cfd95..9fd1a69 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,3 +1,4 @@ + :4173 { handle_path /prod-api/* { reverse_proxy 192.168.1.201:1616 diff --git a/env.d.ts b/env.d.ts index 151aa68..11f02fe 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1 +1 @@ -/// \ No newline at end of file +/// diff --git a/package.json b/package.json index 119e3b7..ca248fb 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,9 @@ "dev": "vite", "build:prod": "vite build", "build:stage": "vite build --mode staging", + "build:caddy": "vite build --mode caddy", "preview": "vite preview", - "fmt": "prettier -w .", + "format": "prettier --write \"**/*.{js,ts,tsx,jsx,vue,md}\"", "commit-push": "prettier -w . && git add . && git commit -m" }, "repository": { diff --git a/src/api/firmware/log.js b/src/api/firmware/log.js new file mode 100644 index 0000000..cbee7eb --- /dev/null +++ b/src/api/firmware/log.js @@ -0,0 +1,44 @@ +import request from "@/utils/request"; + +// 查询设备升级历史列表 +export function listLog(query) { + return request({ + url: "/firmware/log/list", + method: "get", + params: query, + }); +} + +// 查询设备升级历史详细 +export function getLog(logId) { + return request({ + url: "/firmware/log/" + logId, + method: "get", + }); +} + +// 新增设备升级历史 +export function addLog(data) { + return request({ + url: "/firmware/log", + method: "post", + data: data, + }); +} + +// 修改设备升级历史 +export function updateLog(data) { + return request({ + url: "/firmware/log", + method: "put", + data: data, + }); +} + +// 删除设备升级历史 +export function delLog(logId) { + return request({ + url: "/firmware/log/" + logId, + method: "delete", + }); +} diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index e77672e..1ed33bb 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -1,29 +1,29 @@