diff --git a/.env.development b/.env.development deleted file mode 100644 index 5ae32ba..0000000 --- a/.env.development +++ /dev/null @@ -1,5 +0,0 @@ -# 生产环境使用的变量 -NODE_ENV = 'test' - -NEXT_PUBLIC_HOST = 'http://39.103.180.196:9012' -NEXT_PUBLIC_MOBILE_HOST = 'https://m.indie.cn' diff --git a/.env.production b/.env.production index eafe8cb..558dd30 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,6 @@ # 生产环境使用的变量 NODE_ENV = 'production' +NEXT_PUBLIC_NODE_ENV = 'production' NEXT_PUBLIC_HOST = 'http://api.indie.cn:9012' NEXT_PUBLIC_MOBILE_HOST = 'https://m.indie.cn' diff --git a/.env.test b/.env.test index 7008c1e..5dc9ca5 100644 --- a/.env.test +++ b/.env.test @@ -1,5 +1,6 @@ # 测试环境使用的变量 NODE_ENV = 'test' +NEXT_PUBLIC_NODE_ENV = 'test' NEXT_PUBLIC_HOST = 'http://39.103.180.196:9012' NEXT_PUBLIC_MOBILE_HOST = 'https://m.indie.cn' diff --git a/src/store/audio.ts b/src/store/audio.ts index bc1c06b..e86d80d 100644 --- a/src/store/audio.ts +++ b/src/store/audio.ts @@ -274,8 +274,8 @@ const useAudioState = create()( }, ), { - name: 'audio', // 浏览器调试时显示的 store 名称 - enabled: true, // 是否开启调试工具(通常根据当前环境开启/关闭) + name: 'audio', // redux-devtools 中的 store 名称 + enabled: process.env.NEXT_PUBLIC_NODE_ENV !== 'production', // 是否开启 redux-devtools }, ), ); diff --git a/src/store/user.ts b/src/store/user.ts index 4ba47a9..5ef4416 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -87,8 +87,8 @@ const useUserStore = create()( }, ), { - name: 'user', // 浏览器调试时显示的 store 名称 - enabled: true, // 是否开启调试工具(通常根据当前环境开启/关闭) + name: 'user', // redux-devtools 中的 store 名称 + enabled: process.env.NEXT_PUBLIC_NODE_ENV !== 'production', // 是否开启 redux-devtools }, ), );