功能:优化项目版本号展示
This commit is contained in:
5
.env
5
.env
@@ -1,15 +1,12 @@
|
||||
# 项目版本号
|
||||
VITE_VERSION=2.1.6
|
||||
VITE_VERSION=2.1.8
|
||||
|
||||
# 项目后端API地址
|
||||
VITE_PROJECT_API=
|
||||
|
||||
# 百度统计相关配置
|
||||
VITE_BAIDU_TONGJI_KEY=
|
||||
VITE_BAIDU_TONGJI_SECRET_KEY=
|
||||
VITE_BAIDU_TONGJI_SITE_ID=
|
||||
VITE_BAIDU_TONGJI_ACCESS_TOKEN=
|
||||
VITE_BAIDU_TONGJI_REFRESH_TOKEN=
|
||||
|
||||
# 星火AI相关配置
|
||||
VITE_AI_APIPassword=
|
||||
|
||||
@@ -28,17 +28,25 @@ const HeaderInfo = () => {
|
||||
|
||||
{/* 项目版本号 */}
|
||||
<div className='hidden md:flex md:flex-col space-y-1 xl:mr-30'>
|
||||
<div className='flex space-x-4'>
|
||||
<p>当前版本:<b className='inline-block px-2 text-white bg-blue-400 rounded-md'>{import.meta.env.VITE_VERSION}</b></p>
|
||||
<p>最新版本:<b className='inline-block px-2 text-white bg-red-500 rounded-md'>{version.tag_name}</b></p>
|
||||
</div>
|
||||
{
|
||||
version.tag_name === import.meta.env.VITE_VERSION
|
||||
? <p>🎉 当前版本为:<b className='inline-block px-2 text-white bg-green-600 rounded-md'>{version.tag_name} 最新版</b></p>
|
||||
: (
|
||||
<>
|
||||
<div className='flex space-x-4'>
|
||||
<p>当前版本:<b className='inline-block px-2 text-white bg-blue-400 rounded-md'>{import.meta.env.VITE_VERSION}</b></p>
|
||||
<p>最新版本:<b className='inline-block px-2 text-white bg-red-500 rounded-md'>{version.tag_name}</b></p>
|
||||
</div>
|
||||
|
||||
<p>更新说明:{version.name}</p>
|
||||
<p>更新说明:{version.name}</p>
|
||||
|
||||
<div className='group flex items-center'>
|
||||
<FaDownload className='group-hover:text-primary transition-colors' />
|
||||
<a href={version.tarball_url} className='group-hover:text-primary pl-2 transition-colors'>点击下载最新版</a>
|
||||
</div>
|
||||
<div className='group flex items-center'>
|
||||
<FaDownload className='group-hover:text-primary transition-colors' />
|
||||
<a href={version.tarball_url} className='group-hover:text-primary pl-2 transition-colors'>点击下载最新版</a>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
3
src/types/env.d.ts
vendored
3
src/types/env.d.ts
vendored
@@ -3,11 +3,8 @@ interface ImportMetaEnv {
|
||||
|
||||
readonly VITE_PROJECT_API: string;
|
||||
|
||||
readonly VITE_BAIDU_TONGJI_KEY: string;
|
||||
readonly VITE_BAIDU_TONGJI_SECRET_KEY: string;
|
||||
readonly VITE_BAIDU_TONGJI_SITE_ID: string;
|
||||
readonly VITE_BAIDU_TONGJI_ACCESS_TOKEN: string;
|
||||
readonly VITE_BAIDU_TONGJI_REFRESH_TOKEN: string;
|
||||
|
||||
readonly VITE_AI_APIPassword: string;
|
||||
readonly VITE_AI_MODEL: string;
|
||||
|
||||
Reference in New Issue
Block a user