github.com/Mrs4s/go-cqhttp@v1.2.0/docs/adminApi.md (about) 1 # 管理 API 2 3 > 支持跨域 4 5 ## 公共参数 6 7 参数: 8 9 | 参数名 | 类型 | 说明 | 10 | ------------ | ------ | --------------------------- | 11 | access_token | string | 校验口令,config.hjson中配置 | 12 13 14 15 ## admin/do_restart 16 17 ### 热重启 18 19 > 热重启 20 21 > ps: 目前不支持ws部分的修改生效 22 23 method:`POST/GET` 24 25 参数: 26 27 | 参数名 | 类型 | 说明 | 28 | ------ | ---- | ---- | 29 | 无 | | | 30 31 返回: 32 33 ```json 34 {"data": {}, "retcode": 0, "status": "ok"} 35 ``` 36 37 38 ### admin/get_web_write 39 40 > 拉取验证码/设备锁 41 42 method: `GET` 43 44 45 参数: 46 47 | 参数名 | 类型 | 说明 | 48 | ------ | ---- | ---- | 49 | 无 | | | 50 51 返回: 52 53 ```json 54 {"data": {"ispic": true,"picbase64":"xxxxx"}, "retcode": 0, "status": "ok"} 55 ``` 56 | 参数名 | 类型 | 说明 | 57 | -------- | ------ | --------------------------------------------------- | 58 | ispic | bool | 是否是验证码类型 true是,false为不是(比如设备锁 | 59 | picbas64 | string | 验证码的base64编码内容,加上头,放入img标签即可显示 | 60 61 ### admin/do_web_write 62 63 > web输入验证码/设备锁确认 64 65 method: `POST` formdata 66 67 68 参数: 69 70 | 参数名 | 类型 | 说明 | 71 | ------ | ------ | ---------- | 72 | input | string | 输入的内容 | 73 74 返回: 75 76 ```json 77 {"data": {}, "retcode": 0, "status": "ok"} 78 ``` 79 80 81 ### admin/do_restart_docker 82 83 > 冷重启 84 85 > 注意:此api 会直接结束掉进程,需要依赖docker/supervisor等进程管理工具来自动拉起 86 87 method: `POST` 88 89 90 参数: 91 92 | 参数名 | 类型 | 说明 | 93 | ------ | ---- | ---- | 94 | 无 | | | 95 96 返回: 97 98 ```json 99 {"data": {}, "retcode": 0, "status": "ok"} 100 ``` 101 102 ### admin/do_process_restart 103 104 > 冷重启 105 106 method: `POST` 107 108 109 参数: 110 111 | 参数名 | 类型 | 说明 | 112 | ------ | ---- | ---- | 113 | 无 | | | 114 115 返回: 116 117 ```json 118 {"data": {}, "retcode": 0, "status": "ok"} 119 ``` 120 121 ### admin/do_config_base 122 123 > 基础配置 124 125 method: `POST` formdata 126 127 128 参数: 129 130 | 参数名 | 类型 | 说明 | 131 | ------------ | ------ | ------------------------------------- | 132 | uin | string | qq号 | 133 | password | string | qq密码 | 134 | enable_db | string | 是否启动数据库,填 'true' 或者 'false' | 135 | access_token | string | 授权 token | 136 137 返回: 138 139 ```json 140 {"data": {}, "retcode": 0, "status": "ok"} 141 ``` 142 143 144 ### admin/do_config_http 145 146 > http服务配置 147 148 method: `POST` formdata 149 150 参数: 151 152 | 参数名 | 类型 | 说明 | 153 | ----------- | ------ | --------------------------------------------- | 154 | port | string | 服务端口 | 155 | host | string | 服务监听地址 | 156 | enable | string | 是否启用 ,填 'true' 或者 'false' | 157 | timeout | string | http请求超时时间 | 158 | post_url | string | post上报地址 不需要就填空字符串,或者不填 | 159 | post_secret | string | post上报的secret 不需要就填空字符串,或者不填 | 160 161 返回: 162 163 ```json 164 {"data": {}, "retcode": 0, "status": "ok"} 165 ``` 166 167 168 ### admin/do_config_ws 169 170 > 正向ws设置 171 172 method: `POST` formdata 173 174 参数: 175 176 | 参数名 | 类型 | 说明 | 177 | ------ | ------ | -------------------------------- | 178 | port | string | 服务端口 | 179 | host | string | 服务监听地址 | 180 | enable | string | 是否启用 ,填 'true' 或者 'false' | 181 182 183 返回: 184 185 ```json 186 {"data": {}, "retcode": 0, "status": "ok"} 187 ``` 188 189 ### admin/do_config_reverse 190 191 > 反向ws配置 192 193 method: `POST` formdata 194 195 参数: 196 197 | 参数名 | 类型 | 说明 | 198 | ------ | ------ | -------------------------------- | 199 | port | string | 服务端口 | 200 | host | string | 服务监听地址 | 201 | enable | string | 是否启用 ,填 'true' 或者 'false' | 202 203 204 返回: 205 206 ```json 207 {"data": {}, "retcode": 0, "status": "ok"} 208 ``` 209 210 ### admin/do_config_json 211 212 > 直接修改 config.hjson配置 213 214 method: `POST` formdata 215 216 参数: 217 218 | 参数名 | 类型 | 说明 | 219 | ------ | ------ | ----------------------------------- | 220 | json | string | 完整的config.hjson的配合,json字符串 | 221 222 223 返回: 224 225 ```json 226 {"data": {}, "retcode": 0, "status": "ok"} 227 ``` 228 229 ### admin/get_config_json 230 231 > 获取当前 config.hjson配置 232 233 method: `GET` 234 235 参数: 236 237 | 参数名 | 类型 | 说明 | 238 | ------ | ---- | ---- | 239 | 无 | | | 240 241 242 返回: 243 244 ```json 245 {"data": {"config":"xxxx"}, "retcode": 0, "status": "ok"} 246 ``` 247 248 | 参数名 | 类型 | 说明 | 249 | ------ | ------ | ----------------------------------- | 250 | config | string | 完整的config.hjson的配合,json字符串 | 251