替换全新实名认证

This commit is contained in:
Dragon
2024-03-28 14:17:55 +08:00
parent 2072068af9
commit 7226c4432c
4 changed files with 378 additions and 356 deletions

View File

@@ -48,7 +48,7 @@
<div class="title">认证须知</div>
<p>1.该认证仅支持中国内地(不含港澳台地区)的用户。</p>
<p>2.请确保填写身份证信息真实并与本人一致。</p>
<p>3.根据国家相关的法律法规,您需要提供您的真实身份信息(真实姓名、身份证号)、身份证正反面照片、面部信息以完成实名验证。您所提供的身份信息仅用于身份验证,未经您本人的许可不会被用于其他用途。这些信息属于个人敏感信息,我们将会尽可能的保护您个人敏感信息的安全。如果您不提供这些信息,您将不能使用提现等相关功能,但不影响您继续使用"Mew"的其他服务。</p>
<p>3.根据国家相关的法律法规,您需要提供您的真实身份信息(真实姓名、身份证号)、身份证正反面照片、面部信息以完成实名验证。您所提供的身份信息仅用于身份验证,未经您本人的许可不会被用于其他用途。这些信息属于个人敏感信息,我们将会尽可能的保护您个人敏感信息的安全。如果您不提供这些信息,您将不能使用提现等相关功能,但不影响您继续使用"音萌"的其他服务。</p>
<p>4.为保护用户权益,开启实名认证后我们将不提供解除恢复的功能,请谅解。</p>
<p>5.一个身份证最多用于5个用户账号的实名认证。</p>
</div>

File diff suppressed because one or more lines are too long

View File

