This commit is contained in:
2026-06-18 21:37:47 +08:00
parent 33727f8d55
commit a566c31e68
3 changed files with 76 additions and 19 deletions

View File

@@ -0,0 +1,20 @@
// 司法/特殊名单等预设接口编码,与后端 LegacyHardcodedAPICodes 保持一致,后续可在此累加
export const JUDICIAL_API_CODES = [
// flxg — 司法
'FLXG0V4B',
'FLXG2E8F',
'FLXG3A9B',
'FLXG5A3B',
'FLXG7E8F',
'FLXG9C1D',
'FLXGCA3D',
'FLXGDEA8',
'FLXGDEA9',
'FLXGHB4F',
'FLXGK5D2',
// jrzq — 特殊名单
'JRZQV7MD',
'JRZQ8A2D',
// qygl — 企业司法失信
'QYGL2S0W'
]

View File

@@ -50,6 +50,7 @@
</el-form-item>
<el-form-item label="生效接口" prop="api_codes">
<div class="api-codes-field">
<el-select
v-model="form.api_codes"
multiple
@@ -68,6 +69,13 @@
:value="product.code"
/>
</el-select>
<div class="api-codes-actions">
<el-button link type="primary" size="small" @click="selectJudicialApis">
一键选司法接口
</el-button>
<span class="api-codes-actions-tip">{{ JUDICIAL_API_CODES.length }} 可继续手动追加</span>
</div>
</div>
<div class="form-tip">选择全部接口时仅对入参<strong>必填身份证</strong> API 生效企业类等无身份证入参的接口不受影响</div>
</el-form-item>
@@ -85,6 +93,7 @@
<script setup>
import { productAdminApi, queryWhitelistApi, userApi } from '@/api'
import { JUDICIAL_API_CODES } from '@/constants/queryWhitelist.js'
import { ElMessage } from 'element-plus'
import { computed, reactive, ref, watch } from 'vue'
@@ -164,6 +173,18 @@ const handleApiCodesChange = (codes) => {
}
}
const selectJudicialApis = () => {
const current = form.api_codes.filter((code) => code !== '*')
const before = new Set(current)
form.api_codes = [...new Set([...current, ...JUDICIAL_API_CODES])]
const added = form.api_codes.length - before.size
if (added > 0) {
ElMessage.success(`已添加 ${added} 个司法接口,可继续手动追加`)
} else {
ElMessage.info('司法接口已全部选中')
}
}
const searchUsers = async (query) => {
if (!query) return
userLoading.value = true
@@ -256,4 +277,20 @@ const handleClosed = () => {
padding: 0 4px;
border-radius: 4px;
}
.api-codes-field {
width: 100%;
}
.api-codes-actions {
display: flex;
align-items: center;
gap: 4px;
margin-top: 4px;
}
.api-codes-actions-tip {
font-size: 12px;
color: #9ca3af;
}
</style>

View File

@@ -288,7 +288,7 @@ const handleDelete = async (row) => {
const handleImportLegacy = async () => {
try {
await ElMessageBox.confirm(
'将导入原 processor 中 17 条硬编码身份证为「全局规则」user_id=*name=*全部接口。已存在的会自动跳过。',
'将导入原 processor 中 17 条硬编码身份证为「全局规则」user_id=*name=*)。生效接口为原硬编码所在的司法、特殊名单等 API 编码,并非全部接口。已存在的会自动跳过。',
'导入历史硬编码',
{ type: 'info', confirmButtonText: '开始导入' }
)