迅睿開源框架是一款PHP8高性能·簡單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設計理念, 支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務經(jīng)理
微信掃描以上二維碼
028-61286886
技術咨詢
請問 微信掃碼登錄的二維碼 標簽 dayrui/App/Weixin/Views/login_qrcode.html 里面的 {$qrcode_url} 標簽 在首頁直接調取 實現(xiàn)在首頁就能直接掃碼登錄
插件版權:官方插件插件名稱:微信系統(tǒng)
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復@迅??蚣苈?lián)合創(chuàng)始人 我也想知道他是怎么寫的,但是我看了一下他的源代碼 看不出來標簽是怎么寫的
<a href="javascript:;dr_wx_login()"> 微信掃碼登錄 </a> <script> function dr_wx_login() { layer.open({ type: 2, title: '微信掃碼登錄', shadeClose: false, shade: 0.8, area: ['380px', '430px'], content: '/index.php?s=api&c=oauth&m=index&name=wechat&type=login&back=' }); } </script>
新建模板:
<html> <head> <title>關注微信公眾號</title> <meta charset="utf-8"> <script src="{THEME_PATH}assets/global/plugins/jquery.min.js?v={CMF_UPDATE_TIME}" type="text/javascript"></script> <script src="{$THEME_PATH}assets/js/cms.js?v={CMF_UPDATE_TIME}" type="text/javascript"></script> <style> a { height: 16px; line-height: 16px; padding: 0 3px; background-color: #3fa9e2; text-decoration: none; color: #fff; border-radius: 2px; font-style: inherit; } </style> </head> <body style="text-align:center"> <img width="90%" src="{$qrcode_url}"> <br><a href="javascript:dr_weixin_notify();">掃碼之后單擊登錄網(wǎng)站</a> <script> function dr_weixin_notify() { $.ajax({ type : "get", url : "{$notify_url}", dataType : "json", success : function(json){ if (json.code == 1) { dr_tips(1, '登錄成功'); var oss_url = json.data.sso; // 發(fā)送同步登錄信息 for(var i in oss_url){ $.ajax({ type: "GET", url:oss_url[i], dataType: "jsonp", success: function(json){ }, error: function(){ } }); } if (json.data.url) { setTimeout("top.location.href = '"+json.data.url+"'", 2000); } else{ setTimeout("top.location.href = '{$back_url}'", 2000); } } else { dr_tips(0, '沒有收到掃碼信息'); } }, error:function(){ } }); } </script> </body> </html>
回復@迅??蚣苈?lián)合創(chuàng)始人 掃碼成功后需要手動點一下 才能成功登錄,我記得之前官網(wǎng)上的是掃碼登錄成功自動跳轉的 咋吧自動跳轉給刪除了
把登錄函數(shù)改成ajax定時請求不就可以了么,js改改就行
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復@迅??蚣苈?lián)合創(chuàng)始人 我也想知道他是怎么寫的,但是我看了一下他的源代碼 看不出來標簽是怎么寫的
<a href="javascript:;dr_wx_login()"> 微信掃碼登錄 </a> <script> function dr_wx_login() { layer.open({ type: 2, title: '微信掃碼登錄', shadeClose: false, shade: 0.8, area: ['380px', '430px'], content: '/index.php?s=api&c=oauth&m=index&name=wechat&type=login&back=' }); } </script>新建模板:

<html> <head> <title>關注微信公眾號</title> <meta charset="utf-8"> <script src="{THEME_PATH}assets/global/plugins/jquery.min.js?v={CMF_UPDATE_TIME}" type="text/javascript"></script> <script src="{$THEME_PATH}assets/js/cms.js?v={CMF_UPDATE_TIME}" type="text/javascript"></script> <style> a { height: 16px; line-height: 16px; padding: 0 3px; background-color: #3fa9e2; text-decoration: none; color: #fff; border-radius: 2px; font-style: inherit; } </style> </head> <body style="text-align:center"> <img width="90%" src="{$qrcode_url}"> <br><a href="javascript:dr_weixin_notify();">掃碼之后單擊登錄網(wǎng)站</a> <script> function dr_weixin_notify() { $.ajax({ type : "get", url : "{$notify_url}", dataType : "json", success : function(json){ if (json.code == 1) { dr_tips(1, '登錄成功'); var oss_url = json.data.sso; // 發(fā)送同步登錄信息 for(var i in oss_url){ $.ajax({ type: "GET", url:oss_url[i], dataType: "jsonp", success: function(json){ }, error: function(){ } }); } if (json.data.url) { setTimeout("top.location.href = '"+json.data.url+"'", 2000); } else{ setTimeout("top.location.href = '{$back_url}'", 2000); } } else { dr_tips(0, '沒有收到掃碼信息'); } }, error:function(){ } }); } </script> </body> </html>開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復@迅??蚣苈?lián)合創(chuàng)始人 掃碼成功后需要手動點一下 才能成功登錄,我記得之前官網(wǎng)上的是掃碼登錄成功自動跳轉的 咋吧自動跳轉給刪除了
把登錄函數(shù)改成ajax定時請求不就可以了么,js改改就行