web展示内部版本号

This commit is contained in:
q
2025-10-17 17:19:27 +08:00
parent 8e661ed1c5
commit abde7841ac
5 changed files with 69 additions and 13 deletions

View File

@@ -213,6 +213,12 @@
</div>
</el-card>
</el-row>
<!-- 版本号显示 -->
<div class="version-info">
<span class="version-text">内部版本: {{ buildVersion }}</span>
</div>
<!-- 文件解析结果区下方加分享按钮 -->
<!-- <div v-if="parseResult.code && downloadUrl" style="margin-top: 10px; text-align: right;">-->
<!-- <el-button type="primary" @click="copyShowFileLink">分享文件直链</el-button>-->
@@ -286,7 +292,10 @@ export default {
errorDialogVisible: false,
errorDetail: null,
errorButtonVisible: false
errorButtonVisible: false,
// 版本信息
buildVersion: ''
}
},
methods: {
@@ -518,6 +527,17 @@ export default {
}
},
// 获取版本号
async getBuildVersion() {
try {
const response = await axios.get('/v2/build-version')
this.buildVersion = response.data.data
} catch (error) {
console.error('获取版本号失败:', error)
this.buildVersion = 'unknown'
}
},
// 新增切换目录树展示模式方法
setDirectoryViewMode(mode) {
this.directoryViewMode = mode
@@ -570,6 +590,9 @@ export default {
// 获取初始统计信息
this.getInfo()
// 获取版本号
this.getBuildVersion()
// 自动读取剪切板
if (this.autoReadClipboard) {
this.getPaste()
@@ -881,4 +904,21 @@ hr {
.jv-container.jv-light .jv-item.jv-object {
color: #888;
}
/* 版本号显示样式 */
.version-info {
text-align: center;
margin-top: 20px;
margin-bottom: 20px;
}
.version-text {
font-size: 0.85rem;
color: #999;
font-weight: 400;
}
#app.dark-theme .version-text {
color: #666;
}
</style>

View File

@@ -52,15 +52,21 @@ module.exports = {
events: {
onEnd: {
mkdir: ['./nfd-front'],
delete: [
{ source: './nfd-front.zip', options: { force: true } },
{ source: '../webroot/nfd-front', options: { force: true } },
{ source: './nfd-front/view/.git', options: { force: true } },
{ source: './nfd-front/view/.gitignore', options: { force: true } },
{ source: '../webroot/nfd-front/view/.git', options: { force: true } },
{ source: '../webroot/nfd-front/view/.gitignore', options: { force: true } },
],
copy: [
{ source: './nfd-front', destination: '../webroot/nfd-front' }
],
delete: [ //首先需要删除项目根目录下的dist.zip
'./nfd-front.zip',
'../webroot/nfd-front',
],
archive: [ //然后我们选择dist文件夹将之打包成dist.zip并放在根目录
{source: './nfd-front', destination: './nfd-front.zip'},
{
source: './nfd-front', destination: './nfd-front.zip', options: {}
},
]
}
}

View File

@@ -8,9 +8,7 @@ import cn.qaiu.lz.common.util.URLParamUtil;
import cn.qaiu.lz.web.model.CacheLinkInfo;
import cn.qaiu.lz.web.model.LinkInfoResp;
import cn.qaiu.lz.web.model.StatisticsInfo;
import cn.qaiu.lz.web.model.SysUser;
import cn.qaiu.lz.web.service.DbService;
import cn.qaiu.lz.web.service.UserService;
import cn.qaiu.parser.PanDomainTemplate;
import cn.qaiu.parser.ParserCreate;
import cn.qaiu.vx.core.annotaions.RouteHandler;
@@ -18,6 +16,7 @@ import cn.qaiu.vx.core.annotaions.RouteMapping;
import cn.qaiu.vx.core.enums.RouteMethod;
import cn.qaiu.vx.core.model.JsonResult;
import cn.qaiu.vx.core.util.AsyncServiceUtil;
import cn.qaiu.vx.core.util.CommonUtil;
import cn.qaiu.vx.core.util.ResponseUtil;
import cn.qaiu.vx.core.util.SharedDataUtil;
import io.vertx.core.Future;
@@ -201,4 +200,15 @@ public class ParserApi {
.onFailure(t -> promise.fail(t.fillInStackTrace()));
return promise.future();
}
// 获取版本号
@RouteMapping("/build-version")
public String getVersion() {
return CommonUtil.getAppVersion()
.replace("-", "")
.replace("Z", "")
.replace("T", "_")
.replace("-", "")
.replace(":", "");
}
}

View File

@@ -1,6 +1,6 @@
# 服务配置
server:
port: 6410
port: 6400
contextPath: /
# 使用数据库
enableDatabase: true

View File

@@ -2,7 +2,7 @@
server-name: Vert.x-proxy-server(v4.1.2)
proxy:
- listen: 6411
- listen: 6401
# 404的路径
page404: webroot/err/404.html
static:
@@ -15,14 +15,14 @@ proxy:
# 1.origin代理地址端口后有目录(包括 / ),转发后地址:代理地址+访问URL目录部分去除location匹配目录
# 2.origin代理地址端口后无任何转发后地址代理地址+访问URL目录部
location:
- path: ~^/(json|v2|d|parser|ye|lz|cow|ec|fj|fc|le|qq|ws|iz|ce)/.*
origin: 127.0.0.1:6410
- path: ~^/(json/|v2/|d/|parser|ye/|lz/|cow/|ec/|fj/|fc/|le/|qq/|ws/|iz/|ce/).*
origin: 127.0.0.1:6400
# json/parser -> xxx/parser
# - path: /json/
# origin: 127.0.0.1:6400/
- path: /n1/
origin: 127.0.0.1:6410/v2/
origin: 127.0.0.1:6400/v2/
# # SSL HTTPS配置
ssl: