diff --git a/web/src/components/Footer.js b/web/src/components/Footer.js index 334ee379..4002ccc5 100644 --- a/web/src/components/Footer.js +++ b/web/src/components/Footer.js @@ -41,7 +41,7 @@ const Footer = () => { href='https://github.com/songquanpeng/one-api' target='_blank' > - {systemName} {process.env.REACT_APP_VERSION}{' '} + {systemName} {import.meta.env.REACT_APP_VERSION}{' '} 由{' '} diff --git a/web/src/components/OtherSetting.js b/web/src/components/OtherSetting.js index 8d63c2dd..6c2f381c 100644 --- a/web/src/components/OtherSetting.js +++ b/web/src/components/OtherSetting.js @@ -92,7 +92,7 @@ const OtherSetting = () => { 'https://api.github.com/repos/songquanpeng/one-api/releases/latest' ); const { tag_name, body } = res.data; - if (tag_name === process.env.REACT_APP_VERSION) { + if (tag_name === import.meta.env.REACT_APP_VERSION) { showSuccess(`已是最新版本:${tag_name}`); } else { setUpdateData({ diff --git a/web/src/helpers/api.js b/web/src/helpers/api.js index 35fdb1e9..3a8d1ed3 100644 --- a/web/src/helpers/api.js +++ b/web/src/helpers/api.js @@ -2,7 +2,7 @@ import { showError } from './utils'; import axios from 'axios'; export const API = axios.create({ - baseURL: process.env.REACT_APP_SERVER ? process.env.REACT_APP_SERVER : '', + baseURL: 'http://localhost:3000', }); API.interceptors.response.use(