refactor: Replace direct process.env.NODE_ENV checks with IS_PROD and IS_DEV constants. (#30383)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
This commit is contained in:
yyh
2025-12-31 08:32:55 +08:00
committed by GitHub
co-authored by gemini-code-assist[bot] Asuka Minato
parent 6ca44eea28
commit 69589807fd
6 changed files with 15 additions and 11 deletions
+2 -1
View File
@@ -23,6 +23,7 @@ import type {
} from '@/models/common'
import type { RETRIEVE_METHOD } from '@/types/app'
import { useMutation, useQuery } from '@tanstack/react-query'
import { IS_DEV } from '@/config'
import { get, post } from './base'
import { useInvalid } from './use-base'
@@ -85,7 +86,7 @@ export const useUserProfile = () => {
profile,
meta: {
currentVersion: response.headers.get('x-version'),
currentEnv: process.env.NODE_ENV === 'development'
currentEnv: IS_DEV
? 'DEVELOPMENT'
: response.headers.get('x-env'),
},