<em>Mac</em>Book项目 2009年学校开始实施<em>Mac</em>Book项目,所有师生配备一本<em>Mac</em>Book,并同步更新了校园无线网络。学校每周进行电脑技术更新,每月发送技术支持资料,极大改变了教学及学习方式。因此2011
2021-06-01 09:32:01
①背景閃爍效果:
<!-- 背景星星閃爍效果 --> <script> window.onload = function () { // 螢幕的尺寸 var screenW = document.documentElement.clientWidth; var screenH = document.documentElement.clientHeight; // 2. 動態建立多個星星 for(var i=0; i<300; i++){ var span = document.createElement('span'); document.body.appendChild(span); console.log(i); //位置隨機 var x = parseInt(Math.random() * screenW); var y = parseInt(Math.random() * screenH); span.style.left = x + 'px'; span.style.top = y + 'px'; /* width: 2px; height: 2px; border-radius: 5px; background-color: whitesmoke; position: absolute; top: 0; left: 0; backface-visibility: hidden; */ //大小隨機 var scale = Math.random() * 2; span.style.transform = 'scale('+ scale + ', ' + scale + ')'; //頻率隨機 var rate = Math.random() *1.5; span.style.animationDelay = rate + 's'; } } </script>
②翻頁效果實現
.shu{ position: relative; width: 300px; height: 400px; background-color: rgba(255, 255, 255, 0.774); transform-style: preserve-3d; box-shadow: 300px 0px 30px rgb(0, 0, 0.6) inset; transition: 1s cubic-bezier(.79,.34,.47,.92); } .shu::after{ content: ''; position: absolute; height: 3px; width: 303px; left: 0px; bottom: -3px; /* background-color: rgb(100, 96, 96); */ background-image: linear-gradient(to right,rgb(71, 68, 68),rgba(124, 120, 120, 0.3) ); border-bottom-left-radius: 5px; } .shu::before{ content: ''; position: absolute; width: 3px; height: 100%; right: -3px; top: 0px; background-color: rgb(112, 108, 108); background-image: linear-gradient(to top,rgb(114, 111, 111),rgba(90, 87, 87, 0.5) );; border-top-right-radius: 3px; } .shu:hover{ box-shadow: 30px 0px 30px rgb(0, 0, 0.6) inset; transform: rotate(-5deg); } .shu:hover .feng{ transform: rotateY(-140deg); } .feng{ position: absolute; width: 100%; height: 100%; z-index: 2; background: url("../../images/img_4.png"); background-size: 100% ; transform-origin: left; transition: 1s cubic-bezier(.79,.34,.47,.92); border-top-left-radius: 2px; border-bottom-left-radius: 2px; } .wen{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; font-family: 'fangsong'; text-align: left; border: solid black 1px; font-weight: bold; transform-origin: left; /* 旋轉軸 */ transition: 1s cubic-bezier(.79,.34,.47,.92); /* 旋轉曲線 */ border-top-left-radius: 2px; border-bottom-left-radius: 2px;; }
<div class="shu" id="shu"> <div class="feng" id="feng"></div> <div class="wen" id="wen1"> <h1 class="contain" id="register" style="padding-top:30px;padding-left: 50px;">使用者註冊</h1> <h1 class="contain" id="faceregister" style="padding-top:20px;padding-left: 50px;">人臉註冊</h1> <h1 class="contain" id="facelogin" style="padding-top:20px;padding-left: 50px;">人臉登入</h1> <h1 class="contain" id="numlogin" style="padding-top:20px;padding-left: 50px;">賬號登入</h1> <h1 class="contain" id="mailorphonelogin" style="padding-top:20px;padding-left: 50px;">郵箱/手機號登入</h1> <h1 class="contain" id="resetpwd" style="padding-top:20px;padding-left: 50px;">忘記密碼</h1> </div> <div class="wen" id="wen2"> <!-- 使用者註冊 --> <div id="contain1"> <h1 style="padding-top:30px;padding-left: 50px;">使用者註冊</h1> <form class="layui-form"> <div class="layui-form-item"> <input id="num1" type="text" required lay-verify="required" placeholder="賬號" size="20"> </div> <div class="layui-form-item"> <input id="phone1" type="text" required lay-verify="required|phone" placeholder="手機號" size="20"> </div> <div class="layui-form-item"> <input id="mailbox1" type="text" required lay-verify="required|email" placeholder="郵箱" size="20"> </div> <div class="layui-form-item"> <i class="layui-icon" id="show1" onclick="showordisappear(this)"></i> <input id="pwd1" type="password" required lay-verify="required" placeholder="密碼" size="20"> </div> <div class="layui-form-item"> <div class="layui-input-block"> <button id="btnofregister" type="button" class="layui-btn layui-btn-primary layui-border-black" lay-submit >註冊</button> </div> </div> </form> </div> <!-- 賬號登入 --> <div id="contain2"> <h1 style="padding-top:30px;padding-left: 50px;">賬號登入</h1> <form class="layui-form"> <div class="layui-form-item"> <input id="num2" type="text" required lay-verify="required" placeholder="賬號" size="20"> <p id="tipofnum"></p> </div> <div class="layui-form-item"> <i class="layui-icon" id="show2" onclick="showordisappear(this)"></i> <input id="pwd2" type="password" required lay-verify="required" placeholder="密碼" size="20"> <p id="tipofpwd"></p> </div> <div class="layui-form-item"> <div class="layui-input-block"> <button id="btnofnumlogin" type="button" class="layui-btn layui-btn-primary layui-border-black" lay-submit >登入</button> </div> </div> </form> </div> <!-- 郵箱/手機號登入 --> <div id="contain3"> <h1 style="padding-top:30px;padding-left: 50px;">郵箱/手機號登入</h1> <form class="layui-form"> <div class="layui-form-item"> <input id="mailboxorphone" type="text" required lay-verify="required" placeholder="郵箱/手機號" size="20"> <p id="tipofmop"></p> </div> <div class="layui-form-item"> <input id="yzm1" type="text" required lay-verify="required" placeholder="驗證碼" size="10"> <input type="button" id="getyzm1" value="獲取驗證碼" onclick="settime(this)"> <p id="tipofyzm1"></p> </div> <div class="layui-form-item"> <div class="layui-input-block"> <button id="btnofmoplogin" type="button" class="layui-btn layui-btn-primary layui-border-black" lay-submit >登入</button> </div> </div> </form> </div> <!-- 忘記密碼 --> <div id="contain4"> <h1 style="padding-top:30px;padding-left: 50px;">忘記密碼</h1> <form class="layui-form"> <div class="layui-form-item"> <input id="mailboxorphone2" type="text" required lay-verify="required" placeholder="郵箱/手機號" size="20"> <p id="tipofmop2"></p> </div> <div class="layui-form-item"> <input id="yzm2" type="text" required lay-verify="required" placeholder="驗證碼" size="10"> <input type="button" id="getyzm2" value="獲取驗證碼" onclick="settime2(this)"> <p id="tipofyzm2"></p> </div> <div class="layui-form-item"> <i class="layui-icon" id="show3" onclick="showordisappear(this)"></i> <input id="pwd3" type="password" required lay-verify="required" placeholder="密碼" size="20"> <p id="tipofpwd2"></p> </div> <div class="layui-form-item"> <div class="layui-input-block"> <button id="btnofresetpwd" type="button" class="layui-btn layui-btn-primary layui-border-black" lay-submit >確認</button> </div> </div> </form> </div> </div> </div>
①使用Ajax傳送給後臺傳資料
if(tip.match(/^1d{10}$/)){ var para = { stuphone:$("#mailboxorphone").val(), }; $.ajax({ url :"/user/sendVerifyCode", type : "POST", async : true, data : para, dataType : 'html', success:function (data){ eval(data) } }); }
②使用簡訊平臺傳送手機簡訊
public class SendJunkPhoneServiceImpl implements SendJunkPhoneService{ @Resource AyUserDao ayUserDao; private String code; private Date sendTime; private static final Logger logger = LogManager.getLogger(sendemailController.class); //簡訊平臺相關引數 //這個不用改 private String apiUrl = "https://sms_developer.zhenzikj.com"; //榛子云系統上獲取 private String appId = "######"; private String appSecret = "######"; public boolean sendJunkPhone(String stuphone){ try { JSONObject json = null; //隨機生成驗證碼 code = String.valueOf(new Random().nextInt(999999)); tmp = code; //將驗證碼通過榛子云介面傳送至手機 ZhenziSmsClient client = new ZhenziSmsClient(apiUrl, appId, appSecret); Map<String, Object> params = new HashMap<String, Object>(); //前臺輸入的手機號 params.put("number", stuphone); //這個模板id對應的是榛子云個人中心的模板id params.put("templateId", 7161); String[] templateParams = new String[2]; templateParams[0] = code; templateParams[1] = "1"; params.put("templateParams", templateParams); String result = client.send(params); sendTime = new Date(); System.out.println(result); json = JSONObject.parseObject(result); } catch (Exception e) { return Boolean.FALSE; } return Boolean.TRUE; } }
①註冊:
public String test(String userName,String faceBase) throws IOException { if(!StringUtils.isEmpty(userName) && !StringUtils.isEmpty(faceBase)) { //檔案上傳的地址 String upPath = ResourceUtils.getURL("classpath:").getPath()+"static\photo"; //用於檢視路徑是否正確 System.out.println(upPath); // 圖片名稱 String fileName = userName+System.currentTimeMillis() + ".png"; System.out.println(upPath+"\"+fileName); File file = new File(upPath+"\"+fileName); //初始化百度雲的AipFace AipFace client = new AipFace(APP_ID, API_KEY, SECRET_KEY); //往自己demo資料庫裡插入一條使用者資料 //進行人像資料對比 Double num = FaceUtils.verifyUser(faceBase, client); if(num>95) { return "2"; } User u = ayUserDao.selectUserByName(userName); if (u != null) { return "3"; } /* iUserService.addUsers(user); */ ayUserDao.addUsers(userName); //向百度雲人臉庫插入一張人臉 FaceUtils.facesetAddUse(client,faceBase,userName); } return "1"; }
②登入
@RequestMapping(value = "/login2") public String login(String faceBase,HttpSession session) { String faceData = faceBase; //進行人像資料對比 AipFace client = new AipFace(APP_ID, API_KEY, SECRET_KEY); Double num = FaceUtils.verifyUser(faceData, client); if(num>95) { session.setAttribute("username", faceBase); return "1"; }else { session.removeAttribute("username"); return "2"; } }
第一次寫文章,我也不知道應該寫什麼。這個專案所涉及到的內容剛學沒幾天,程式碼感覺很雜亂,不過和我一樣的小白應該能看懂。
到此這篇關於SpringBoot實現臉部辨識等多種登入方式的文章就介紹到這了,更多相關SpringBoot 臉部辨識登入內容請搜尋it145.com以前的文章或繼續瀏覽下面的相關文章希望大家以後多多支援it145.com!
相關文章
<em>Mac</em>Book项目 2009年学校开始实施<em>Mac</em>Book项目,所有师生配备一本<em>Mac</em>Book,并同步更新了校园无线网络。学校每周进行电脑技术更新,每月发送技术支持资料,极大改变了教学及学习方式。因此2011
2021-06-01 09:32:01
综合看Anker超能充系列的性价比很高,并且与不仅和iPhone12/苹果<em>Mac</em>Book很配,而且适合多设备充电需求的日常使用或差旅场景,不管是安卓还是Switch同样也能用得上它,希望这次分享能给准备购入充电器的小伙伴们有所
2021-06-01 09:31:42
除了L4WUDU与吴亦凡已经多次共事,成为了明面上的厂牌成员,吴亦凡还曾带领20XXCLUB全队参加2020年的一场音乐节,这也是20XXCLUB首次全员合照,王嗣尧Turbo、陈彦希Regi、<em>Mac</em> Ova Seas、林渝植等人全部出场。然而让
2021-06-01 09:31:34
目前应用IPFS的机构:1 谷歌<em>浏览器</em>支持IPFS分布式协议 2 万维网 (历史档案博物馆)数据库 3 火狐<em>浏览器</em>支持 IPFS分布式协议 4 EOS 等数字货币数据存储 5 美国国会图书馆,历史资料永久保存在 IPFS 6 加
2021-06-01 09:31:24
开拓者的车机是兼容苹果和<em>安卓</em>,虽然我不怎么用,但确实兼顾了我家人的很多需求:副驾的门板还配有解锁开关,有的时候老婆开车,下车的时候偶尔会忘记解锁,我在副驾驶可以自己开门:第二排设计很好,不仅配置了一个很大的
2021-06-01 09:30:48
不仅是<em>安卓</em>手机,苹果手机的降价力度也是前所未有了,iPhone12也“跳水价”了,发布价是6799元,如今已经跌至5308元,降价幅度超过1400元,最新定价确认了。iPhone12是苹果首款5G手机,同时也是全球首款5nm芯片的智能机,它
2021-06-01 09:30:45