platform_sign.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. $platform_id = Dever::input('set')['platform_id'] ?? 0;
  3. $platform = include('platform.php');
  4. $encrypt = array
  5. (
  6. -1 => '无需加密',
  7. -2 => 'md5',
  8. -3 => 'sha256',
  9. -4 => 'sha1',
  10. );
  11. $platform_id = Dever::input('set')['platform_id'] ?? 0;
  12. if (!$platform_id) {
  13. $platform_id = Dever::input('field')['platform_id'] ?? 0;
  14. }
  15. if ($platform_id) {
  16. $info = Dever::db('platform_ssl', 'api')->select(['platform_id' => $platform_id]);
  17. if ($info) {
  18. foreach ($info as $k => $v) {
  19. $encrypt[$v['id']] = $v['name'];
  20. }
  21. }
  22. }
  23. return array
  24. (
  25. 'list' => array
  26. (
  27. 'where' => array('platform_id' => $platform_id),
  28. 'field' => array
  29. (
  30. 'id',
  31. 'name',
  32. //'sort' => 'input',
  33. 'cdate',
  34. ),
  35. 'data_button' => array
  36. (
  37. '编辑' => array('edit', array('platform_id' => $platform_id)),
  38. '删除' => 'delete',
  39. ),
  40. 'button' => array
  41. (
  42. '新增' => array('add', array('platform_id' => $platform_id)),
  43. ),
  44. 'search' => array
  45. (
  46. 'platform_id' => 'hidden',
  47. 'name',
  48. ),
  49. ),
  50. 'update' => array
  51. (
  52. 'desc' => $platform['update']['desc'],
  53. 'tab' => array
  54. (
  55. '基本设置' => 'platform_id,name,arg,encrypt,after',
  56. '键名键值设置' => 'kv_type,kv_sort,kv_value_empty,kv_key_handle,kv_value_handle,kv_join,kv_join_handle',
  57. ),
  58. 'field' => array
  59. (
  60. 'platform_id' => 'text',
  61. 'name' => array
  62. (
  63. 'desc' => '填写后,以{签名名称}形式调用',
  64. ),
  65. 'arg' => array
  66. (
  67. 'type' => 'textarea',
  68. 'autosize' => array('minRows' => 2),
  69. 'desc' => '按顺序做加密,用换行隔开,为空则所有请求体参数参与签名',
  70. ),
  71. 'encrypt' => array
  72. (
  73. 'type' => 'radio',
  74. 'option' => $encrypt,
  75. ),
  76. 'after' => array
  77. (
  78. 'type' => 'select',
  79. 'clearable' => true
  80. ),
  81. 'kv_type' => 'radio',
  82. 'kv_sort' => 'radio',
  83. 'kv_value_empty' => array
  84. (
  85. 'type' => 'radio',
  86. 'desc' => '【如果参数中有空值,是否参与签名】',
  87. ),
  88. 'kv_key_handle' => array
  89. (
  90. 'type' => 'select',
  91. 'clearable' => true
  92. ),
  93. 'kv_value_handle' => array
  94. (
  95. 'type' => 'select',
  96. 'clearable' => true
  97. ),
  98. 'kv_join',
  99. 'kv_join_handle' => 'radio',
  100. ),
  101. ),
  102. );