gameconfig.tpl 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>欢迎页面-X-admin2.0</title>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  8. <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
  9. <link rel="stylesheet" href="./static/css/font.css">
  10. <link rel="stylesheet" href="./static/css/xadmin.css">
  11. <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  12. <script src="./static/lib/layui/layui.js" charset="utf-8"></script>
  13. <script type="text/javascript" src="./static/js/xadmin.js"></script>
  14. </head>
  15. <body>
  16. <input type="text" id="token" value={{.token}} hidden=true>
  17. <div class="x-body layui-anim layui-anim-up">
  18. <blockquote class="layui-elem-quote">
  19. <input class="layui-btn" type="button" onclick="UpdateItem()" value=更新道具配置>
  20. <br>
  21. <br>
  22. <input class="layui-btn" type="button" onclick="UpdateGoods()" value=更新商品配置>
  23. </blockquote>
  24. </div>
  25. <script language="JavaScript">
  26. function UpdateItem() {
  27. var token = document.getElementById("token").value;
  28. var text = "token=" + encodeURI(token);
  29. text += "&ty=" + encodeURI("items");
  30. $.ajax({
  31. type:"post",
  32. url:"/gameconfig?" + text,
  33. success:function (data) {
  34. // alert(data.status);
  35. if (data.status){
  36. window.location.href="/gameconfig";
  37. }else{
  38. if (data.info){
  39. alert(data.info);
  40. }else{
  41. window.location.href="/accountlogin";
  42. }
  43. }
  44. }
  45. });
  46. }
  47. function UpdateGoods() {
  48. var token = document.getElementById("token").value;
  49. var text = "token=" + encodeURI(token);
  50. text += "&ty=" + encodeURI("goods");
  51. $.ajax({
  52. type:"post",
  53. url:"/gameconfig?" + text,
  54. success:function (data) {
  55. // alert(data.status);
  56. if (data.status){
  57. window.location.href="/gameconfig";
  58. }else{
  59. if (data.info){
  60. alert(data.info);
  61. }else{
  62. window.location.href="/accountlogin";
  63. }
  64. }
  65. }
  66. });
  67. }
  68. </script>
  69. </body>
  70. </html>