v1.0.33: 全局唯一性校验 - 手机号/邮箱/身份证/企业注册号/社媒账号ID/主页链接/企业名称 新增与修改时校验,重复弹窗提示并跳转定位(后端duplicate_check引擎+code 1001,前端弹窗+person/company/media页?id=跳转)
This commit is contained in:
@@ -49,6 +49,27 @@ function handleResp(resp) {
|
||||
location.href = 'index.html';
|
||||
return $.Deferred().reject(resp).promise();
|
||||
}
|
||||
// 重复数据:弹窗提示 + 跳转定位到已有记录
|
||||
if (resp && resp.code === 1001 && resp.data) {
|
||||
var d = resp.data;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '数据重复提示',
|
||||
area: ['440px', 'auto'],
|
||||
content: '<div style="padding:20px 24px;">' +
|
||||
'<div style="font-size:14px;color:#e74c3c;margin-bottom:8px;">' + escHtml(d.label) + '「' + escHtml(d.value) + '」出现重复</div>' +
|
||||
'<div style="font-size:13px;color:#5a6472;margin-bottom:18px;">该值已存在:' + escHtml(d.name || '未知记录') + (d.owner_label ? '(' + escHtml(d.owner_label) + ')' : '') + '</div>' +
|
||||
'<div style="text-align:right;"><button class="btn btn-primary" id="dup-jump-btn">查看记录</button></div>' +
|
||||
'</div>',
|
||||
btn: ['知道了'],
|
||||
success: function (layero) {
|
||||
$(layero).find('#dup-jump-btn').on('click', function () {
|
||||
location.href = d.jump;
|
||||
});
|
||||
}
|
||||
});
|
||||
return $.Deferred().reject(resp).promise();
|
||||
}
|
||||
var msg = (resp && resp.msg) ? resp.msg : '请求失败';
|
||||
layer.msg(msg, { icon: 2 });
|
||||
return $.Deferred().reject(resp).promise();
|
||||
|
||||
Reference in New Issue
Block a user