HomeLease/config/dev.js
2025-08-30 10:08:23 +08:00

55 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 开发环境配置
export const DEV_CONFIG = {
// 临时token用于开发测试
TEMP_TOKEN:
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjA2NzFkNWMzLTViZTEtNGFjZi1hYmFjLTMxZWZjYjY0NTg2MyJ9.dPnZkiM7f3v-uP1MMRwwIwNjPciZdQcHsz79n8WehiDPtFMGm_VsfJE4P_gN2N8nVcJJ5lf7YcKZW3HRUautXQ',
// 是否使用临时token
USE_TEMP_TOKEN: true,
// 应用ID - 需要根据实际后端配置调整
APP_ID: 1, // TODO: 请根据实际后端API要求调整此值
// 是否显示调试信息
DEBUG: true,
}
// 获取临时token
export function getTempToken() {
return DEV_CONFIG.TEMP_TOKEN
}
// 是否使用临时token
export function shouldUseTempToken() {
return DEV_CONFIG.USE_TEMP_TOKEN
}
// 获取API基础地址
export function getApiBaseUrl() {
return DEV_CONFIG.API_BASE_URL
}
// 获取应用ID
export function getAppId() {
return DEV_CONFIG.APP_ID
}
// 是否开启调试模式
export function isDebugMode() {
return DEV_CONFIG.DEBUG
}
// 开发环境日志
export function devLog(...args) {
if (isDebugMode()) {
console.log('[DEV]', ...args)
}
}
// 开发环境错误日志
export function devError(...args) {
if (isDebugMode()) {
console.error('[DEV ERROR]', ...args)
}
}