v1.0.33: 全局唯一性校验 - 手机号/邮箱/身份证/企业注册号/社媒账号ID/主页链接/企业名称 新增与修改时校验,重复弹窗提示并跳转定位(后端duplicate_check引擎+code 1001,前端弹窗+person/company/media页?id=跳转)

This commit is contained in:
nanguaboss
2026-08-09 22:27:05 +08:00
parent de1c227727
commit 76593d4dce
15 changed files with 393 additions and 17 deletions
+5
View File
@@ -10,6 +10,7 @@ require_once __DIR__ . '/../common/auth.php';
require_once __DIR__ . '/../common/logger.php';
require_once __DIR__ . '/../common/helpers.php';
require_once __DIR__ . '/../common/completeness.php';
require_once __DIR__ . '/../common/duplicate_check.php';
checkAjax();
checkPermission('media');
@@ -42,6 +43,10 @@ if ((int)$chk->fetchColumn() > 0) {
Response::error('该平台账号已存在', 400);
}
// 唯一性校验:社媒账号ID(同平台)/ 手机 / 邮箱 / 主页链接
$dup = checkSingleAccountDuplicate($pdo, $data['platform'] ?? '', $data['account_id'] ?? '', $data['profile_url'] ?? '');
if ($dup) Response::duplicate($dup);
[$sql, $params] = buildInsert($data);
$pdo->prepare("INSERT INTO social_accounts $sql")->execute($params);
$newId = (int)$pdo->lastInsertId();