admin.html 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
  1. <!DOCTYPE html>
  2. <html>
  3. <head lang="en">
  4. <title> API Documentation </title>
  5. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
  6. <link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
  8. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  9. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
  10. <style type="text/css">
  11. body {
  12. font-family: 'Roboto', sans-serif;
  13. }
  14. .hidden {
  15. display:none;
  16. }
  17. pre {
  18. outline: 1px solid #ccc;
  19. padding: 5px; margin: 5px;
  20. }
  21. .string { color: green; }
  22. .number { color: darkorange; }
  23. .boolean { color: blue; }
  24. .null { color: magenta; }
  25. .key { color: red; }
  26. </style>
  27. <style type="text/css">
  28. pre.prettyprint {
  29. border: 1px solid #ccc;
  30. margin-bottom: 0;
  31. padding: 9.5px;
  32. }
  33. </style>
  34. <script>
  35. function syntaxHighlight(json) {
  36. json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
  37. return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
  38. var cls = 'number';
  39. if (/^"/.test(match)) {
  40. if (/:$/.test(match)) {
  41. cls = 'key';
  42. } else {
  43. cls = 'string';
  44. }
  45. } else if (/true|false/.test(match)) {
  46. cls = 'boolean';
  47. } else if (/null/.test(match)) {
  48. cls = 'null';
  49. }
  50. return '<span class="' + cls + '">' + match + '</span>';
  51. });
  52. }
  53. function spaceJson(json){
  54. var validJson = JSON.parse(json);
  55. return JSON.stringify(validJson, undefined, 4);
  56. }
  57. </script>
  58. </head>
  59. <body>
  60. <nav class="navbar navbar-default navbar-fixed-top">
  61. <div class="container-fluid">
  62. <div class="navbar-header">
  63. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
  64. data-target="#bs-example-navbar-collapse-1">
  65. <span class="sr-only">Toggle navigation</span>
  66. <span class="icon-bar"></span>
  67. <span class="icon-bar"></span>
  68. <span class="icon-bar"></span>
  69. </button>
  70. <a class="navbar-brand" href="#">Gin</a>
  71. <p class="navbar-text">Developed by Gophers at <a href="http://betacraft.co">Betacraft</a></p>
  72. </div>
  73. </div>
  74. </nav>
  75. <div class="container-fluid" style="margin-top: 70px;margin-bottom: 20px;">
  76. <div class="container-fluid">
  77. <div class="col-md-4">
  78. <div class="panel panel-default">
  79. <div class="panel-heading">Base Urls</div>
  80. <div class="panel-body">
  81. <p>Production : <strong>/api/v1</strong></p>
  82. <p>Staging : <strong>/api/v1</strong></p>
  83. </div>
  84. </div>
  85. <ul class="nav nav-pills nav-stacked" role="tablist">
  86. <li role="presentation"><a href="#0top" role="tab" data-toggle="tab">POST : /api/v1/admin/login</a></li>
  87. <li role="presentation"><a href="#1top" role="tab" data-toggle="tab">PUT : /api/v1/admin/change_user_role</a></li>
  88. <li role="presentation"><a href="#2top" role="tab" data-toggle="tab">PUT : /api/v1/admin/change_user_passwd</a></li>
  89. <li role="presentation"><a href="#3top" role="tab" data-toggle="tab">DELETE : /api/v1/admin/delete_user</a></li>
  90. <ul>
  91. </div>
  92. <div class="col-md-8 tab-content">
  93. <div id="0top" role="tabpanel" class="tab-pane col-md-10">
  94. <p> <H4> Request Headers </H4> </p>
  95. <table class="table table-bordered table-striped">
  96. <tr>
  97. <th>Key</th>
  98. <th>Value</th>
  99. </tr>
  100. <tr>
  101. <td>Apitoken</td>
  102. <td> {&#34;sig&#34;: &#34;25ae3f6cdb1711e79997005056a6aba2&#34;, &#34;name&#34;: &#34;root&#34;}</td>
  103. </tr>
  104. <tr>
  105. <td>Content-Type</td>
  106. <td> application/x-www-form-urlencoded </td>
  107. </tr>
  108. </table>
  109. <p> <H4> Post Form </H4> </p>
  110. <table class="table table-bordered table-striped">
  111. <tr>
  112. <th>Key</th>
  113. <th>Value</th>
  114. </tr>
  115. <tr>
  116. <td>name</td>
  117. <td> qfeng</td>
  118. </tr>
  119. </table>
  120. <p><h4> Response Code</h4></p>
  121. <pre class="prettyprint lang-json">200</pre>
  122. <p><h4> Response Headers</h4></p>
  123. <table class="table table-bordered table-striped">
  124. <tr>
  125. <th>Key</th>
  126. <th>Value</th>
  127. </tr>
  128. <tr>
  129. <td>Access-Control-Allow-Credentials</td>
  130. <td> true</td>
  131. </tr>
  132. <tr>
  133. <td>Access-Control-Allow-Headers</td>
  134. <td> Content-Type, Content-Length, Apitoken</td>
  135. </tr>
  136. <tr>
  137. <td>Access-Control-Allow-Methods</td>
  138. <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
  139. </tr>
  140. <tr>
  141. <td>Access-Control-Allow-Origin</td>
  142. <td> *</td>
  143. </tr>
  144. <tr>
  145. <td>Access-Control-Expose-Headers</td>
  146. <td> Content-Length</td>
  147. </tr>
  148. <tr>
  149. <td>Access-Control-Max-Age</td>
  150. <td> 86400</td>
  151. </tr>
  152. <tr>
  153. <td>Content-Type</td>
  154. <td> application/json; charset=utf-8</td>
  155. </tr>
  156. </table>
  157. <p> <H4> Response Body </H4> </p>
  158. <pre class="prettyprint" id="response-body-0-0">{&#34;sig&#34;:&#34;05434ff8db0311e7afde005056a6aba2&#34;,&#34;name&#34;:&#34;qfeng&#34;,&#34;admin&#34;:true}</pre>
  159. <script>
  160. var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
  161. if (responseHeader["Content-Type"] === "application/json"){
  162. try {
  163. var jsonStr = spaceJson("{\"sig\":\"05434ff8db0311e7afde005056a6aba2\",\"name\":\"qfeng\",\"admin\":true}");
  164. document.getElementById('response-body-0-0').innerHTML = syntaxHighlight(jsonStr);
  165. } catch (e) {
  166. }
  167. }
  168. </script>
  169. <hr>
  170. <p> <H4> Request Headers </H4> </p>
  171. <table class="table table-bordered table-striped">
  172. <tr>
  173. <th>Key</th>
  174. <th>Value</th>
  175. </tr>
  176. <tr>
  177. <td>Apitoken</td>
  178. <td> {&#34;sig&#34;: &#34;25ae3f6cdb1711e79997005056a6aba2&#34;, &#34;name&#34;: &#34;root&#34;}</td>
  179. </tr>
  180. <tr>
  181. <td>Content-Type</td>
  182. <td> application/x-www-form-urlencoded </td>
  183. </tr>
  184. </table>
  185. <p> <H4> Post Form </H4> </p>
  186. <table class="table table-bordered table-striped">
  187. <tr>
  188. <th>Key</th>
  189. <th>Value</th>
  190. </tr>
  191. <tr>
  192. <td>name</td>
  193. <td> daye</td>
  194. </tr>
  195. </table>
  196. <p><h4> Response Code</h4></p>
  197. <pre class="prettyprint lang-json">400</pre>
  198. <p><h4> Response Headers</h4></p>
  199. <table class="table table-bordered table-striped">
  200. <tr>
  201. <th>Key</th>
  202. <th>Value</th>
  203. </tr>
  204. <tr>
  205. <td>Access-Control-Allow-Credentials</td>
  206. <td> true</td>
  207. </tr>
  208. <tr>
  209. <td>Access-Control-Allow-Headers</td>
  210. <td> Content-Type, Content-Length, Apitoken</td>
  211. </tr>
  212. <tr>
  213. <td>Access-Control-Allow-Methods</td>
  214. <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
  215. </tr>
  216. <tr>
  217. <td>Access-Control-Allow-Origin</td>
  218. <td> *</td>
  219. </tr>
  220. <tr>
  221. <td>Access-Control-Expose-Headers</td>
  222. <td> Content-Length</td>
  223. </tr>
  224. <tr>
  225. <td>Access-Control-Max-Age</td>
  226. <td> 86400</td>
  227. </tr>
  228. <tr>
  229. <td>Content-Type</td>
  230. <td> application/json; charset=utf-8</td>
  231. </tr>
  232. </table>
  233. <p> <H4> Response Body </H4> </p>
  234. <pre class="prettyprint" id="response-body-0-1">{&#34;error&#34;:&#34;no such user&#34;}</pre>
  235. <script>
  236. var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
  237. if (responseHeader["Content-Type"] === "application/json"){
  238. try {
  239. var jsonStr = spaceJson("{\"error\":\"no such user\"}");
  240. document.getElementById('response-body-0-1').innerHTML = syntaxHighlight(jsonStr);
  241. } catch (e) {
  242. }
  243. }
  244. </script>
  245. <hr>
  246. <p> <H4> Request Headers </H4> </p>
  247. <table class="table table-bordered table-striped">
  248. <tr>
  249. <th>Key</th>
  250. <th>Value</th>
  251. </tr>
  252. <tr>
  253. <td>Apitoken</td>
  254. <td> {&#34;sig&#34;: &#34;05434ff8db0311e7afde005056a6aba2&#34;, &#34;name&#34;: &#34;qfeng&#34;}</td>
  255. </tr>
  256. <tr>
  257. <td>Content-Type</td>
  258. <td> application/x-www-form-urlencoded </td>
  259. </tr>
  260. </table>
  261. <p> <H4> Post Form </H4> </p>
  262. <table class="table table-bordered table-striped">
  263. <tr>
  264. <th>Key</th>
  265. <th>Value</th>
  266. </tr>
  267. <tr>
  268. <td>name</td>
  269. <td> qfeng</td>
  270. </tr>
  271. </table>
  272. <p><h4> Response Code</h4></p>
  273. <pre class="prettyprint lang-json">400</pre>
  274. <p><h4> Response Headers</h4></p>
  275. <table class="table table-bordered table-striped">
  276. <tr>
  277. <th>Key</th>
  278. <th>Value</th>
  279. </tr>
  280. <tr>
  281. <td>Access-Control-Allow-Credentials</td>
  282. <td> true</td>
  283. </tr>
  284. <tr>
  285. <td>Access-Control-Allow-Headers</td>
  286. <td> Content-Type, Content-Length, Apitoken</td>
  287. </tr>
  288. <tr>
  289. <td>Access-Control-Allow-Methods</td>
  290. <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
  291. </tr>
  292. <tr>
  293. <td>Access-Control-Allow-Origin</td>
  294. <td> *</td>
  295. </tr>
  296. <tr>
  297. <td>Access-Control-Expose-Headers</td>
  298. <td> Content-Length</td>
  299. </tr>
  300. <tr>
  301. <td>Access-Control-Max-Age</td>
  302. <td> 86400</td>
  303. </tr>
  304. <tr>
  305. <td>Content-Type</td>
  306. <td> application/json; charset=utf-8</td>
  307. </tr>
  308. </table>
  309. <p> <H4> Response Body </H4> </p>
  310. <pre class="prettyprint" id="response-body-0-2">{&#34;error&#34;:&#34;API_USER not admin, no permissions can do this&#34;}</pre>
  311. <script>
  312. var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
  313. if (responseHeader["Content-Type"] === "application/json"){
  314. try {
  315. var jsonStr = spaceJson("{\"error\":\"API_USER not admin, no permissions can do this\"}");
  316. document.getElementById('response-body-0-2').innerHTML = syntaxHighlight(jsonStr);
  317. } catch (e) {
  318. }
  319. }
  320. </script>
  321. <hr>
  322. </div>
  323. <div id="1top" role="tabpanel" class="tab-pane col-md-10">
  324. <p> <H4> Request Headers </H4> </p>
  325. <table class="table table-bordered table-striped">
  326. <tr>
  327. <th>Key</th>
  328. <th>Value</th>
  329. </tr>
  330. <tr>
  331. <td>Apitoken</td>
  332. <td> {&#34;sig&#34;: &#34;25ae3f6cdb1711e79997005056a6aba2&#34;, &#34;name&#34;: &#34;root&#34;}</td>
  333. </tr>
  334. <tr>
  335. <td>Content-Type</td>
  336. <td> application/json </td>
  337. </tr>
  338. </table>
  339. <p> <H4> Request Body </H4> </p>
  340. <pre id="request-body-1-0" class="prettyprint">{&#34;admin&#34;: &#34;yes&#34;, &#34;user_id&#34;: 12}</pre>
  341. <script>
  342. var requestHeader ={"Apitoken":"{\"sig\": \"25ae3f6cdb1711e79997005056a6aba2\", \"name\": \"root\"}","Content-Type":" application/json\r"};
  343. if (requestHeader["Content-Type"] === "application/json"){
  344. try {
  345. var jsonStr = spaceJson("{\"admin\": \"yes\", \"user_id\": 12}");
  346. document.getElementById('request-body1-0').innerHTML = syntaxHighlight(jsonStr);
  347. } catch (e) {
  348. }
  349. }
  350. </script>
  351. <p><h4> Response Code</h4></p>
  352. <pre class="prettyprint lang-json">200</pre>
  353. <p><h4> Response Headers</h4></p>
  354. <table class="table table-bordered table-striped">
  355. <tr>
  356. <th>Key</th>
  357. <th>Value</th>
  358. </tr>
  359. <tr>
  360. <td>Access-Control-Allow-Credentials</td>
  361. <td> true</td>
  362. </tr>
  363. <tr>
  364. <td>Access-Control-Allow-Headers</td>
  365. <td> Content-Type, Content-Length, Apitoken</td>
  366. </tr>
  367. <tr>
  368. <td>Access-Control-Allow-Methods</td>
  369. <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
  370. </tr>
  371. <tr>
  372. <td>Access-Control-Allow-Origin</td>
  373. <td> *</td>
  374. </tr>
  375. <tr>
  376. <td>Access-Control-Expose-Headers</td>
  377. <td> Content-Length</td>
  378. </tr>
  379. <tr>
  380. <td>Access-Control-Max-Age</td>
  381. <td> 86400</td>
  382. </tr>
  383. <tr>
  384. <td>Content-Type</td>
  385. <td> application/json; charset=utf-8</td>
  386. </tr>
  387. </table>
  388. <p> <H4> Response Body </H4> </p>
  389. <pre class="prettyprint" id="response-body-1-0">{&#34;message&#34;:&#34;user role update sccuessful, affect row: 0&#34;}</pre>
  390. <script>
  391. var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
  392. if (responseHeader["Content-Type"] === "application/json"){
  393. try {
  394. var jsonStr = spaceJson("{\"message\":\"user role update sccuessful, affect row: 0\"}");
  395. document.getElementById('response-body-1-0').innerHTML = syntaxHighlight(jsonStr);
  396. } catch (e) {
  397. }
  398. }
  399. </script>
  400. <hr>
  401. <p> <H4> Request Headers </H4> </p>
  402. <table class="table table-bordered table-striped">
  403. <tr>
  404. <th>Key</th>
  405. <th>Value</th>
  406. </tr>
  407. <tr>
  408. <td>Apitoken</td>
  409. <td> {&#34;sig&#34;: &#34;25ae3f6cdb1711e79997005056a6aba2&#34;, &#34;name&#34;: &#34;root&#34;}</td>
  410. </tr>
  411. <tr>
  412. <td>Content-Type</td>
  413. <td> application/json </td>
  414. </tr>
  415. </table>
  416. <p> <H4> Request Body </H4> </p>
  417. <pre id="request-body-1-1" class="prettyprint">{&#34;admin&#34;: &#34;no&#34;, &#34;user_id&#34;: 12}</pre>
  418. <script>
  419. var requestHeader ={"Apitoken":"{\"sig\": \"25ae3f6cdb1711e79997005056a6aba2\", \"name\": \"root\"}","Content-Type":" application/json\r"};
  420. if (requestHeader["Content-Type"] === "application/json"){
  421. try {
  422. var jsonStr = spaceJson("{\"admin\": \"no\", \"user_id\": 12}");
  423. document.getElementById('request-body1-1').innerHTML = syntaxHighlight(jsonStr);
  424. } catch (e) {
  425. }
  426. }
  427. </script>
  428. <p><h4> Response Code</h4></p>
  429. <pre class="prettyprint lang-json">200</pre>
  430. <p><h4> Response Headers</h4></p>
  431. <table class="table table-bordered table-striped">
  432. <tr>
  433. <th>Key</th>
  434. <th>Value</th>
  435. </tr>
  436. <tr>
  437. <td>Access-Control-Allow-Credentials</td>
  438. <td> true</td>
  439. </tr>
  440. <tr>
  441. <td>Access-Control-Allow-Headers</td>
  442. <td> Content-Type, Content-Length, Apitoken</td>
  443. </tr>
  444. <tr>
  445. <td>Access-Control-Allow-Methods</td>
  446. <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
  447. </tr>
  448. <tr>
  449. <td>Access-Control-Allow-Origin</td>
  450. <td> *</td>
  451. </tr>
  452. <tr>
  453. <td>Access-Control-Expose-Headers</td>
  454. <td> Content-Length</td>
  455. </tr>
  456. <tr>
  457. <td>Access-Control-Max-Age</td>
  458. <td> 86400</td>
  459. </tr>
  460. <tr>
  461. <td>Content-Type</td>
  462. <td> application/json; charset=utf-8</td>
  463. </tr>
  464. </table>
  465. <p> <H4> Response Body </H4> </p>
  466. <pre class="prettyprint" id="response-body-1-1">{&#34;message&#34;:&#34;user role update sccuessful, affect row: 1&#34;}</pre>
  467. <script>
  468. var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
  469. if (responseHeader["Content-Type"] === "application/json"){
  470. try {
  471. var jsonStr = spaceJson("{\"message\":\"user role update sccuessful, affect row: 1\"}");
  472. document.getElementById('response-body-1-1').innerHTML = syntaxHighlight(jsonStr);
  473. } catch (e) {
  474. }
  475. }
  476. </script>
  477. <hr>
  478. </div>
  479. <div id="2top" role="tabpanel" class="tab-pane col-md-10">
  480. <p> <H4> Request Headers </H4> </p>
  481. <table class="table table-bordered table-striped">
  482. <tr>
  483. <th>Key</th>
  484. <th>Value</th>
  485. </tr>
  486. <tr>
  487. <td>Apitoken</td>
  488. <td> {&#34;sig&#34;: &#34;25ae3f6cdb1711e79997005056a6aba2&#34;, &#34;name&#34;: &#34;root&#34;}</td>
  489. </tr>
  490. <tr>
  491. <td>Content-Type</td>
  492. <td> application/json </td>
  493. </tr>
  494. </table>
  495. <p> <H4> Request Body </H4> </p>
  496. <pre id="request-body-2-0" class="prettyprint">{&#34;password&#34;: &#34;lalala&#34;, &#34;user_id&#34;: 12}</pre>
  497. <script>
  498. var requestHeader ={"Apitoken":"{\"sig\": \"25ae3f6cdb1711e79997005056a6aba2\", \"name\": \"root\"}","Content-Type":" application/json\r"};
  499. if (requestHeader["Content-Type"] === "application/json"){
  500. try {
  501. var jsonStr = spaceJson("{\"password\": \"lalala\", \"user_id\": 12}");
  502. document.getElementById('request-body2-0').innerHTML = syntaxHighlight(jsonStr);
  503. } catch (e) {
  504. }
  505. }
  506. </script>
  507. <p><h4> Response Code</h4></p>
  508. <pre class="prettyprint lang-json">200</pre>
  509. <p><h4> Response Headers</h4></p>
  510. <table class="table table-bordered table-striped">
  511. <tr>
  512. <th>Key</th>
  513. <th>Value</th>
  514. </tr>
  515. <tr>
  516. <td>Access-Control-Allow-Credentials</td>
  517. <td> true</td>
  518. </tr>
  519. <tr>
  520. <td>Access-Control-Allow-Headers</td>
  521. <td> Content-Type, Content-Length, Apitoken</td>
  522. </tr>
  523. <tr>
  524. <td>Access-Control-Allow-Methods</td>
  525. <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
  526. </tr>
  527. <tr>
  528. <td>Access-Control-Allow-Origin</td>
  529. <td> *</td>
  530. </tr>
  531. <tr>
  532. <td>Access-Control-Expose-Headers</td>
  533. <td> Content-Length</td>
  534. </tr>
  535. <tr>
  536. <td>Access-Control-Max-Age</td>
  537. <td> 86400</td>
  538. </tr>
  539. <tr>
  540. <td>Content-Type</td>
  541. <td> application/json; charset=utf-8</td>
  542. </tr>
  543. </table>
  544. <p> <H4> Response Body </H4> </p>
  545. <pre class="prettyprint" id="response-body-2-0">{&#34;message&#34;:&#34;password updated!&#34;}</pre>
  546. <script>
  547. var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
  548. if (responseHeader["Content-Type"] === "application/json"){
  549. try {
  550. var jsonStr = spaceJson("{\"message\":\"password updated!\"}");
  551. document.getElementById('response-body-2-0').innerHTML = syntaxHighlight(jsonStr);
  552. } catch (e) {
  553. }
  554. }
  555. </script>
  556. <hr>
  557. </div>
  558. <div id="3top" role="tabpanel" class="tab-pane col-md-10">
  559. <p> <H4> Request Headers </H4> </p>
  560. <table class="table table-bordered table-striped">
  561. <tr>
  562. <th>Key</th>
  563. <th>Value</th>
  564. </tr>
  565. <tr>
  566. <td>Apitoken</td>
  567. <td> {&#34;sig&#34;: &#34;25ae3f6cdb1711e79997005056a6aba2&#34;, &#34;name&#34;: &#34;root&#34;}</td>
  568. </tr>
  569. <tr>
  570. <td>Content-Type</td>
  571. <td> application/json </td>
  572. </tr>
  573. </table>
  574. <p> <H4> Request Body </H4> </p>
  575. <pre id="request-body-3-0" class="prettyprint">{&#34;user_id&#34;: 12}</pre>
  576. <script>
  577. var requestHeader ={"Apitoken":"{\"sig\": \"25ae3f6cdb1711e79997005056a6aba2\", \"name\": \"root\"}","Content-Type":" application/json\r"};
  578. if (requestHeader["Content-Type"] === "application/json"){
  579. try {
  580. var jsonStr = spaceJson("{\"user_id\": 12}");
  581. document.getElementById('request-body3-0').innerHTML = syntaxHighlight(jsonStr);
  582. } catch (e) {
  583. }
  584. }
  585. </script>
  586. <p><h4> Response Code</h4></p>
  587. <pre class="prettyprint lang-json">200</pre>
  588. <p><h4> Response Headers</h4></p>
  589. <table class="table table-bordered table-striped">
  590. <tr>
  591. <th>Key</th>
  592. <th>Value</th>
  593. </tr>
  594. <tr>
  595. <td>Access-Control-Allow-Credentials</td>
  596. <td> true</td>
  597. </tr>
  598. <tr>
  599. <td>Access-Control-Allow-Headers</td>
  600. <td> Content-Type, Content-Length, Apitoken</td>
  601. </tr>
  602. <tr>
  603. <td>Access-Control-Allow-Methods</td>
  604. <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
  605. </tr>
  606. <tr>
  607. <td>Access-Control-Allow-Origin</td>
  608. <td> *</td>
  609. </tr>
  610. <tr>
  611. <td>Access-Control-Expose-Headers</td>
  612. <td> Content-Length</td>
  613. </tr>
  614. <tr>
  615. <td>Access-Control-Max-Age</td>
  616. <td> 86400</td>
  617. </tr>
  618. <tr>
  619. <td>Content-Type</td>
  620. <td> application/json; charset=utf-8</td>
  621. </tr>
  622. </table>
  623. <p> <H4> Response Body </H4> </p>
  624. <pre class="prettyprint" id="response-body-3-0">{&#34;message&#34;:&#34;user 12 has been delete, affect row: 1&#34;}</pre>
  625. <script>
  626. var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
  627. if (responseHeader["Content-Type"] === "application/json"){
  628. try {
  629. var jsonStr = spaceJson("{\"message\":\"user 12 has been delete, affect row: 1\"}");
  630. document.getElementById('response-body-3-0').innerHTML = syntaxHighlight(jsonStr);
  631. } catch (e) {
  632. }
  633. }
  634. </script>
  635. <hr>
  636. </div>
  637. </div>
  638. </div>
  639. </div>
  640. <hr>
  641. </body>
  642. </html>