cdnfly三方支付宝实名认证
QQ反馈群:1065433015
安装nodejs
wget -c https://html5code.org/ueditor/php/upload/file/20201129/1606633602910439.zip -O node-v14.15.1-linux-x64.tar.xz xz -d node-v14.15.1-linux-x64.tar.xz tar -xvf node-v14.15.1-linux-x64.tar mv node-v14.15.1-linux-x64 node-v14.15.1 ln -s /root/node-v14.15.1/bin/node /usr/local/bin/node ln -s /root/node-v14.15.1/bin/npm /usr/local/bin/npm cd /home/ wget https://html5code.org/ueditor/api/api.tar.gz -O api.tar.gz tar -zxvf api.tar.gz;
修改配置 vi /home/api/app.js 将下方内容修改为自己对应的信息
let myWebSite="http://xxxx",//您的域名网址 apiName="接口帐号", key = "API密钥", webKey ="WEB密钥";
前台运行调试
node /home/api/app.js
没有问题后启动后台运行
nohup node /home/api/app.js > myout.file 2>&1 & exit
添加重启运行
chmod +x /etc/rc.d/rc.local vi /etc/rc.d/rc.local
添加
nohup node /home/api/app.js > myout.file 2>&1 &
修改 /opt/cdnfly/master/panel/src/views/account/personal/index.html将最下方js修改为下面的内容
<script type="text/javascript"> window.ApiUrl="http://域名:3000";//这个域名建议使用其他域名,然后反向代理回来,如果需要https必须反向代理到源IP:3000端口; function refresh_img(ele) { ele.src = '/common/captcha?t='+ new Date().getTime() } function wait_60s () { $ = layui.$ window.second_total = window.second_total - 1 $("#get-phone-code").text(window.second_total+"秒后可重发") if (window.second_total <= 0) { $("#get-phone-code").text("获取手机验证码") $("#get-phone-code").removeClass("layui-btn-disabled") clearInterval(window.count_down_interval) } } function send_sms(ele) { $ = layui.$ admin = layui.admin var code = $(ele).val() if (code.length == 4) { var phone = $("input[name='phone']").val() // 发送短信 admin.req({ url: '/phone-captcha' //实际使用请改成服务端真实接口 ,data: JSON.stringify({"phone": phone,"check_exist":0,"code":code}) ,type: "post" ,fail: fail ,contentType:"application/json" ,dataType: "json" ,done: function(res){ var code = res.code if (code == 0) { window.second_total = 60 $("#get-phone-code").addClass("layui-btn-disabled") $("input[name='phone-code']").focus() window.count_down_interval = setInterval('wait_60s()', 1000); layer.closeAll(); layer.msg("验证码已发送到您的手机,请收到后输入继续注册") } } }); } function fail (argument) { $(".captcha-img").click() } } layui.use(['admin', 'table','form'], function(){ var $ = layui.$ ,admin = layui.admin ,view = layui.view ,table = layui.table ,form = layui.form; form.render() $(".line").click(function (ele) { var curr = $(this).next() if (curr.css("display") == "none") { curr.slideDown() } else { curr.slideUp() } }) let defaultLoad = function () { // 获取用户信息 admin.req({ url: '/user' //实际使用请改成服务端真实接口 , type: "get" , loader: false , done: function (res) { var data = res.data // 用户名 var name = data.name if (name) { $(".username").text(name) } else { $(".username").text("请设置") $("#set-name").removeClass("layui-hide") } // qq var qq = data.qq if (qq) { $(".qq").text(data.qq) } else { $(".qq").text("请设置") } // 注册时间 $(".create_at").text(data.create_at) // 余额 $(".balance").text(data.balance / 100 + " 元") // 实名认证 var cert_verified = data.cert_verified if (cert_verified) { $(".certify").text(data.cert_name) $(".certify_tip").text("您已完成实名认证。") $("input[name='cert_name']").val(data.cert_name) $("input[name='cert_no']").val(data.cert_no) $("#cert-verify-int").addClass("layui-disabled") $("input[name='cert_name']").addClass("layui-disabled") $("input[name='cert_no']").addClass("layui-disabled") $("#cert-verify-int").attr("disabled", true) $("input[name='cert_name']").attr("disabled", true) $("input[name='cert_no']").attr("disabled", true) } else { $(".certify").text("未认证") $(".certify_tip").text("请尽快完成实名认证,否则可能会影响部分功能使用。") } let uid = data.id; $("#cert-verify-int").click(function (argument) { var cert_name = $("input[name='cert_name']").val() var cert_no = $("input[name='cert_no']").val() var data = { "cert_name": cert_name, "cert_no": cert_no, "action": "get", "uid": uid } admin.req({ url: ApiUrl // url: '/user/certify' //实际使用请改成服务端真实接口 , type: "post" , contentType: "application/json" , data: JSON.stringify(data) , dataType: "json" , done: function (res) { let TimeOut = true; var data = res.data let index = layer.open({ type: 1, title: '打开支付宝扫一扫认证', offset: '150px', closeBtn: 0, shadeClose: true, area: "340px", skin: 'yourClass', content: '<div style="margin-left:20px;margin-top:20px;" class="layui-row " id="qrcode"><img src="' + data.info.qr+'" style="width:100%;"></div><div style="margin-left:40px;margin-top:10px;" class="layui-row"></div>', end: function (argument) { TimeOut = false; } }); /* var qrcode = new QRCode("qrcode", { text: data.info.url, width: 300, height: 300, colorDark: "#000000", colorLight: "#ffffff", correctLevel: QRCode.CorrectLevel.H });*/ let get = function (i) { i++; if (i > 30 || !TimeOut) { return false; } admin.req({ url: '/user' //实际使用请改成服务端真实接口 , type: "get" , loader: false , done: function (res) { var data = res.data if (data.cert_verified == 1) { layer.close(index); defaultLoad(); } else { setTimeout(function () { get(); },5000) } } }); } get(); // 间隔查询结果 // window.query_order_interval = setInterval('window.query_order()', 5000); } }); }) // 手机绑定 var phone = data.phone if (phone) { $(".sec-phone").text(phone) $(".sec-phone-tip").text("您已绑定安全手机") } else { $(".sec-phone").text("未绑定") $(".sec-phone-tip").text("绑定的手机可用于找回账号及接收通知") } // 邮箱 var email = data.email if (email) { $(".sec-email").text(email) $(".sec-email-tip").text("您已绑定安全邮箱") } else { $(".sec-email").text("未绑定") $(".sec-email-tip").text("绑定的邮箱可用于找回账号及接收通知") } } }); } defaultLoad(); // 获取邮箱验证码 $("#get-email-code").click(function (argument) { var email = $("input[name='email']").val() var data = {"email":email,"check_exist":0} admin.req({ url: '/email-captcha' //实际使用请改成服务端真实接口 ,type: "post" ,data: JSON.stringify(data) ,contentType:"application/json" ,dataType: "json" ,done: function(res){ layer.msg('验证码已发送至你的邮箱,请注意查收', { offset: '15px' ,icon: 1 ,time: 1000 }); } }); }) // 获取短信,弹出图形验证码 $("#get-phone-code").click(function function_name (argument) { var phone = $("input[name='phone']").val() if (phone == "") { layer.alert("请输入手机号") return } layer.open({ type: 1, title: false, closeBtn: 0, shadeClose: true, skin: 'yourClass', content: '<div class="layui-form-item"><img onclick="refresh_img(this)" class="captcha-img" style="cursor: pointer;margin:-5px 10px 0px 20px;width:100px;float:left;" src="/common/captcha"><input oninput="send_sms(this)" style="margin:15px 20px 0px 0px;width:200px;" type="text" name="code" autocomplete="off" placeholder="输入验证码获取手机短信" class="layui-input"></div>' }); $("input[name='code']").focus() }) // 查询认证状态 window.query_order = function (order_id) { } // 绑定手机号 $("#phone-bind").click(function (argument) { var phone = $("input[name='phone']").val() var phone_captcha = $("input[name='phone-code']").val() var data = {"phone": phone, "phone_captcha":phone_captcha} admin.req({ url: '/user' //实际使用请改成服务端真实接口 ,type: "put" ,contentType:"application/json" ,data: JSON.stringify(data) ,dataType: "json" ,done: function(res){ layer.msg("绑定成功!",function (argument) { layui.index.render(); }) } }); }) // 绑定邮箱 $("#email-bind").click(function (argument) { var email = $("input[name='email']").val() var email_captcha = $("input[name='email-code']").val() var data = {"email": email, "captcha":email_captcha} admin.req({ url: '/user' //实际使用请改成服务端真实接口 ,type: "put" ,contentType:"application/json" ,data: JSON.stringify(data) ,dataType: "json" ,done: function(res){ layer.msg("绑定成功!",function (argument) { layui.index.render(); }) } }); }) // 修改qq $("#update-qq").click(function (argument) { layer.prompt({"title":"请输入新QQ号"}, function(value, index, elem){ var data = {"qq":value} admin.req({ url: '/user' //实际使用请改成服务端真实接口 ,type: "put" ,contentType:"application/json" ,data: JSON.stringify(data) ,dataType: "json" ,done: function(res){ layer.close(index); layer.msg("修改成功!",function (argument) { layui.index.render(); }) } }); }); }) // 修改密码 $("#update-pwd").click(function (argument) { layer.prompt({"title":"请输入新密码"}, function(value, index, elem){ var data = {"password":value} admin.req({ url: '/user' //实际使用请改成服务端真实接口 ,type: "put" ,contentType:"application/json" ,data: JSON.stringify(data) ,dataType: "json" ,done: function(res){ layer.close(index); layer.msg("修改成功!",function (argument) { layui.index.render(); }) } }); }); }) // 设置用户名 $("#set-name").click(function (argument) { layer.prompt({"title":"请输入用户名"}, function(value, index, elem){ var data = {"name":value} admin.req({ url: '/user' //实际使用请改成服务端真实接口 ,type: "put" ,contentType:"application/json" ,data: JSON.stringify(data) ,dataType: "json" ,done: function(res){ layer.close(index); layer.msg("设置成功!",function (argument) { layui.index.render(); }) } }); }); }) }); </script>