Showing
3 changed files
with
11 additions
and
3 deletions
src/env.d.ts
0 → 100644
| ... | @@ -11,8 +11,7 @@ const $route = useRoute(); | ... | @@ -11,8 +11,7 @@ const $route = useRoute(); |
| 11 | onMounted(() => { | 11 | onMounted(() => { |
| 12 | // php需要先跳转链接获取openid | 12 | // php需要先跳转链接获取openid |
| 13 | let url = encodeURIComponent(location.origin + location.pathname + $route.query.href); // 未授权的地址 | 13 | let url = encodeURIComponent(location.origin + location.pathname + $route.query.href); // 未授权的地址 |
| 14 | - if (process.env.NODE_ENV === 'development') { | 14 | + if (import.meta.env.DEV) { // TAG: 开发环境测试数据 |
| 15 | - // TAG: 开发环境测试数据 | ||
| 16 | location.href = `/srv/?f=voice&a=openid_${$route.query.userType}&res=${url}&input_openid=${import.meta.env.VITE_OPENID}` | 15 | location.href = `/srv/?f=voice&a=openid_${$route.query.userType}&res=${url}&input_openid=${import.meta.env.VITE_OPENID}` |
| 17 | } else { | 16 | } else { |
| 18 | location.href = `/srv/?f=voice&a=openid_${$route.query.userType}&res=${url}`; | 17 | location.href = `/srv/?f=voice&a=openid_${$route.query.userType}&res=${url}`; | ... | ... |
| ... | @@ -73,7 +73,7 @@ const validator = (val) => { | ... | @@ -73,7 +73,7 @@ const validator = (val) => { |
| 73 | const phone = ref(''); | 73 | const phone = ref(''); |
| 74 | const code = ref(''); | 74 | const code = ref(''); |
| 75 | // TAG: 开发环境测试数据 | 75 | // TAG: 开发环境测试数据 |
| 76 | -if (process.env.NODE_ENV === 'development') { | 76 | +if (import.meta.env.DEV) { |
| 77 | phone.value = import.meta.env.VITE_ID | 77 | phone.value = import.meta.env.VITE_ID |
| 78 | code.value = import.meta.env.VITE_PIN | 78 | code.value = import.meta.env.VITE_PIN |
| 79 | } | 79 | } | ... | ... |
-
Please register or login to post a comment