style: format web apps with prettier and sort imports
Apply repo-wide Prettier/lint normalization across admin-web, desktop-client and ops-web: single quotes, no semicolons, trailing commas, consistent line wrapping, and import ordering. Also drop an unused brand-logo import in DesktopShell.vue. No behavior changes — formatting only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,6 @@ import { message } from 'ant-design-vue'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { RouterLink, RouterView, useRoute } from 'vue-router'
|
||||
|
||||
import brandLogo from '@brand-logo'
|
||||
import iconWithTitle from '@brand-logo-full'
|
||||
import { useClientRelease } from '../composables/useClientRelease'
|
||||
import { useDesktopRuntime } from '../composables/useDesktopRuntime'
|
||||
|
||||
@@ -83,7 +83,8 @@ function presentClientError(kind: ClientActionKind, error: unknown): ClientError
|
||||
return {
|
||||
tone: 'error',
|
||||
title: '账号绑定失败',
|
||||
content: normalizeDesktopAccountErrorMessage(message) ?? '授权流程执行失败,请稍后重新发起绑定。',
|
||||
content:
|
||||
normalizeDesktopAccountErrorMessage(message) ?? '授权流程执行失败,请稍后重新发起绑定。',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -347,9 +347,7 @@ async function runLimitedAccountProbes(
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all(
|
||||
Array.from({ length: Math.min(concurrency, queue.length) }, () => runNext()),
|
||||
)
|
||||
await Promise.all(Array.from({ length: Math.min(concurrency, queue.length) }, () => runNext()))
|
||||
return failures
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import {
|
||||
ArrowRightOutlined,
|
||||
DeleteOutlined,
|
||||
SafetyCertificateOutlined,
|
||||
LinkOutlined,
|
||||
ReloadOutlined,
|
||||
SafetyCertificateOutlined,
|
||||
WarningOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import { notification } from 'ant-design-vue'
|
||||
@@ -233,9 +233,7 @@ async function runLimitedAccountProbes(
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all(
|
||||
Array.from({ length: Math.min(concurrency, queue.length) }, () => runNext()),
|
||||
)
|
||||
await Promise.all(Array.from({ length: Math.min(concurrency, queue.length) }, () => runNext()))
|
||||
return failures
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'
|
||||
import brandLogo from '@brand-logo'
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { DEFAULT_API_BASE_URL, useDesktopSession } from '../composables/useDesktopSession'
|
||||
|
||||
const { apiBaseURL, error, pending, setApiBaseURL, login } = useDesktopSession()
|
||||
@@ -125,18 +125,22 @@ function clearCountdown() {
|
||||
}
|
||||
}
|
||||
|
||||
watch(error, (msg) => {
|
||||
clearCountdown()
|
||||
lockCountdown.value = 0
|
||||
if (!msg) return
|
||||
const match = msg.match(/请\s*(\d+)\s*秒后重试/)
|
||||
if (!match) return
|
||||
lockCountdown.value = parseInt(match[1], 10)
|
||||
countdownTimer = setInterval(() => {
|
||||
lockCountdown.value--
|
||||
if (lockCountdown.value <= 0) clearCountdown()
|
||||
}, 1000)
|
||||
}, { flush: 'sync' })
|
||||
watch(
|
||||
error,
|
||||
(msg) => {
|
||||
clearCountdown()
|
||||
lockCountdown.value = 0
|
||||
if (!msg) return
|
||||
const match = msg.match(/请\s*(\d+)\s*秒后重试/)
|
||||
if (!match) return
|
||||
lockCountdown.value = parseInt(match[1], 10)
|
||||
countdownTimer = setInterval(() => {
|
||||
lockCountdown.value--
|
||||
if (lockCountdown.value <= 0) clearCountdown()
|
||||
}, 1000)
|
||||
},
|
||||
{ flush: 'sync' },
|
||||
)
|
||||
|
||||
const displayError = computed(() => {
|
||||
if (!error.value) return null
|
||||
@@ -210,15 +214,40 @@ onBeforeUnmount(() => {
|
||||
placeholder="密码"
|
||||
required
|
||||
/>
|
||||
<button type="button" class="eye-toggle" tabindex="-1" @click="showPassword = !showPassword">
|
||||
<svg v-if="showPassword" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
|
||||
<circle cx="12" cy="12" r="3"/>
|
||||
<button
|
||||
type="button"
|
||||
class="eye-toggle"
|
||||
tabindex="-1"
|
||||
@click="showPassword = !showPassword"
|
||||
>
|
||||
<svg
|
||||
v-if="showPassword"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" />
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
</svg>
|
||||
<svg v-else xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/>
|
||||
<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/>
|
||||
<line x1="1" y1="1" x2="23" y2="23"/>
|
||||
<svg
|
||||
v-else
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path
|
||||
d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"
|
||||
/>
|
||||
<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19" />
|
||||
<line x1="1" y1="1" x2="23" y2="23" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -204,7 +204,10 @@ function normalizePublishTaskStatus(status: DesktopTaskInfo['status']): DesktopT
|
||||
return status === 'unknown' ? 'failed' : status
|
||||
}
|
||||
|
||||
function normalizeTaskErrorMessage(message: string | null, platform?: string | null): string | null {
|
||||
function normalizeTaskErrorMessage(
|
||||
message: string | null,
|
||||
platform?: string | null,
|
||||
): string | null {
|
||||
const normalized = extractString(message)
|
||||
if (!normalized) {
|
||||
return null
|
||||
@@ -246,7 +249,8 @@ function summarizeComplianceBlockedReason(raw: string | null): string | null {
|
||||
return normalized
|
||||
}
|
||||
const record = parsed as Record<string, unknown>
|
||||
const manualStatus = typeof record.manual_review_status === 'string' ? record.manual_review_status : ''
|
||||
const manualStatus =
|
||||
typeof record.manual_review_status === 'string' ? record.manual_review_status : ''
|
||||
if (manualStatus === 'pending') {
|
||||
return '文章版本正在等待运营人工审阅,旧定时任务已停止派发。'
|
||||
}
|
||||
@@ -270,7 +274,9 @@ function summarizeComplianceBlockedReason(raw: string | null): string | null {
|
||||
.slice(0, 3)
|
||||
|
||||
const hitPart =
|
||||
hitCount !== null && hitCount > 0 ? `命中 ${hitCount} 条${highestLevel}规则` : `命中${highestLevel}规则`
|
||||
hitCount !== null && hitCount > 0
|
||||
? `命中 ${hitCount} 条${highestLevel}规则`
|
||||
: `命中${highestLevel}规则`
|
||||
return matchedTerms.length > 0
|
||||
? `${hitPart}:${matchedTerms.join('、')}`
|
||||
: `${hitPart},请修改文章后重新发布。`
|
||||
@@ -806,7 +812,9 @@ const publishTasks = computed<PublishTaskItem[]>(() =>
|
||||
),
|
||||
submitUncertain: task.status === 'unknown' && taskError.publish_submit_uncertain === true,
|
||||
complianceBlockedRecordId,
|
||||
complianceBlockedAt: task.compliance_blocked_at ? parseTimestamp(task.compliance_blocked_at) : null,
|
||||
complianceBlockedAt: task.compliance_blocked_at
|
||||
? parseTimestamp(task.compliance_blocked_at)
|
||||
: null,
|
||||
}
|
||||
}),
|
||||
)
|
||||
@@ -1053,7 +1061,11 @@ const tableScroll = { x: 1080 } as const
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="canRetryTask(record)"
|
||||
:title="record.submitUncertain ? '该文章可能已发布,重试前请先核实平台侧结果' : '重新提交发布任务'"
|
||||
:title="
|
||||
record.submitUncertain
|
||||
? '该文章可能已发布,重试前请先核实平台侧结果'
|
||||
: '重新提交发布任务'
|
||||
"
|
||||
placement="top"
|
||||
>
|
||||
<a-button
|
||||
|
||||
Reference in New Issue
Block a user