使用fastadmin的页面跳转模板
1、效果图
2、修改tp默认跳转模板文件( /thinkphp/tpl/dispatch_jump.tpl ),将文件中的内容全部替换成下面的内容然后保存即可,注意替换语言包和图片路径
1 {__NOLAYOUT__}<!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <title>{:__('Warning')}</title> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7 <link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" /> 8 <style type="text/css"> 9 *{box-sizing:border-box;margin:0;padding:0;font-family:Lantinghei SC,Open Sans,Arial,Hiragino Sans GB,Microsoft YaHei,"微软雅黑",STHeiti,WenQuanYi Micro Hei,SimSun,sans-serif;-webkit-font-smoothing:antialiased} 10 body{padding:70px 0;background:#edf1f4;font-weight:400;font-size:1pc;-webkit-text-size-adjust:none;color:#333} 11 a{outline:0;color:#3498db;text-decoration:none;cursor:pointer} 12 .system-message{margin:20px 5%;padding:40px 20px;background:#fff;box-shadow:1px 1px 1px hsla(0,0%,39%,.1);text-align:center} 13 .system-message h1{margin:0;margin-bottom:9pt;color:#444;font-weight:400;font-size:40px} 14 .system-message .jump,.system-message .image{margin:20px 0;padding:0;padding:10px 0;font-weight:400} 15 .system-message .jump{font-size:14px} 16 .system-message .jump a{color:#333} 17 .system-message p{font-size:9pt;line-height:20px} 18 .system-message .btn{display:inline-block;margin-right:10px;width:138px;height:2pc;border:1px solid #44a0e8;border-radius:30px;color:#44a0e8;text-align:center;font-size:1pc;line-height:2pc;margin-bottom:5px;} 19 .success .btn{border-color:#69bf4e;color:#69bf4e} 20 .error .btn{border-color:#ff8992;color:#ff8992} 21 .info .btn{border-color:#3498db;color:#3498db} 22 .copyright p{width:100%;color:#919191;text-align:center;font-size:10px} 23 .system-message .btn-grey{border-color:#bbb;color:#bbb} 24 .clearfix:after{clear:both;display:block;visibility:hidden;height:0;content:"."} 25 @media (max-width:768px){body {padding:20px 0;}} 26 @media (max-width:480px){.system-message h1{font-size:30px;}} 27 </style> 28 </head> 29 <body> 30 {php}$codeText=$code == 1 ? 'success' : ($code == 0 ? 'error' : 'info');{/php} 31 <div class="system-message {$codeText}"> 32 <div class="image"> 33 <img src="__CDN__/assets/img/{$codeText}.svg" alt="" width="150" /> 34 </div> 35 <h1>{$msg}</h1> 36 {if $url} 37 <p class="jump"> 38 {:__('This page will be re-directed in %s seconds', '<span id="wait">' . $wait . '</span>')} 39 </p> 40 {/if} 41 <p class="clearfix"> 42 <a href="__PUBLIC__" class="btn btn-grey">{:__('Go back')}</a> 43 {if $url} 44 <a href="{$url}" class="btn btn-primary">{:__('Jump now')}</a> 45 {/if} 46 </p> 47 </div> 48 <div class="copyright"> 49 <p>Powered by <a href="https://www.fastadmin.net/?ref=jump">FastAdmin</a></p> 50 </div> 51 {if $url} 52 <script type="text/javascript"> 53 (function () { 54 var wait = document.getElementById('wait'); 55 var interval = setInterval(function () { 56 var time = --wait.innerHTML; 57 if (time <= 0) { 58 location.href = "{$url}"; 59 clearInterval(interval); 60 } 61 }, 1000); 62 })(); 63 </script> 64 {/if} 65 </body> 66 </html>
over!over!over!
let the world have no hard-to-write code ^-^