@@ -2,16 +2,46 @@
* Created by raymondjack on 2018/12/21.
*/
var info = {};
// var pubInfo = {};
var $toast = $('.toast');
var $mask = $('.status-mask');
var lockBol = false;
let urlPrefix = getUrlPrefix()
var goToPage = null;
// 封装layer消息提醒框
let layerIndex
const showLoading = (content = '获取结果中...') => {
layer.open({
type: 2,
shadeClose: false,
content,
success (e) {
layerIndex = $(e).attr('index')
}
})
}
const hideLoading = (index) => {
layer.close(index)
}
const toastMsg = (content = '操作完成', time = 2) => {
layer.open({
content,
time,
skin: 'msg'
})
}
$(function () {
getInfoFromClient()
var browser = checkVersion();
var api = getUrlPrefix();
var timer = null;
var env = EnvCheck();
var urlObj = getQueryString();
console.log(urlObj.uid);
if (urlObj.uid) {
sessionStorage.setItem("uid", urlObj.uid);
sessionStorage.setItem("ticket", urlObj.ticket);
}
if (env == 'test') {
var vConsole = new VConsole();
}
@@ -21,7 +51,7 @@ $(function () {
if (browser.android) {
let channel = JSON.parse(pubInfo.deviceInfo).channel
if (channel.indexOf('toutiao') != -1 || channel.indexOf('kuaishou') != -1) {
$('.appName').html('音游')
$('.appName').html('piko')
}
}
}
@@ -38,79 +68,101 @@ $(function () {
},
getDeviceMsg: function () {
if (browser.app) {
if (browser.android) {
info.uid = parseInt(window.androidJsObj.getUid());
info.deviceId = window.androidJsObj.getDeviceId();
info.ticket = window.androidJsObj.getTicket();
} else {
info.uid = tools.cookieUtils.get("uid");
if (!info.uid) {
window.webkit.messageHandlers.getUid.postMessage(null);
}
window.webkit.messageHandlers.getDeviceId.postMessage(null);
window.webkit.messageHandlers.getTicket.postMessage(null);
}
} else {
info.uid = 922473;
info.deviceId = "204aa0c983384f1e84a3625b4f04bac1";
}
// if (browser.app) {
// if (browser.android) {
// pubInfo.uid = parseInt(window.androidJsObj.getUid());
// pubInfo.deviceId = window.androidJsObj.getDeviceId();
// pubInfo.ticket = window.androidJsObj.getTicket();
// } else {
// pubInfo.uid = tools.cookieUtils.get("uid");
// if (!pubInfo.uid) {
// window.webkit.messageHandlers.getUid.postMessage(null);
// }
// window.webkit.messageHandlers.getDeviceId.postMessage(null);
// window.webkit.messageHandlers.getTicket.postMessage(null);
// }
// } else {
// pubInfo.uid = 922473;
// pubInfo.deviceId = "204aa0c983384f1e84a3625b4f04bac1";
// }
// setTimeout(function () {
// $('.deviceId').val(info.deviceId);
// $('.deviceId').val(pubInfo.deviceId);
// },200)
},
getData: function () {
console.log(urlObj, 'urlObj')
if (urlObj) {
info.auth = urlObj.auth
pubInfo.auth = urlObj.auth
} else {
info.auth = ''
pubInfo.auth = ''
}
console.log(info.auth, 'info.auth')
$.ajax({
type: "get",
url: api + "/certification/hasCertify",
headers: {
"pub_ticket": info.ticket
},
console.log(pubInfo.auth, 'pubInfo.auth')
networkRequest({
type: 'get',
url: urlPrefix + '/certification/hasCertify',
data: {
uid: info.uid,
auth: info.auth,
ticket: info.ticket,
uid: pubInfo.uid,
auth: pubInfo.auth,
ticket: pubInfo.ticket,
},
success: function (res) {
if (res.code == 200) {
var checkBol = res.data;
var $mask = $('.status-mask');
if (checkBol.authResult) {
console.log('已短信验证!')
} else if (checkBol.hasCertify && !checkBol.canCertify) {
console.log('已实名且没有机会了')
$mask.addClass("have-identity");
$mask.find(".text").html("您已通过实名认证");
$mask.find(".tips").html("系统已成功审核您的实名认证");
$mask.show();
} else if (checkBol.hasCertify && checkBol.canCertify) {
console.log('已实名还有一次机会')
// var $mask = $('.status-mask');
var bool = !(checkBol.authResult == null || checkBol.authResult == undefined);
function successFun () {
hideLoading(layerIndex)
goToPage = true;
$mask.addClass("have-identity");
$mask.find(".text").html("您已通过实名认证");
$mask.find(".tips").html("系统已成功审核您的实名认证");
$mask.find(".goto-change").removeClass('hide');
$mask.show();
}
if (bool) {
if (checkBol.authResult == false && checkBol.canCertify == true && checkBol.hasCertify == false) {
//重复调用
showLoading();
main.getData();
}else if (checkBol.authResult == false && checkBol.canCertify == false && checkBol.hasCertify == true) {
//成功
successFun()
} else if (checkBol.authResult == true && checkBol.canCertify == false && checkBol.hasCertify == true) {
//成功
successFun()
} else if (checkBol.authResult == true && checkBol.canCertify == true && checkBol.hasCertify == false) {
//失败
goToPage = false;
$mask.addClass("failed");
$mask.find(".text").html("您未通过实名认证");
$mask.find(".tips").html("系统审核您的实名认证失败");
$mask.find(".goto-change").removeClass('hide');
$mask.show();
hideLoading(layerIndex)
}
} else {
if (checkBol.canCertify == false && checkBol.hasCertify == true) {
//成功
successFun()
} else {//(authResult == null || authResult == undefined) && canCertify == true && hasCertify == false;
//正在操作
console.log('继续操作');
}
hideLoading(layerIndex)
}
}
},
error (err) {
console.log(err);
}
})
},
eventRegister: function () {
$('.button-submit').on('click', function () {
var name = $('.name').val();
var personId = $('.person-id').val();
var phone = $('.phone').val();
var phone = `${$('.phone').val()}`;
var identityCode = $('.identity-code').val();
var agree = $('#agree').prop("checked");
if (!agree) {
@@ -150,67 +202,40 @@ $(function () {
return;
}
lockBol = true;
var metaInfo = window.getMetaInfo();
var requestParam = {
uid: info.uid,
username: encryptDes(name, "1ea53d260ecf11e7b56e00163e046a26"),
identityNumber: encryptDes(personId, "1ea53d260ecf11e7b56e00163e046a26"),
phone: encryptDes(phone, "1ea53d260ecf11e7b56e00163e046a26"),
certType: 0,
code: identityCode,
ticket: info.ticket
identityNumber: encryptDes(personId, "1ea53d260ecf11e7b56e00163e046a26"),
metaInfo: JSON.stringify(metaInfo),
phone: encryptDes( phone, "1ea53d260ecf11e7b56e00163e046a26"),
returnUrl: urlPrefix + `/mew/modules/identity/new.html?uid=${pubInfo.uid}&ticket=${pubInfo.ticket}`,
uid: pubInfo.uid,
username: encryptDes(name, "1ea53d260ecf11e7b56e00163e046a26"),
};
if (browser.android) {
requestParam.deviceInfo = JSON.stringify({
deviceId: info.deviceId
});
}
$.ajax({
type: "get",
url: api + "/certification/token",
networkRequest({
type: 'post',
url: urlPrefix + '/certification/initFace',
data: requestParam,
headers: {
"pub_ticket": info.ticket
},
success: function (res) {
if (res.code == 200) {
var token = res.data.token;
info.token = token;
// if(browser.app){
if (browser.ios) {
window.webkit.messageHandlers.openFaceLiveness.postMessage(token);
} else {
window.androidJsObj.openFaceLiveness(token);
}
// }
} else {
if (res.code == 10109) {
$mask.addClass("failed");
$mask.find(".text").html("实名认证失败");
$mask.find(".tips").html("实名次数已达限制");
} else if (res.code == 10110) {
$mask.addClass("have-identity");
$mask.find(".text").html("您已通过实名认证");
$mask.find(".tips").html("系统已成功审核您的实名认证");
} else if (res.code == 4003) {
$mask.addClass("failed");
$mask.find(".text").html("实名认证失败");
$mask.find(".tips").html("验证码错误");
window.location.href = res.data.certifyUrl;
} else {
$mask.addClass("failed");
$mask.find(".text").html("实名认证失败");
$mask.find(".tips").html("请填写真实有效的身份证信息");
}
$mask.find(".tips").html(res.message);
$mask.show();
lockBol = false;
setTimeout(function () {
$('.status-mask').hide();
}, 4000);
lockBol = false;
}
},
error (err) {
console.log(err);
}
});
// $.post(api + "/certification/doCheck",requestParam,function (res) {
//
// })
})
})
$('.button-identity-code').on('click', function () {
@@ -241,38 +266,32 @@ $(function () {
}, 1000)
var requestParam = {
phone: encryptDes(phone, "1ea53d260ecf11e7b56e00163e046a26"),
uid: info.uid,
ticket: info.ticket
phone: encryptDes( phone, "1ea53d260ecf11e7b56e00163e046a26"),
uid: pubInfo.uid,
ticket: pubInfo.ticket
};
if (browser.android) {
requestParam.deviceInfo = JSON.stringify({
deviceId: info.deviceId
deviceId: pubInfo.deviceId
});
}
$.ajax({
type: "post",
url: api + "/certification/send/code",
headers: {
"pub_ticket": info.ticket
},
networkRequest({
type: 'post',
url: urlPrefix + '/certification/send/code',
data: requestParam,
success: function (res) {
console.log(res, '请求成功');
if (res.code == 200) {
toastShow('发送成功');
} else {
toastShow(res.message);
console.log(res, '报错啦');
}
},
error: function (res) {
toastShow(res.message);
console.log(res, '报错啦');
error (err) {
console.log(err);
}
});
})
})
// 点击我要修改
@@ -297,7 +316,7 @@ $(function () {
});
function toastShow(text) {
function toastShow (text) {
$toast.html(text);
$toast.show();
setTimeout(function () {
@@ -305,24 +324,22 @@ function toastShow(text) {
}, 2000);
}
function getMessage(key, value) {
info[key] = value;
function getMessage (key, value) {
pubInfo[key] = value;
}
function renderByStatus(status) {
function renderByStatus (status) {
$mask.attr('class', 'status-mask');
console.log("开始回调," + "状态为" + status);
$.ajax({
networkRequest({
type: 'post',
url: getUrlPrefix() + '/certification/notify',
headers: {
"pub_ticket": info.ticket
},
url: urlPrefix + '/certification/notify',
data: {
uid: info.uid,
ticket: info.ticket,
token: info.token,
uid: pubInfo.uid,
ticket: pubInfo.ticket,
token: pubInfo.token,
statusCode: status
},
success: function (res) {
@@ -355,8 +372,12 @@ function renderByStatus(status) {
}, 4000);
}
}
},
error (err) {
console.log(err);
}
});
})
console.log('status', status);
}
@@ -370,3 +391,11 @@ const encryptDes = (message, key) => {
});
return encrypted.toString();
}
$('.status-mask').click(function () {
if (goToPage) {
// window.location.href = urlPrefix + '/mew/modules/identity/new.html'
} else {
$('.status-mask').hide();
}
})

View File

@@ -7,7 +7,7 @@
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>实名认证</title>
<link rel="stylesheet" href="../../common/css/reset.css">
<link rel="stylesheet" href="./css/index.css?v=1">
<link rel="stylesheet" href="./css/index.css?v=1.0">
<script src="../../common/js/flexible.js"></script>
</head>
@@ -50,9 +50,9 @@
<div class="title">认证须知</div>
<p>1.该认证仅支持中国内地(不含港澳台地区)的用户。</p>
<p>2.请确保填写身份证信息真实并与本人一致。</p>
<p>3.根据国家相关的法律法规,您需要提供您的真实身份信息(真实姓名、身份证号)、身份证正反面照片、面部信息以完成实名验证。您所提供的身份信息仅用于身份验证,未经您本人的许可不会被用于其他用途。这些信息属于个人敏感信息,我们将会尽可能的保护您个人敏感信息的安全。如果您不提供这些信息,您将不能使用提现等相关功能,但不影响您继续使用"<span class="appName">Mew</span>"的其他服务。</p>
<p>3.根据国家相关的法律法规,您需要提供您的真实身份信息(真实姓名、身份证号)、身份证正反面照片、面部信息以完成实名验证。您所提供的身份信息仅用于身份验证,未经您本人的许可不会被用于其他用途。这些信息属于个人敏感信息,我们将会尽可能的保护您个人敏感信息的安全。如果您不提供这些信息,您将不能使用提现等相关功能,但不影响您继续使用本产品的其他服务。</p>
<p>4.为保护用户权益,开启实名认证后我们将不提供解除恢复的功能,请谅解。</p>
<p>5.一个身份证最多用于10个用户账号的实名认证。</p>
<p>5.一个身份证最多用于2个用户账号的实名认证。</p>
<p>6.若人脸认证遇到问题,<a href="../rule/identity-rule.html">请点击这里</a></p>
</div>
<div class="button-submit">开始认证</div>
@@ -64,12 +64,12 @@
</label>
</div>
</div>
<div class="toast">测试文案</div>
<div class="toast"></div>
<div class="status-mask">
<div class="wrapper">
<div class="pic"></div>
<div class="text">fewf</div>
<div class="tips">fwefw</div>
<div class="text"></div>
<div class="tips"></div>
<!-- <button class="goto-change hide">我要修改</button> -->
</div>
</div>
@@ -89,17 +89,9 @@
<script src="../../common/js/common2.js"></script>
<script src="../../common/js/vconsole.min.js"></script>
<script src="../../common/js/crypto-js.js"></script>
<script src="./js/new.js?v=1.0"></script>
<script>
var locateObj = getQueryString();
var appname = $('.appname');
if (locateObj.platform == "planet") {
appname.html("hello处CP");
$('.link-1').attr('href', '../rule/live-protocol.html?platform=planet')
} else {
appname.html("Mew");
}
</script>
<script src="../../common/js/layer.js"></script>
<script src="./js/jsvm_all.js"></script>
<script src="./js/new.js?=2.3"></script>
</body>
</html>