gameconfig.tpl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. if (data.info){
  38. layer.msg(data.info,{icon:1,time:1000});
  39. }
  40. }else{
  41. if (data.info){
  42. alert(data.info);
  43. }else{
  44. window.location.href="/accountlogin";
  45. }
  46. }
  47. }
  48. });
  49. }
  50. function UpdateGoods() {
  51. var token = document.getElementById("token").value;
  52. var text = "token=" + encodeURI(token);
  53. text += "&ty=" + encodeURI("goods");
  54. $.ajax({
  55. type:"post",
  56. url:"/gameconfig?" + text,
  57. success:function (data) {
  58. // alert(data.status);
  59. if (data.status){
  60. window.location.href="/gameconfig";
  61. if (data.info){
  62. layer.msg(data.info,{icon:1,time:1000});
  63. }
  64. }else{
  65. if (data.info){
  66. alert(data.info);
  67. }else{
  68. window.location.href="/accountlogin";
  69. }
  70. }
  71. }
  72. });
  73. }
  74. </script>
  75. </body>
  76. </html>