478089a61fc67cb6e7d67bc4348827ed.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:79:"D:\phpstudy_pro\WWW\minongyun\public/../application/admin\view\index\login.html";i:1709714141;s:69:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\meta.html";i:1709714141;s:71:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\script.html";i:1711415624;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  8. <meta name="renderer" content="webkit">
  9. <meta name="referrer" content="never">
  10. <meta name="robots" content="noindex, nofollow">
  11. <link rel="shortcut icon" href="/assets/img/favicon.ico" />
  12. <!-- Loading Bootstrap -->
  13. <link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
  14. <?php if(\think\Config::get('fastadmin.adminskin')): ?>
  15. <link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
  16. <?php endif; ?>
  17. <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
  18. <!--[if lt IE 9]>
  19. <script src="/assets/js/html5shiv.js"></script>
  20. <script src="/assets/js/respond.min.js"></script>
  21. <![endif]-->
  22. <script type="text/javascript">
  23. var require = {
  24. config: <?php echo json_encode($config); ?>
  25. };
  26. </script>
  27. <style type="text/css">
  28. body {
  29. color: #999;
  30. background-color: #f1f4fd;
  31. background-size: cover;
  32. }
  33. a {
  34. color: #444;
  35. }
  36. .login-screen {
  37. max-width: 400px;
  38. padding: 0;
  39. margin: 100px auto 0 auto;
  40. }
  41. .login-screen .well {
  42. border-radius: 3px;
  43. -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  44. box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  45. background: rgba(255,255,255, 0.2);
  46. }
  47. @media (max-width: 767px) {
  48. .login-screen {
  49. padding: 0 20px;
  50. }
  51. }
  52. .profile-img-card {
  53. width: 100px;
  54. height: 100px;
  55. display: block;
  56. -moz-border-radius: 50%;
  57. -webkit-border-radius: 50%;
  58. border-radius: 50%;
  59. margin: 10px auto;
  60. /*border: 5px solid #fff;*/
  61. }
  62. .profile-name-card {
  63. text-align: center;
  64. }
  65. .login-head {
  66. background: #899fe1;
  67. }
  68. /* .login-form {
  69. padding: 40px 30px;
  70. position: relative;
  71. z-index: 99;
  72. }*/
  73. #login-form {
  74. margin-top: 20px;
  75. }
  76. #login-form .input-group {
  77. margin-bottom: 15px;
  78. }
  79. #login-form .form-control {
  80. font-size: 13px;
  81. }
  82. #sms{
  83. display: none;
  84. }
  85. .change_login{
  86. margin: 0 auto;
  87. text-align: center;
  88. /*padding-top: 20px;*/
  89. font-size: 20px;
  90. }
  91. #pass_login{
  92. color: #fff;
  93. text-decoration: underline;
  94. cursor:pointer
  95. }
  96. #sms_login{
  97. cursor:pointer;
  98. color:#333;
  99. }
  100. #sms_login:hover,#pass_login:hover{
  101. color: #fff;
  102. text-decoration: underline;
  103. }
  104. #captcha{
  105. margin-top: 20px;
  106. }
  107. #captcha .input-group {
  108. margin-bottom: 15px;
  109. }
  110. </style>
  111. <!--@formatter:off-->
  112. <?php if($background): ?>
  113. <style type="text/css">
  114. body{
  115. background-image: url('<?php echo $background; ?>');
  116. }
  117. </style>
  118. <?php endif; ?>
  119. <!--@formatter:on-->
  120. <script src="/assets/js/jquery.js"></script>
  121. </head>
  122. <body>
  123. <div class="container">
  124. <div class="login-wrapper">
  125. <div class="login-screen">
  126. <div class="well">
  127. <!-- <div class="login-head">-->
  128. <div class="change_login"><span id="pass_login">密码登录</span> | <span id="sms_login">验证码登录</span></div>
  129. <!-- <img src="/assets/img/login-head.png" style="width:100%;"/>-->
  130. <!-- </div>-->
  131. <div class="login-form" id="pass">
  132. <img id="profile-img" class="profile-img-card" src="/assets/img/avatar.png"/>
  133. <p id="profile-name" class="profile-name-card"></p>
  134. <form action="" method="post" id="login-form">
  135. <!--@AdminLoginFormBegin-->
  136. <div id="errtips" class="hide"></div>
  137. <?php echo token(); ?>
  138. <div class="input-group">
  139. <div class="input-group-addon"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></div>
  140. <input type="text" class="form-control" id="pd-form-username" placeholder="<?php echo __('Username'); ?>" name="username" autocomplete="off" value="" data-rule="<?php echo __('Username'); ?>:required;username"/>
  141. </div>
  142. <div class="input-group">
  143. <div class="input-group-addon"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></div>
  144. <input type="password" class="form-control" id="pd-form-password" placeholder="<?php echo __('Password'); ?>" name="password" autocomplete="off" value="" data-rule="<?php echo __('Password'); ?>:required;password"/>
  145. </div>
  146. <!--@CaptchaBegin-->
  147. <?php if(\think\Config::get('fastadmin.login_captcha')): ?>
  148. <div class="input-group">
  149. <div class="input-group-addon"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></div>
  150. <input type="text" name="captcha" class="form-control" placeholder="<?php echo __('Captcha'); ?>" data-rule="<?php echo __('Captcha'); ?>:required;length(<?php echo \think\Config::get('captcha.length'); ?>)" autocomplete="off"/>
  151. <span class="input-group-addon" style="padding:0;border:none;cursor:pointer;">
  152. <img src="<?php echo rtrim('/', '/'); ?>/index.php?s=/captcha" width="100" height="30" onclick="this.src = '<?php echo rtrim('/', '/'); ?>/index.php?s=/captcha&r=' + Math.random();"/>
  153. </span>
  154. </div>
  155. <?php endif; ?>
  156. <!--@CaptchaEnd-->
  157. <div class="form-group checkbox">
  158. <label class="inline" for="keeplogin">
  159. <input type="checkbox" name="keeplogin" id="keeplogin" value="1"/>
  160. <?php echo __('Keep login'); ?>
  161. </label>
  162. </div>
  163. <div class="form-group">
  164. <button type="submit" class="btn btn-success btn-lg btn-block"><?php echo __('Sign in'); ?></button>
  165. </div>
  166. <!--@AdminLoginFormEnd-->
  167. </form>
  168. </div>
  169. <!-- 验证码登录 -->
  170. <div class="login-form" id="sms">
  171. <img id="profile-img" class="profile-img-card" src="/assets/img/avatar.png" />
  172. <p id="profile-name" class="profile-name-card"></p>
  173. <form action="" method="post" id="captcha">
  174. <div id="errtips" class="hide"></div>
  175. <?php echo token(); ?>
  176. <div class="input-group">
  177. <div class="input-group-addon"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></div>
  178. <input type="text" class="form-control" id="pd-form-mobile" placeholder="<?php echo __('Mobile'); ?>" name="mobile" autocomplete="off" value="" />
  179. <div class="input-group-addon" id="getcaptcha" style="cursor:pointer;"><span id="get-captcha"><?php echo __('Get captcha'); ?></span></div>
  180. </div>
  181. <div class="input-group">
  182. <div class="input-group-addon"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></div>
  183. <input type="password" class="form-control" id="pd-form-Captcha" placeholder="<?php echo __('Captcha'); ?>" name="captcha" autocomplete="off" value="" />
  184. </div>
  185. <div class="form-group checkbox">
  186. <label class="inline" for="keeplogin">
  187. <input type="checkbox" name="keeplogin" id="keeplogin" value="1"/>
  188. <?php echo __('Keep login'); ?>
  189. </label>
  190. </div>
  191. <div class="form-group">
  192. <button type="submit" class="btn btn-success btn-lg btn-block"><?php echo __('Sign in'); ?></button>
  193. </div>
  194. </form>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. <script>
  201. // 切换选项卡
  202. $("#sms_login").click(function(){
  203. $(this).css('display','inline-block').css('text-decoration','underline').css('color','#fff');
  204. $("#pass_login").css('text-decoration','none').css('color','#333');
  205. $("#sms").css('display','block');
  206. $("#pass").css('display','none');
  207. })
  208. $("#pass_login").click(function(){
  209. $(this).css('display','inline-block').css('text-decoration','underline').css('color','#fff');
  210. $("#sms_login").css('text-decoration','none').css('color','#333');
  211. $("#sms").css('display','none');
  212. $("#pass").css('display','block');
  213. })
  214. //手机号失焦
  215. $("#pd-form-mobile").blur(()=>{
  216. let mobile = $("#pd-form-mobile").val()
  217. localStorage.setItem("mobile", mobile);
  218. })
  219. var sec=60;
  220. var countdown
  221. //获取验证码
  222. $("#getcaptcha").click(()=>{
  223. if(sec !== 60){
  224. return false;
  225. }
  226. let mobile = $("#pd-form-mobile").val()
  227. let regExp = new RegExp("^1[3578]\\d{9}$");
  228. if(regExp.test(mobile)){
  229. $.post('index/getCaptcha',{mobile:mobile},(res)=>{
  230. console.log(res);
  231. })
  232. //立马触发,,防止暴力点击
  233. setTimeout(()=>{
  234. $("#get-captcha").html('60秒后重新获取');
  235. sec--;
  236. },0)
  237. }else{
  238. layer.confirm('请输入正确的手机号');
  239. }
  240. countdown = setInterval(()=>{
  241. $("#get-captcha").html(sec+'秒后重新获取');
  242. sec--;
  243. // console.log(sec);
  244. if(sec < 0){
  245. clearInterval(countdown);
  246. sec=60;
  247. $("#get-captcha").html("<?php echo __('Get captcha'); ?>");
  248. }
  249. },1000)
  250. })
  251. //如果有缓存,读缓存,,,方便用户密码错误后不用重新输入电话号
  252. $(function(){
  253. let mobile = localStorage.getItem("mobile");
  254. if(mobile){
  255. $("#pd-form-mobile").val(mobile)
  256. }
  257. });
  258. </script>
  259. <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
  260. <input type="hidden" value="<?php echo \think\Session::get('admin.username'); ?>" name="" id="username">
  261. <input type="hidden" value="<?php echo \think\Session::get('admin.company'); ?>" name="" id="company">
  262. <script>
  263. function watermark(element, config) {
  264. // 获取元素的坐标
  265. function getOffset(el) {
  266. if (el.offsetParent) {
  267. return {
  268. x: el.offsetLeft + getOffset(el.offsetParent).x,
  269. y: el.offsetTop + getOffset(el.offsetParent).y,
  270. };
  271. }
  272. return {
  273. x: el.offsetLeft,
  274. y: el.offsetTop,
  275. };
  276. }
  277. if (!element) return;
  278. // 默认配置
  279. const _config = {
  280. text1: '张三', //文本1
  281. text2: '13868686868', // 文本2
  282. start_x: 0, // x轴起始位置
  283. start_y: 0, // y轴起始位置
  284. space_x: 100, // x轴间距
  285. space_y: 50, // y轴间距
  286. width: 210, // 宽度
  287. height: 80, // 长度
  288. fontSize: 14, // 字体
  289. color: '#aaa', // 字色
  290. alpha: 0.4, // 透明度
  291. rotate: 15, // 倾斜度
  292. };
  293. // 替换默认配置
  294. if (arguments.length === 2 && typeof arguments[1] === "object") {
  295. const src = arguments[1] || {};
  296. for (let key in src) {
  297. if (src[key] && _config[key] && src[key] === _config[key]) {
  298. continue;
  299. } else if (src[key]) {
  300. _config[key] = src[key];
  301. }
  302. }
  303. }
  304. // 节点的总宽度
  305. const total_width = element.scrollWidth;
  306. // 节点的总高度
  307. const total_height = element.scrollHeight;
  308. // 创建文本碎片,用于包含所有的插入节点
  309. const mark = document.createDocumentFragment();
  310. // 水印节点的起始坐标
  311. const position = getOffset(element);
  312. let x = position.x + _config.start_x, y = position.y + _config.start_y;
  313. // 先循环y轴插入水印
  314. do {
  315. // 再循环x轴插入水印
  316. do {
  317. // 创建单个水印节点
  318. const item = document.createElement('div');
  319. item.className = 'watermark-item';
  320. // 设置节点的样式
  321. item.style.position = "absolute";
  322. item.style.zIndex = 99999;
  323. item.style.left = `${x}px`;
  324. item.style.top = `${y}px`;
  325. item.style.width = `${_config.width}px`;
  326. item.style.height = `${_config.height}px`;
  327. item.style.fontSize = `${_config.fontSize}px`;
  328. item.style.color = _config.color;
  329. item.style.textAlign = 'center';
  330. item.style.opacity = _config.alpha;
  331. item.style.filter = `alpha(opacity=${_config.alpha * 100})`;
  332. // item.style.filter = `opacity(${_config.alpha * 100}%)`;
  333. item.style.webkitTransform = `rotate(-${_config.rotate}deg)`;
  334. item.style.MozTransform = `rotate(-${_config.rotate}deg)`;
  335. item.style.msTransform = `rotate(-${_config.rotate}deg)`;
  336. item.style.OTransform = `rotate(-${_config.rotate}deg)`;
  337. item.style.transform = `rotate(-${_config.rotate}deg)`;
  338. item.style.pointerEvents = 'none'; //让水印不遮挡页面的点击事件
  339. // 创建text1水印节点
  340. const text1 = document.createElement('div');
  341. text1.appendChild(document.createTextNode(_config.text1));
  342. item.append(text1);
  343. // 创建text2水印节点
  344. const text2 = document.createElement('div');
  345. text2.appendChild(document.createTextNode(_config.text2));
  346. item.append(text2);
  347. // 添加水印节点到文本碎片
  348. mark.append(item);
  349. // x坐标递增
  350. x = x + _config.width + _config.space_x;
  351. // 超出文本右侧坐标停止插入
  352. } while (total_width + position.x > x + _config.width);
  353. // 重置x初始坐标
  354. x = position.x + _config.start_x;
  355. // y坐标递增
  356. y = y + _config.height + _config.space_y;
  357. // 超出文本底部坐标停止插入
  358. } while (total_height + position.y > y + _config.height);
  359. // 插入文档碎片
  360. element.append(mark);
  361. }
  362. var username = document.getElementById('username');
  363. var company = document.getElementById('company');
  364. //找到存放水印的盒子
  365. const element = document.getElementsByTagName('body')[0];
  366. watermark(element,{text1:username.value,text2:company.value});
  367. </script>
  368. </body>
  369. </html>