1
This commit is contained in:
parent
76687296b9
commit
1c055d2bfc
@ -656,9 +656,16 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="140" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button size="small" type="primary" link @click="openQimenForm(row)">编辑</el-button>
|
||||
<el-button
|
||||
v-if="row.interface_code === 'OPEN_API'"
|
||||
size="small"
|
||||
type="success"
|
||||
link
|
||||
@click="copyOpenApiConfig(row)"
|
||||
>复制配置</el-button>
|
||||
<el-button size="small" type="danger" link @click="handleDeleteQimenConfig(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -2173,6 +2180,24 @@ async function copyEditingQimenCustomerId() {
|
||||
}
|
||||
}
|
||||
|
||||
function copyOpenApiConfig(row: any) {
|
||||
const baseApi = String(import.meta.env.VITE_APP_BASE_API || '').replace(/\/+$/, '')
|
||||
const lines: string[] = []
|
||||
lines.push('【OPEN_API 接口配置信息】')
|
||||
lines.push('')
|
||||
if (row.app_name) lines.push(`应用名称:${row.app_name}`)
|
||||
if (row.self_app_key) lines.push(`APPKEY:${row.self_app_key}`)
|
||||
if (row.self_app_secret) lines.push(`APPSECRET:${row.self_app_secret}`)
|
||||
if (row.callback_url) lines.push(`回调地址:${row.callback_url}`)
|
||||
lines.push('')
|
||||
lines.push('开发文档:')
|
||||
lines.push(` 接口文档 ${baseApi}/docs/api/openapi`)
|
||||
lines.push(` 回调测试 ${baseApi}/docs/api/openapi/callback-test`)
|
||||
lines.push('')
|
||||
lines.push('请妥善保管以上信息,用于 API 对接。')
|
||||
copyText(lines.join('\n'))
|
||||
}
|
||||
|
||||
function openCallbackDoc() {
|
||||
const baseApi = String(import.meta.env.VITE_APP_BASE_API || '').replace(/\/+$/, '')
|
||||
window.open(`${baseApi}/docs/api/openapi/callback-test`, '_blank')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user