security: 移除所有硬编码的敏感信息
- 使用环境变量替代硬编码的数据库密码 - 使用环境变量替代硬编码的 API 地址 - 更新 .env.example 添加 GROK_BASE_URL 配置 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ddf28ddbf1
commit
c3284ac01b
|
|
@ -1,13 +1,14 @@
|
|||
const mysql = require('mysql2/promise');
|
||||
require('dotenv').config();
|
||||
|
||||
async function checkSchema() {
|
||||
try {
|
||||
const connection = await mysql.createConnection({
|
||||
host: '192.144.32.178',
|
||||
port: 3306,
|
||||
user: 'root',
|
||||
password: 'lichao1314',
|
||||
database: 'auth_db'
|
||||
host: process.env.SERVER_HOST,
|
||||
port: process.env.SERVER_PORT || 3306,
|
||||
user: process.env.SERVER_USER,
|
||||
password: process.env.PASSWORD,
|
||||
database: process.env.DB_NAME
|
||||
});
|
||||
|
||||
console.log('🔍 检查当前 user 表结构:');
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export const PROVIDER_TYPE = {
|
|||
},
|
||||
Grok: {
|
||||
name: 'Grok',
|
||||
baseUrl: 'http://141.98.197.39:8000',
|
||||
baseUrl: process.env.GROK_BASE_URL || 'https://api.x.ai',
|
||||
model: 'grok-4.20-beta',
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue