feat(env): VITE_PROXY support single quote

env文件中的VITE_PROXY配置支持单引号

close: #1204
This commit is contained in:
无木 2021-09-17 09:39:52 +08:00
parent 7b6d5e44a9
commit 067753d490
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
### ✨ Features
- **其它** `.env`文件中的`VITE_PROXY`配置支持单引号
### 🐛 Bug Fixes
- **BasicTable**

View File

@ -28,9 +28,9 @@ export function wrapperEnv(envConf: Recordable): ViteEnv {
if (envName === 'VITE_PORT') {
realName = Number(realName);
}
if (envName === 'VITE_PROXY') {
if (envName === 'VITE_PROXY' && realName) {
try {
realName = JSON.parse(realName);
realName = JSON.parse(realName.replace(/'/g, '"'));
} catch (error) {
realName = '';
}