mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
优化: 替换第三方CDN资源以提升加载速度
- 将所有第三方资源从 bootcdn 迁移到 cdnjs.cloudflare.com - 移除 SRI 完整性校验以避免哈希值不匹配问题 - 添加 DNS 预取和预连接以加速资源加载 - 调整脚本加载顺序,确保依赖关系正确 - 保持所有库版本号不变 (Vue 3.3.4, Element Plus 2.4.4, Chart.js 4.4.0) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
27
src/app.js
27
src/app.js
@@ -122,10 +122,35 @@ class Application {
|
||||
]);
|
||||
|
||||
const memory = process.memoryUsage();
|
||||
|
||||
// 获取版本号:优先使用环境变量,其次VERSION文件,再次package.json,最后使用默认值
|
||||
let version = process.env.APP_VERSION || process.env.VERSION;
|
||||
if (!version) {
|
||||
try {
|
||||
// 尝试从VERSION文件读取
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const versionFile = path.join(__dirname, '..', 'VERSION');
|
||||
if (fs.existsSync(versionFile)) {
|
||||
version = fs.readFileSync(versionFile, 'utf8').trim();
|
||||
}
|
||||
} catch (error) {
|
||||
// 忽略错误,继续尝试其他方式
|
||||
}
|
||||
}
|
||||
if (!version) {
|
||||
try {
|
||||
const packageJson = require('../package.json');
|
||||
version = packageJson.version;
|
||||
} catch (error) {
|
||||
version = '1.0.0';
|
||||
}
|
||||
}
|
||||
|
||||
const health = {
|
||||
status: 'healthy',
|
||||
service: 'claude-relay-service',
|
||||
version: '1.0.0',
|
||||
version: version,
|
||||
timestamp: new Date().toISOString(),
|
||||
uptime: process.uptime(),
|
||||
memory: {
|
||||
|
||||
Reference in New Issue
Block a user