v1.0.33: 全局唯一性校验 - 手机号/邮箱/身份证/企业注册号/社媒账号ID/主页链接/企业名称 新增与修改时校验,重复弹窗提示并跳转定位(后端duplicate_check引擎+code 1001,前端弹窗+person/company/media页?id=跳转)
This commit is contained in:
@@ -25,6 +25,19 @@ class Response
|
||||
self::json(['code' => $code, 'msg' => $msg]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重复数据错误(前端弹窗 + 跳转定位)
|
||||
* @param array $dup 重复记录信息:{label,value,name,owner_label,jump,...}
|
||||
*/
|
||||
public static function duplicate($dup)
|
||||
{
|
||||
self::json([
|
||||
'code' => 1001,
|
||||
'msg' => ($dup['label'] ?? '字段') . '「' . ($dup['value'] ?? '') . '」出现重复',
|
||||
'data' => $dup,
|
||||
]);
|
||||
}
|
||||
|
||||
private static function json($payload)
|
||||
{
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
Reference in New Issue
Block a user