From 79e846fae69890b93eb29d1f28f7292870e8ff1b Mon Sep 17 00:00:00 2001 From: 5g0Wp7Zy Date: Sat, 17 Jan 2026 13:01:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 +- .env.development | 4 +- .env.production | 2 +- src/api/index.ts | 8 +- src/api/modules/system/index.ts | 12 +- src/api/modules/system/types.ts | 10 + src/views/login/components/login-form.vue | 4 +- .../centralizedControl/centralizedControl.vue | 164 +++++++------- src/views/system/dictionary/dictionary.vue | 1 + .../system/onlineUpdate/onlineUpdate.vue | 208 ++++++++++++++++++ vite.config.ts | 1 + 11 files changed, 321 insertions(+), 95 deletions(-) create mode 100644 src/views/system/onlineUpdate/onlineUpdate.vue diff --git a/.env b/.env index ebaafac..d0a5673 100644 --- a/.env +++ b/.env @@ -17,4 +17,4 @@ VITE_GLOB_AMAP_SECURITY_JS_CODE = 'b85d17b7e0fa98864d495a9a52f162e4' VITE_GLOB_AMAP_KEY = '0e6910fae6848722b0e57f0c01597499' # 图片上传展示路径 -VITE_APP_IMAGE_URL = 'https://www.cdzhuojing.cn/file/static-objects/img-file/' \ No newline at end of file +VITE_APP_IMAGE_URL = 'https://www.cx.cdzhuojing.cn/file/static-objects/img-file/' \ No newline at end of file diff --git a/.env.development b/.env.development index 83b4e08..64362db 100644 --- a/.env.development +++ b/.env.development @@ -8,9 +8,9 @@ VITE_ROUTER_MODE = hash # 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上,所以这里 VITE_PUBLIC_PATH 为 '/' VITE_PUBLIC_PATH = './' -# https://www.cdzhuojing.cn/ebike +# https://www.cx.cdzhuojing.cn/ebike # http://192.168.1.18:10010 # 请求路径 管理系统/开发环境 -VITE_APP_BASE_URL = 'https://www.cdzhuojing.cn/ebike' +VITE_APP_BASE_URL = 'https://www.cx.cdzhuojing.cn/ebike' diff --git a/.env.production b/.env.production index 2545bf5..2d37219 100644 --- a/.env.production +++ b/.env.production @@ -11,5 +11,5 @@ VITE_ROUTER_MODE = hash VITE_PUBLIC_PATH = '/' # 请求路径 管理系统/开发环境 -VITE_APP_BASE_URL = 'https://www.cdzhuojing.cn/ebike' +VITE_APP_BASE_URL = 'https://www.cx.cdzhuojing.cn/ebike' diff --git a/src/api/index.ts b/src/api/index.ts index 9ff61eb..31d26c0 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -44,8 +44,6 @@ service.interceptors.request.use( // 响应拦截器 service.interceptors.response.use( function (response: any) { - // console.log(response, "响应"); - if (response.status != 200) { Message.error("服务器异常,请联系管理员"); return Promise.reject(response.data); @@ -75,9 +73,9 @@ service.interceptors.response.use( } }, function (error: any) { - // TUDU:这里逻辑不符合当前系统,后续改 - // localStorage.removeItem("user-info"); - // router.push("/login"); + // console.log(error); + localStorage.removeItem("user-info"); + router.replace("/login"); return Promise.reject(error); } ); diff --git a/src/api/modules/system/index.ts b/src/api/modules/system/index.ts index 899410a..0431471 100644 --- a/src/api/modules/system/index.ts +++ b/src/api/modules/system/index.ts @@ -11,7 +11,8 @@ import { AddDictFormType, DictItemListParams, AddDictItemFormType, - saveImageType + saveImageType, + OnlineUpdateParams } from "./types"; // 获取菜单数据 @@ -364,3 +365,12 @@ export const updateImageAPI = (data: saveImageType) => { data }); }; + +// 在线模块升级 +export const onlineUpgradeAPI = (data: OnlineUpdateParams) => { + return axios({ + url: "/operations/ebikeEcuInfo/upgrade", + method: "post", + data + }); +}; diff --git a/src/api/modules/system/types.ts b/src/api/modules/system/types.ts index da4bccb..42a28e4 100644 --- a/src/api/modules/system/types.ts +++ b/src/api/modules/system/types.ts @@ -99,3 +99,13 @@ export interface saveImageType { imgCode?: string; // 图片编码 fileUrl: string; // 图片地址 } + +// 远程升级 +export interface OnlineUpdateParams { + ecuSn?: string + bikeCode?: string + ecuBrand: string + url: string + fullUpgrade: boolean + type: number +} diff --git a/src/views/login/components/login-form.vue b/src/views/login/components/login-form.vue index e33ec26..d8e7e91 100644 --- a/src/views/login/components/login-form.vue +++ b/src/views/login/components/login-form.vue @@ -52,8 +52,8 @@ let userStores = useUserInfoStore(); const routeStore = useRouteConfigStore(); const router = useRouter(); const form = ref({ - username: "admin1", - password: "123456" + username: "", + password: "" }); const rules = ref({ username: [ diff --git a/src/views/productionManagement/centralizedControl/centralizedControl.vue b/src/views/productionManagement/centralizedControl/centralizedControl.vue index b464c9f..97bc336 100644 --- a/src/views/productionManagement/centralizedControl/centralizedControl.vue +++ b/src/views/productionManagement/centralizedControl/centralizedControl.vue @@ -1,85 +1,3 @@ - - - + diff --git a/src/views/system/dictionary/dictionary.vue b/src/views/system/dictionary/dictionary.vue index 2c2aa20..38c74b5 100644 --- a/src/views/system/dictionary/dictionary.vue +++ b/src/views/system/dictionary/dictionary.vue @@ -406,6 +406,7 @@ const onDetailUpdate = (record: any) => { deatilForm.value.dicValueName = record.dicValueName; deatilForm.value.dicValue = record.dicValue; deatilForm.value.dicIcon = record.dicIcon; + deatilForm.value.dicId = record.dicId; }; /** diff --git a/src/views/system/onlineUpdate/onlineUpdate.vue b/src/views/system/onlineUpdate/onlineUpdate.vue new file mode 100644 index 0000000..d4de094 --- /dev/null +++ b/src/views/system/onlineUpdate/onlineUpdate.vue @@ -0,0 +1,208 @@ + + + diff --git a/vite.config.ts b/vite.config.ts index 55e368a..a1fdeda 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -28,6 +28,7 @@ export default defineConfig(({ mode }) => { rewrite: path => path.replace(/^\/api/, ""), bypass(req, res, options) { // @ts-ignore + // console.log(res, options); const proxyUrl = new URL(options.rewrite(req.url) || "", options.target)?.href || ""; console.log(proxyUrl); req.headers["x-req-proxyUrl"] = proxyUrl;