configure.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. $.ajaxSetup({
  2. headers: {
  3. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  4. }
  5. });
  6. function type(url,data) {
  7. // var header = [];
  8. //
  9. // switch (kind) {
  10. // case 1:
  11. // header = [ //表头
  12. // //{checkbox: true, fixed: 'left'},
  13. // {field: 'name', title: '游戏', width: 100}
  14. // , {field: 'closeinfo', title: '关闭原因', width: 500, edit: 'text'}
  15. // , {field: 'LAY_CHECKED', title: '是否关闭', width: 130, templet: '#switchTpl', unresize: true}
  16. // ]
  17. // break;
  18. // case 2:
  19. // header = [ //表头
  20. // // {checkbox: true, fixed: 'left'},
  21. // {field: 'id', title: 'ID', width: 140, sort: true, fixed: 'left'}
  22. // , {field: 'order_id', title: '订单号', width: 250, sort: true, fixed: 'left'}
  23. // , {field: 'game_name', title: '游戏', width: 100}
  24. // , {field: 'game_no', title: '期数', width: 200, sort: true}
  25. // , {field: 'money', title: '下注金额', width: 120, sort: true}
  26. // , {field: 'prize_money', title: '赢取金额', width: 120, sort: true}
  27. // , {field: 'get_money', title: '输赢结果', width: 120, sort: true}
  28. // , {field: 'money_time', title: '开奖时间', width: 200}
  29. // , {field: 'account_name', title: '投注账号', width: 100}
  30. // , {field: 'settle_status', title: '状态', templet: '#sexTpl', width: 100}
  31. // , {fixed: 'right', title: '查看', width: 100, align: 'center', toolbar: '#barDemo'}
  32. // ]
  33. // break;
  34. // case 3:
  35. // header = [ //表头
  36. // // {checkbox: true, fixed: 'left'},
  37. // {field: 'info_identity', title: '游戏', width: 100}
  38. // , {field: 'info_no', title: '期数', width: 200, sort: true}
  39. // , {field: 'open_time', title: '期数', width: 200, sort: true}
  40. // , {field: 'status', title: '赢取金额', templet: '#sexTpl', width: 120, sort: true}
  41. // , {fixed: 'right', title: '查看', width: 100, align: 'center', toolbar: '#barDemo'}
  42. // ]
  43. // break;
  44. // }
  45. var returnData = []
  46. $.ajax({
  47. type: 'get',
  48. url: url,
  49. data: data,
  50. async: false,
  51. dataType: 'json',
  52. success: function (json) {
  53. returnData = json;
  54. },
  55. error: function (req) {
  56. }
  57. });
  58. return returnData;
  59. }
  60. function getData(url, data) {
  61. var returnData = []
  62. $.ajax({
  63. type: 'get',
  64. url: url,
  65. data: data,
  66. async: false,
  67. dataType: 'json',
  68. success: function (json) {
  69. returnData = json;
  70. },
  71. error: function (req) {
  72. }
  73. });
  74. return returnData;
  75. };