chore: 清理调试输出并将监控地址改为环境配置
- 移除第三方图表组件的调试输出 - 监控页地址改读环境变量并删除无意义的 ref 包装 - 存储工具补解析失败的类型边界说明
This commit is contained in:
1 parent
7cc36dd731
commit
9c42f79e99
4 files changed
+6
-8
No files matched your search
@@ -13,3 +13,6 @@ VITE_PROXY_TARGET=https://api.youlai.tech # 线上
|
||||
# 接口地址(小程序/App 直连,H5 走代理用不到)
|
||||
VITE_APP_API_URL=https://api.youlai.tech # 线上
|
||||
# VITE_APP_API_URL=http://localhost:8000 # 本地
|
||||
|
||||
# 应用监控地址(工作台-应用监控)
|
||||
VITE_APP_MONITOR_URL=http://localhost:9090/wallboard
|
||||
@@ -528,9 +528,6 @@ export default {
|
||||
name: "error",
|
||||
params: { type: "error", errorShow: this.errorShow, msg: val, id: this.cid },
|
||||
});
|
||||
if (this.errorShow) {
|
||||
console.log("[秋云图表组件]" + val);
|
||||
}
|
||||
}
|
||||
},
|
||||
errorMessage(val, oldval) {
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
|
||||
definePage({
|
||||
name: "monitor",
|
||||
style: { navigationBarTitleText: "应用监控" },
|
||||
layout: "blank",
|
||||
});
|
||||
// SpringBoot Admin 监控地址
|
||||
const monitorUrl = ref("http://localhost:9090/wallboard");
|
||||
// SpringBoot Admin 监控地址,生产环境在 .env.production 配置 VITE_APP_MONITOR_URL
|
||||
const monitorUrl = import.meta.env.VITE_APP_MONITOR_URL || "http://localhost:9090/wallboard";
|
||||
</script>
|
||||
@@ -19,7 +19,7 @@ function get<T>(key: string, defaultValue?: T): T {
|
||||
try {
|
||||
return JSON.parse(value);
|
||||
} catch {
|
||||
// 如果解析失败,返回原始字符串
|
||||
// 如果解析失败,返回原始字符串;历史数据可能未经 JSON 序列化,类型由调用方保证
|
||||
return value as unknown as T;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user