cloudtentacles 增加登陆后持久化, 调试ok
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
AdminAgisoShopConfigItem,
|
||||
AdminAuditLogItem,
|
||||
AdminCloudtentaclesLoginTestResult,
|
||||
AdminCloudtentaclesPersistedSession,
|
||||
AdminCloudtentaclesSendSmsResult,
|
||||
AdminCloudtentaclesSourceConfig,
|
||||
AdminCloudtentaclesValidateSessionResult,
|
||||
@@ -152,14 +153,18 @@ export function syncAdminKhhaoOrders(payload: {
|
||||
export function fetchAdminCloudtentaclesSourceConfig() {
|
||||
return apiGet<{
|
||||
filePath: string
|
||||
sessionFilePath: string
|
||||
source: AdminCloudtentaclesSourceConfig
|
||||
session: AdminCloudtentaclesPersistedSession
|
||||
}>('/api/v1/admin/platform-config/cloudtentacles-source')
|
||||
}
|
||||
|
||||
export function saveAdminCloudtentaclesSourceConfig(payload: AdminCloudtentaclesSourceConfig) {
|
||||
return apiPost<{
|
||||
filePath: string
|
||||
sessionFilePath: string
|
||||
source: AdminCloudtentaclesSourceConfig
|
||||
session: AdminCloudtentaclesPersistedSession
|
||||
}>('/api/v1/admin/platform-config/cloudtentacles-source', payload as unknown as Record<string, unknown>)
|
||||
}
|
||||
|
||||
@@ -194,6 +199,118 @@ export function validateAdminCloudtentaclesSession(payload: {
|
||||
return apiPost<AdminCloudtentaclesValidateSessionResult>('/api/v1/admin/platform-config/cloudtentacles/validate-session', payload)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesAsset(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/asset', payload)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesCategories(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/categories', payload)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesSkuList(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/sku/list', payload)
|
||||
}
|
||||
|
||||
export function buyAdminCloudtentaclesSku(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
id?: number
|
||||
count?: number
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/sku/buy', payload)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesKnapsack(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/knapsack', payload)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesVnList(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/vn/list', payload)
|
||||
}
|
||||
|
||||
export function appointAdminCloudtentaclesVn(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/vn/appoint', payload)
|
||||
}
|
||||
|
||||
export function generateAdminCloudtentaclesVnLoginCode(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
id?: number
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/vn/generate-login-code', payload)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesVnCode(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
phone?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/vn/fetch-code', payload)
|
||||
}
|
||||
|
||||
export function verifyAdminCloudtentaclesVnCode(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
id?: number
|
||||
code?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/vn/verify-code', payload)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesBindUrl(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
id?: number
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>('/api/v1/admin/platform-config/cloudtentacles/vn/bind-url', payload)
|
||||
}
|
||||
|
||||
export function fetchAdminFulfillmentBindingConfigs() {
|
||||
return apiGet<{
|
||||
filePath: string
|
||||
|
||||
@@ -185,6 +185,18 @@ export interface AdminCloudtentaclesSourceConfig {
|
||||
deviceType: number
|
||||
}
|
||||
|
||||
export interface AdminCloudtentaclesPersistedSession {
|
||||
token: string
|
||||
tokenMasked: string
|
||||
baseUrl: string
|
||||
username: string
|
||||
phoneMasked: string
|
||||
loggedInAt: string
|
||||
deviceId: string
|
||||
deviceType: number
|
||||
hasToken: boolean
|
||||
}
|
||||
|
||||
export interface AdminCloudtentaclesSendSmsResult {
|
||||
baseUrl: string
|
||||
username: string
|
||||
@@ -198,6 +210,7 @@ export interface AdminCloudtentaclesSessionSummary {
|
||||
tokenMasked: string
|
||||
permissionCount: number
|
||||
permissions: string[]
|
||||
persisted?: boolean
|
||||
}
|
||||
|
||||
export interface AdminCloudtentaclesLoginTestResult {
|
||||
|
||||
@@ -3,9 +3,19 @@ import { computed, onMounted, ref } from 'vue'
|
||||
|
||||
import { showError, showSuccess } from '@/lib/feedback'
|
||||
import {
|
||||
appointAdminCloudtentaclesVn,
|
||||
buyAdminCloudtentaclesSku,
|
||||
fetchAdminCloudtentaclesAsset,
|
||||
fetchAdminCloudtentaclesBindUrl,
|
||||
fetchAdminCloudtentaclesCategories,
|
||||
fetchAdminCloudtentaclesKnapsack,
|
||||
fetchAdminAgisoShopConfigs,
|
||||
fetchAdminCloudtentaclesSourceConfig,
|
||||
fetchAdminCloudtentaclesSkuList,
|
||||
fetchAdminCloudtentaclesVnCode,
|
||||
fetchAdminCloudtentaclesVnList,
|
||||
fetchAdminKhhaoSourceConfig,
|
||||
generateAdminCloudtentaclesVnLoginCode,
|
||||
queryAdminKhhaoOrders,
|
||||
saveAdminCloudtentaclesSourceConfig,
|
||||
saveAdminAgisoShopConfigs,
|
||||
@@ -15,12 +25,14 @@ import {
|
||||
testAdminCloudtentaclesLogin,
|
||||
testAdminKhhaoLogin,
|
||||
validateAdminCloudtentaclesSession,
|
||||
verifyAdminCloudtentaclesVnCode,
|
||||
} from '@/services/admin'
|
||||
import type {
|
||||
AdminAgisoMessagingDefaults,
|
||||
AdminAgisoObservedShopItem,
|
||||
AdminAgisoShopConfigItem,
|
||||
AdminCloudtentaclesLoginTestResult,
|
||||
AdminCloudtentaclesPersistedSession,
|
||||
AdminCloudtentaclesSendSmsResult,
|
||||
AdminCloudtentaclesSourceConfig,
|
||||
AdminCloudtentaclesValidateSessionResult,
|
||||
@@ -50,6 +62,7 @@ type EditableShop = {
|
||||
}
|
||||
|
||||
const loading = ref(true)
|
||||
const isDevMode = import.meta.env.DEV
|
||||
const saving = ref(false)
|
||||
const khhaoSaving = ref(false)
|
||||
const cloudtentaclesSaving = ref(false)
|
||||
@@ -60,6 +73,7 @@ const agisoFilePath = ref('')
|
||||
const khhaoFilePath = ref('')
|
||||
const khhaoStateFilePath = ref('')
|
||||
const cloudtentaclesFilePath = ref('')
|
||||
const cloudtentaclesSessionFilePath = ref('')
|
||||
const defaults = ref<EditableDefaults>(createEmptyDefaults())
|
||||
const shops = ref<EditableShop[]>([])
|
||||
const observedShops = ref<AdminAgisoObservedShopItem[]>([])
|
||||
@@ -92,6 +106,10 @@ const cloudtentaclesForm = ref({
|
||||
phone: '',
|
||||
code: '',
|
||||
token: '',
|
||||
vnKey: '1',
|
||||
vnId: 0,
|
||||
skuId: 0,
|
||||
skuCount: 1,
|
||||
deviceId: '-',
|
||||
deviceType: 0,
|
||||
})
|
||||
@@ -102,6 +120,9 @@ const cloudtentaclesResultError = ref('')
|
||||
const cloudtentaclesSmsResult = ref<AdminCloudtentaclesSendSmsResult | null>(null)
|
||||
const cloudtentaclesLoginResult = ref<AdminCloudtentaclesLoginTestResult | null>(null)
|
||||
const cloudtentaclesValidateResult = ref<AdminCloudtentaclesValidateSessionResult | null>(null)
|
||||
const cloudtentaclesDebugLoading = ref(false)
|
||||
const cloudtentaclesDebugResult = ref('')
|
||||
const cloudtentaclesPersistedSession = ref<AdminCloudtentaclesPersistedSession | null>(null)
|
||||
|
||||
const agisoStats = computed(() => ({
|
||||
configuredShopCount: shops.value.length,
|
||||
@@ -203,13 +224,19 @@ async function loadConfigs() {
|
||||
}
|
||||
|
||||
cloudtentaclesFilePath.value = cloudtentaclesResponse.data.filePath
|
||||
cloudtentaclesSessionFilePath.value = cloudtentaclesResponse.data.sessionFilePath
|
||||
cloudtentaclesPersistedSession.value = cloudtentaclesResponse.data.session
|
||||
cloudtentaclesForm.value = {
|
||||
baseUrl: cloudtentaclesResponse.data.source.baseUrl || 'https://123.207.217.176',
|
||||
username: cloudtentaclesResponse.data.source.username || '',
|
||||
password: cloudtentaclesResponse.data.source.password || '',
|
||||
phone: cloudtentaclesResponse.data.source.phone || '',
|
||||
code: '',
|
||||
token: '',
|
||||
token: cloudtentaclesResponse.data.session?.token || '',
|
||||
vnKey: '1',
|
||||
vnId: 0,
|
||||
skuId: 0,
|
||||
skuCount: 1,
|
||||
deviceId: cloudtentaclesResponse.data.source.deviceId || '-',
|
||||
deviceType: cloudtentaclesResponse.data.source.deviceType || 0,
|
||||
}
|
||||
@@ -492,6 +519,9 @@ async function handleCloudtentaclesSaveSource() {
|
||||
try {
|
||||
const response = await saveAdminCloudtentaclesSourceConfig(buildCloudtentaclesConfigPayload())
|
||||
cloudtentaclesFilePath.value = response.data.filePath
|
||||
cloudtentaclesSessionFilePath.value = response.data.sessionFilePath
|
||||
cloudtentaclesPersistedSession.value = response.data.session
|
||||
cloudtentaclesForm.value.token = response.data.session?.token || ''
|
||||
showSuccess('cloudtentacles 履约平台配置已保存')
|
||||
} catch (error) {
|
||||
cloudtentaclesResultError.value = error instanceof Error ? error.message : 'cloudtentacles 配置保存失败'
|
||||
@@ -533,6 +563,17 @@ async function handleCloudtentaclesTestLogin() {
|
||||
const response = await testAdminCloudtentaclesLogin(buildCloudtentaclesLoginPayload())
|
||||
cloudtentaclesLoginResult.value = response.data
|
||||
cloudtentaclesForm.value.token = response.data.token || cloudtentaclesForm.value.token
|
||||
cloudtentaclesPersistedSession.value = {
|
||||
token: response.data.token || '',
|
||||
tokenMasked: response.data.session.tokenMasked,
|
||||
baseUrl: response.data.baseUrl,
|
||||
username: response.data.username,
|
||||
phoneMasked: response.data.phoneMasked,
|
||||
loggedInAt: response.data.loggedInAt,
|
||||
deviceId: cloudtentaclesForm.value.deviceId.trim() || '-',
|
||||
deviceType: Number(cloudtentaclesForm.value.deviceType || 0),
|
||||
hasToken: Boolean(response.data.token),
|
||||
}
|
||||
showSuccess('cloudtentacles 登录测试成功')
|
||||
} catch (error) {
|
||||
cloudtentaclesResultError.value = error instanceof Error ? error.message : 'cloudtentacles 登录测试失败'
|
||||
@@ -560,6 +601,17 @@ async function handleCloudtentaclesValidateSession() {
|
||||
deviceType: Number(cloudtentaclesForm.value.deviceType || 0),
|
||||
})
|
||||
cloudtentaclesValidateResult.value = response.data
|
||||
cloudtentaclesPersistedSession.value = {
|
||||
token,
|
||||
tokenMasked: response.data.session.tokenMasked,
|
||||
baseUrl: response.data.baseUrl,
|
||||
username: cloudtentaclesPersistedSession.value?.username || cloudtentaclesForm.value.username.trim(),
|
||||
phoneMasked: cloudtentaclesPersistedSession.value?.phoneMasked || '',
|
||||
loggedInAt: response.data.loggedInAt,
|
||||
deviceId: cloudtentaclesForm.value.deviceId.trim() || '-',
|
||||
deviceType: Number(cloudtentaclesForm.value.deviceType || 0),
|
||||
hasToken: Boolean(token),
|
||||
}
|
||||
showSuccess('cloudtentacles 会话校验成功')
|
||||
} catch (error) {
|
||||
cloudtentaclesResultError.value = error instanceof Error ? error.message : 'cloudtentacles 会话校验失败'
|
||||
@@ -569,6 +621,142 @@ async function handleCloudtentaclesValidateSession() {
|
||||
}
|
||||
}
|
||||
|
||||
function buildCloudtentaclesTokenPayload() {
|
||||
return {
|
||||
baseUrl: cloudtentaclesForm.value.baseUrl.trim() || 'https://123.207.217.176',
|
||||
token: cloudtentaclesForm.value.token.trim(),
|
||||
deviceId: cloudtentaclesForm.value.deviceId.trim() || '-',
|
||||
deviceType: Number(cloudtentaclesForm.value.deviceType || 0),
|
||||
}
|
||||
}
|
||||
|
||||
function ensureCloudtentaclesToken() {
|
||||
if (!cloudtentaclesForm.value.token.trim()) {
|
||||
cloudtentaclesResultError.value = '请先登录或手动填写 token'
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
function renderCloudtentaclesDebugResult(label: string, data: unknown) {
|
||||
cloudtentaclesDebugResult.value = `${label}\n${JSON.stringify(data, null, 2)}`
|
||||
}
|
||||
|
||||
async function runCloudtentaclesDebugAction(label: string, runner: () => Promise<{ data: unknown }>) {
|
||||
cloudtentaclesDebugLoading.value = true
|
||||
cloudtentaclesResultError.value = ''
|
||||
|
||||
try {
|
||||
const response = await runner()
|
||||
renderCloudtentaclesDebugResult(label, response.data)
|
||||
showSuccess(`${label}成功`)
|
||||
} catch (error) {
|
||||
cloudtentaclesResultError.value = error instanceof Error ? error.message : `${label}失败`
|
||||
showError(cloudtentaclesResultError.value)
|
||||
} finally {
|
||||
cloudtentaclesDebugLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesFetchAsset() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('查询余额', () => fetchAdminCloudtentaclesAsset(buildCloudtentaclesTokenPayload()))
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesFetchCategories() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('查询分类', () => fetchAdminCloudtentaclesCategories(buildCloudtentaclesTokenPayload()))
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesFetchSkuList() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('查询SKU列表', () => fetchAdminCloudtentaclesSkuList(buildCloudtentaclesTokenPayload()))
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesBuySku() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('购买SKU', () => buyAdminCloudtentaclesSku({
|
||||
...buildCloudtentaclesTokenPayload(),
|
||||
id: Number(cloudtentaclesForm.value.skuId || 0),
|
||||
count: Number(cloudtentaclesForm.value.skuCount || 1),
|
||||
}))
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesFetchKnapsack() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('查询背包', () => fetchAdminCloudtentaclesKnapsack(buildCloudtentaclesTokenPayload()))
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesFetchVnList() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('查询虚拟号列表', () => fetchAdminCloudtentaclesVnList({
|
||||
...buildCloudtentaclesTokenPayload(),
|
||||
key: cloudtentaclesForm.value.vnKey.trim(),
|
||||
}))
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesAppointVn() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('申请虚拟号', async () => {
|
||||
const response = await appointAdminCloudtentaclesVn({
|
||||
...buildCloudtentaclesTokenPayload(),
|
||||
key: cloudtentaclesForm.value.vnKey.trim(),
|
||||
})
|
||||
const item = (response.data as { item?: { id?: number, phone?: string } }).item
|
||||
if (item?.id) {
|
||||
cloudtentaclesForm.value.vnId = Number(item.id)
|
||||
}
|
||||
if (item?.phone) {
|
||||
cloudtentaclesForm.value.phone = String(item.phone)
|
||||
}
|
||||
return response
|
||||
})
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesGenerateVnLoginCode() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('生成登录码', () => generateAdminCloudtentaclesVnLoginCode({
|
||||
...buildCloudtentaclesTokenPayload(),
|
||||
key: cloudtentaclesForm.value.vnKey.trim(),
|
||||
id: Number(cloudtentaclesForm.value.vnId || 0),
|
||||
}))
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesFetchVnCode() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('获取验证码', async () => {
|
||||
const response = await fetchAdminCloudtentaclesVnCode({
|
||||
...buildCloudtentaclesTokenPayload(),
|
||||
key: cloudtentaclesForm.value.vnKey.trim(),
|
||||
phone: cloudtentaclesForm.value.phone.trim(),
|
||||
})
|
||||
const code = (response.data as { code?: string }).code
|
||||
if (code) {
|
||||
cloudtentaclesForm.value.code = String(code)
|
||||
}
|
||||
return response
|
||||
})
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesVerifyVnCode() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('校验验证码', () => verifyAdminCloudtentaclesVnCode({
|
||||
...buildCloudtentaclesTokenPayload(),
|
||||
key: cloudtentaclesForm.value.vnKey.trim(),
|
||||
id: Number(cloudtentaclesForm.value.vnId || 0),
|
||||
code: cloudtentaclesForm.value.code.trim(),
|
||||
}))
|
||||
}
|
||||
|
||||
async function handleCloudtentaclesFetchBindUrl() {
|
||||
if (!ensureCloudtentaclesToken()) return
|
||||
await runCloudtentaclesDebugAction('获取兑换链接', () => fetchAdminCloudtentaclesBindUrl({
|
||||
...buildCloudtentaclesTokenPayload(),
|
||||
key: cloudtentaclesForm.value.vnKey.trim(),
|
||||
id: Number(cloudtentaclesForm.value.vnId || 0),
|
||||
}))
|
||||
}
|
||||
|
||||
onMounted(loadConfigs)
|
||||
</script>
|
||||
|
||||
@@ -631,6 +819,7 @@ onMounted(loadConfigs)
|
||||
type="button"
|
||||
:class="['platform-overview-card', { 'is-active': activePlatform === 'cloudtentacles' }]"
|
||||
@click="switchPlatform('cloudtentacles')"
|
||||
v-if="isDevMode"
|
||||
>
|
||||
<div class="platform-head">
|
||||
<span class="platform-badge">cloudtentacles</span>
|
||||
@@ -664,6 +853,7 @@ onMounted(loadConfigs)
|
||||
type="button"
|
||||
:class="['switch-chip', { 'is-active': activePlatform === 'cloudtentacles' }]"
|
||||
@click="switchPlatform('cloudtentacles')"
|
||||
v-if="isDevMode"
|
||||
>
|
||||
cloudtentacles 履约平台
|
||||
</button>
|
||||
@@ -1047,16 +1237,26 @@ onMounted(loadConfigs)
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<template v-else-if="isDevMode">
|
||||
<section class="meta-card">
|
||||
<div class="meta-line">
|
||||
<span class="meta-label">配置文件</span>
|
||||
<code>{{ cloudtentaclesFilePath || '-' }}</code>
|
||||
</div>
|
||||
<div class="meta-line">
|
||||
<span class="meta-label">会话文件</span>
|
||||
<code>{{ cloudtentaclesSessionFilePath || '-' }}</code>
|
||||
</div>
|
||||
<div class="meta-line">
|
||||
<span class="meta-label">职责</span>
|
||||
<span>管理 cloudtentacles 外部履约平台的账号、短信验证码登录与 token 探活。该区域不处理订单来源同步。</span>
|
||||
</div>
|
||||
<div class="meta-line">
|
||||
<span class="meta-label">已保存 token</span>
|
||||
<span>
|
||||
{{ cloudtentaclesPersistedSession?.hasToken ? `${cloudtentaclesPersistedSession.tokenMasked} / ${formatAdminDateTime(cloudtentaclesPersistedSession.loggedInAt)}` : '未保存' }}
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="table-card">
|
||||
@@ -1099,6 +1299,26 @@ onMounted(loadConfigs)
|
||||
<input v-model="cloudtentaclesForm.code" class="text-input" placeholder="收到验证码后填写" />
|
||||
</label>
|
||||
|
||||
<label class="field-block">
|
||||
<span>VN Key</span>
|
||||
<input v-model="cloudtentaclesForm.vnKey" class="text-input" placeholder="例如 1" />
|
||||
</label>
|
||||
|
||||
<label class="field-block">
|
||||
<span>VN ID</span>
|
||||
<input v-model.number="cloudtentaclesForm.vnId" class="text-input" type="number" min="0" />
|
||||
</label>
|
||||
|
||||
<label class="field-block">
|
||||
<span>SKU ID</span>
|
||||
<input v-model.number="cloudtentaclesForm.skuId" class="text-input" type="number" min="0" />
|
||||
</label>
|
||||
|
||||
<label class="field-block">
|
||||
<span>购买数量</span>
|
||||
<input v-model.number="cloudtentaclesForm.skuCount" class="text-input" type="number" min="1" />
|
||||
</label>
|
||||
|
||||
<label class="field-block">
|
||||
<span>deviceId</span>
|
||||
<input v-model="cloudtentaclesForm.deviceId" class="text-input" placeholder="-" />
|
||||
@@ -1147,6 +1367,31 @@ onMounted(loadConfigs)
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="table-card">
|
||||
<div class="section-title-row">
|
||||
<div>
|
||||
<h3>cloudtentacles 开发调试工具</h3>
|
||||
<p>仅开发模式展示。用于调试分类、SKU、购买、背包、虚拟号和兑换链接链路。</p>
|
||||
</div>
|
||||
<div class="section-actions">
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round @click="handleCloudtentaclesFetchAsset">余额</el-button>
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round @click="handleCloudtentaclesFetchCategories">分类</el-button>
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round @click="handleCloudtentaclesFetchSkuList">SKU</el-button>
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round @click="handleCloudtentaclesBuySku">购买</el-button>
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round @click="handleCloudtentaclesFetchKnapsack">背包</el-button>
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round @click="handleCloudtentaclesFetchVnList">虚拟号列表</el-button>
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round @click="handleCloudtentaclesAppointVn">申请虚拟号</el-button>
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round @click="handleCloudtentaclesGenerateVnLoginCode">生成登录码</el-button>
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round @click="handleCloudtentaclesFetchVnCode">获取验证码</el-button>
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round @click="handleCloudtentaclesVerifyVnCode">校验验证码</el-button>
|
||||
<el-button :loading="cloudtentaclesDebugLoading" round type="primary" @click="handleCloudtentaclesFetchBindUrl">兑换链接</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<pre v-if="cloudtentaclesDebugResult" class="debug-result">{{ cloudtentaclesDebugResult }}</pre>
|
||||
<div v-else class="empty-inline">执行一次调试动作后,这里会显示原始返回数据。</div>
|
||||
</section>
|
||||
|
||||
<section v-if="cloudtentaclesLoginResult || cloudtentaclesValidateResult" class="table-card">
|
||||
<div class="section-title-row">
|
||||
<div>
|
||||
@@ -1518,6 +1763,19 @@ onMounted(loadConfigs)
|
||||
color: #b42318;
|
||||
}
|
||||
|
||||
.debug-result {
|
||||
margin: 0;
|
||||
padding: 14px;
|
||||
border-radius: 16px;
|
||||
background: #0f172a;
|
||||
color: #e2e8f0;
|
||||
overflow: auto;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.overview-grid,
|
||||
.result-grid,
|
||||
|
||||
Reference in New Issue
Block a user