token.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. /**
  3. * token
  4. */
  5. # 定义几个常用的选项
  6. $option = array
  7. (
  8. 1 => '启用',
  9. 2 => '关闭',
  10. );
  11. return array
  12. (
  13. # 表名
  14. 'name' => 'token',
  15. # 显示给用户看的名称
  16. 'lang' => 'token',
  17. 'menu' => false,
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => 'ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. 'search' => 'order',
  29. 'list' => true,
  30. ),
  31. 'site' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '站点',
  35. 'default' => '',
  36. 'desc' => '请输入站点',
  37. 'match' => 'is_numeric',
  38. //'search' => 'order,fulltext',
  39. 'update' => 'text',
  40. 'list' => true,
  41. ),
  42. 'token' => array
  43. (
  44. 'type' => 'varchar-255',
  45. 'name' => 'token',
  46. 'default' => '',
  47. 'desc' => '请输入token',
  48. 'match' => 'is_string',
  49. 'update' => 'text',
  50. 'list' => true,
  51. ),
  52. 'expires_in' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => 'expires_in',
  56. 'default' => '',
  57. 'desc' => '请输入expires_in',
  58. 'match' => 'is_numeric',
  59. 'update' => 'text',
  60. 'list' => true,
  61. ),
  62. 'mdate' => array
  63. (
  64. 'type' => 'int-11',
  65. 'name' => '更新时间',
  66. 'match' => array('is_numeric', time()),
  67. 'desc' => '',
  68. ),
  69. 'state' => array
  70. (
  71. 'type' => 'tinyint-1',
  72. 'name' => '状态',
  73. 'default' => '1',
  74. 'desc' => '请选择状态',
  75. 'match' => array('is_numeric', 1),
  76. 'option' => $option,
  77. 'update' => 'radio',
  78. 'list' => true,
  79. ),
  80. 'cdate' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '录入时间',
  84. 'match' => array('is_numeric', time()),
  85. 'desc' => '',
  86. # 只有insert时才生效
  87. 'insert' => true,
  88. ),
  89. ),
  90. # 更新表结构
  91. 'alter' => array
  92. (
  93. 1 => array
  94. (
  95. array('update', 'name', 'site', 'int-11 站点'),
  96. ),
  97. 'version' => 1,
  98. ),
  99. 'auth' => 'site',
  100. # request 请求接口定义
  101. 'request' => array
  102. (
  103. # 根据hash取一条数据
  104. 'info' => array
  105. (
  106. # 匹配的正则或函数 必填项
  107. 'where' => array
  108. (
  109. 'site' => 'yes',
  110. ),
  111. 'type' => 'one',
  112. ),
  113. ),
  114. );