feat(client): 实现跟卖精灵异步启动和Chrome驱动预加载- 在GenmaiServiceImpl中添加@Async注解实现异步启动跟卖精灵- 增加ChromeDriverPreloader组件预加载Chrome驱动- 添加AsyncConfig配置类启用异步支持
- 优化跟卖精灵启动提示信息和加载状态显示 - 移除Java代码中关于刷新令牌的相关逻辑和依赖- 更新版本号从2.5.5到2.5.6
This commit is contained in:
@@ -170,7 +170,6 @@ async function batchGetProductInfo(asinList: string[]) {
|
||||
// 处理完成状态更新
|
||||
progressPercentage.value = 100
|
||||
currentAsin.value = '处理完成'
|
||||
selectedFileName.value = ''
|
||||
|
||||
|
||||
|
||||
@@ -178,7 +177,6 @@ async function batchGetProductInfo(asinList: string[]) {
|
||||
if (error.name !== 'AbortError') {
|
||||
showMessage(error.message || '批量获取产品信息失败', 'error')
|
||||
currentAsin.value = '处理失败'
|
||||
selectedFileName.value = ''
|
||||
}
|
||||
} finally {
|
||||
tableLoading.value = false
|
||||
@@ -261,7 +259,6 @@ function stopFetch() {
|
||||
abortController = null
|
||||
loading.value = false
|
||||
currentAsin.value = '已停止'
|
||||
selectedFileName.value = ''
|
||||
showMessage('已停止获取产品数据', 'info')
|
||||
}
|
||||
|
||||
@@ -273,8 +270,10 @@ async function openGenmaiSpirit() {
|
||||
genmaiLoading.value = true
|
||||
try {
|
||||
await systemApi.openGenmaiSpirit(selectedGenmaiAccountId.value)
|
||||
showMessage('跟卖精灵已打开', 'success')
|
||||
} finally {
|
||||
showMessage('跟卖精灵正在启动,请稍候...', 'success')
|
||||
setTimeout(() => { genmaiLoading.value = false }, 3000)
|
||||
} catch (error: any) {
|
||||
showMessage(error.message || '启动失败', 'error')
|
||||
genmaiLoading.value = false
|
||||
}
|
||||
}
|
||||
@@ -366,7 +365,7 @@ onMounted(async () => {
|
||||
>
|
||||
<span class="acct-row">
|
||||
<span :class="['status-dot', acc.status === 1 ? 'on' : 'off']"></span>
|
||||
<img class="avatar" src="/image/img_v3_02qd_052605f0-4be3-44db-9691-35ee5ff6201g.jpg" alt="avatar" />
|
||||
<img class="avatar" src="/image/user.png" alt="avatar" />
|
||||
<span class="acct-text">{{ acc.name || acc.username }}</span>
|
||||
<span v-if="selectedGenmaiAccountId === acc.id" class="acct-check">✔️</span>
|
||||
</span>
|
||||
@@ -391,7 +390,7 @@ onMounted(async () => {
|
||||
<div class="step-index">2</div>
|
||||
<div class="step-card">
|
||||
<div class="step-header"><div class="title">启动服务</div></div>
|
||||
<div class="desc">请确保设备已安装Chrome浏览器,否则服务将无法启动。打开跟卖精灵将关闭Chrome浏览器进程。</div>
|
||||
<div class="desc">请确保设备已安装Chrome浏览器,否则服务将无法启动。打开跟卖精灵将关闭Chrome浏览器进程。首次启动需初始化浏览器驱动,可能需要1-3分钟。</div>
|
||||
<div class="action-buttons column">
|
||||
<el-button
|
||||
size="small"
|
||||
@@ -400,7 +399,7 @@ onMounted(async () => {
|
||||
@click="openGenmaiSpirit"
|
||||
>
|
||||
<span v-if="!genmaiLoading">启动服务</span>
|
||||
<span v-else>⟳ 启动中...</span>
|
||||
<span v-else><span class="spinner">⟳</span> 启动中...</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -680,6 +679,7 @@ onMounted(async () => {
|
||||
.price { color: #e6a23c; font-weight: 600; }
|
||||
.table-loading { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.95); display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 14px; color: #606266; }
|
||||
.spinner { font-size: 24px; animation: spin 1s linear infinite; margin-bottom: 8px; }
|
||||
.action-buttons .spinner { font-size: 14px; margin-bottom: 0; display: inline-block; }
|
||||
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
||||
.pagination-fixed { flex-shrink: 0; padding: 8px 12px 0 12px; background: #fff; display: flex; justify-content: flex-end; }
|
||||
.pagination-fixed :deep(.el-pager li.is-active) { border: 1px solid #1677FF; border-radius: 4px; color: #1677FF; background: #fff; }
|
||||
|
||||
Reference in New Issue
Block a user