gameconfig.tpl 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>欢迎页面-X-admin2.0</title>
  6. <link rel="stylesheet" href="./static/css/font.css">
  7. <link rel="stylesheet" href="./static/css/xadmin.css">
  8. <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  9. <script src="./static/lib/layui/layui.js" charset="utf-8"></script>
  10. <script type="text/javascript" src="./static/js/xadmin.js"></script>
  11. </head>
  12. <body>
  13. <input type="text" id="token" value={{.token}} hidden=true>
  14. <br>
  15. <br>
  16. <input class="layui-btn" type="button" onclick="UpdateItem()" value=更新道具配置>
  17. <br>
  18. <br>
  19. <input class="layui-btn" type="button" onclick="UpdateGoods()" value=更新商品配置>
  20. <script language="JavaScript">
  21. function UpdateItem() {
  22. var token = document.getElementById("token").value;
  23. var text = "token=" + encodeURI(token);
  24. text += "&ty=" + encodeURI("items");
  25. $.ajax({
  26. type:"post",
  27. url:"/gameconfig?" + text,
  28. success:function (data) {
  29. // alert(data.status);
  30. if (data.status){
  31. window.location.href="/gameconfig";
  32. }else{
  33. if (data.info){
  34. alert(data.info);
  35. }else{
  36. window.location.href="/accountlogin";
  37. }
  38. }
  39. }
  40. });
  41. }
  42. function UpdateGoods() {
  43. var token = document.getElementById("token").value;
  44. var text = "token=" + encodeURI(token);
  45. text += "&ty=" + encodeURI("goods");
  46. $.ajax({
  47. type:"post",
  48. url:"/gameconfig?" + text,
  49. success:function (data) {
  50. // alert(data.status);
  51. if (data.status){
  52. window.location.href="/gameconfig";
  53. }else{
  54. if (data.info){
  55. alert(data.info);
  56. }else{
  57. window.location.href="/accountlogin";
  58. }
  59. }
  60. }
  61. });
  62. }
  63. </script>
  64. </body>
  65. </html>