msg.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>{if $result.code}正常{else}错误{/if}</title>
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  6. <style>
  7. .not-container {
  8. display: flex;
  9. align-items: center;
  10. justify-content: center;
  11. width: 100%;
  12. height: 100vh;
  13. }
  14. .not-img {
  15. margin-right: 120px;
  16. }
  17. .not-detail {
  18. display: flex;
  19. flex-direction: column;
  20. }
  21. h2,h4 {
  22. padding: 0;
  23. margin: 0;
  24. }
  25. h2 {
  26. font-size: 60px;
  27. }
  28. h4 {
  29. margin: 30px 0 20px;
  30. font-size: 19px;
  31. font-weight: normal;
  32. }
  33. .button{
  34. background: #009688;
  35. color: #fff;
  36. border-radius: 4px;
  37. display: inline-block;
  38. width: 80px;
  39. text-align: center;
  40. padding: 5px 0;
  41. font-size: 14px;
  42. cursor: pointer;
  43. }
  44. </style>
  45. </head>
  46. <body>
  47. <div class="not-container">
  48. {if $result.code}
  49. <img src="/assets/img/500.png" class="not-img" alt="403" />
  50. {else}
  51. <img src="/assets/img/403.png" class="not-img" alt="403" />
  52. {/if}
  53. <div class="not-detail">
  54. {if $result.code}
  55. <h2 style="color: #009688">😁正常!</h2>
  56. {else}
  57. <h2 style="color: darkgray">😢错误!</h2>
  58. {/if}
  59. <!--如果你希望返回json,请在请求头设置{'x-requested-with':'XMLHttpRequest'}-->
  60. <h4>{$result.msg}</h4>
  61. {if $result.modulename == 'admin'}
  62. <div class="button" type="primary" onclick="closePage()">关闭页面</div>
  63. {else}
  64. <div class="button" type="primary" onclick="goHome()">返回首页</div>
  65. {/if}
  66. </div>
  67. </div>
  68. </body>
  69. <script>
  70. {if $result.modulename == 'admin'}
  71. function closePage(){
  72. if(top!==window){
  73. let menu=top.Yunqi.app.openMenu;
  74. if(menu.menutype=='tab'){
  75. top.Yunqi.api.closetabs(menu);
  76. }
  77. if(menu.menutype=='layer'){
  78. top.Yunqi.api.closelayer(menu);
  79. }
  80. }
  81. }
  82. {/if}
  83. function goHome(){
  84. window.location.href = '/{$result.modulealis}';
  85. }
  86. </script>
  87. </html>