http.html
23.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>数据交互格式标准 | 买买买文档平台</title>
<meta name="description" content="买买买文档平台">
<link rel="preload" href="/assets/css/0.styles.f8cb2318.css" as="style"><link rel="preload" href="/assets/js/app.bf915ba5.js" as="script"><link rel="preload" href="/assets/js/2.930005fe.js" as="script"><link rel="preload" href="/assets/js/14.e63b49ae.js" as="script"><link rel="prefetch" href="/assets/js/10.50fde917.js"><link rel="prefetch" href="/assets/js/11.73587a16.js"><link rel="prefetch" href="/assets/js/12.00962458.js"><link rel="prefetch" href="/assets/js/13.5eb71446.js"><link rel="prefetch" href="/assets/js/15.1234fb42.js"><link rel="prefetch" href="/assets/js/16.5b88b8d7.js"><link rel="prefetch" href="/assets/js/17.6df1e310.js"><link rel="prefetch" href="/assets/js/18.4b41870f.js"><link rel="prefetch" href="/assets/js/19.de2f2260.js"><link rel="prefetch" href="/assets/js/20.41a57f7b.js"><link rel="prefetch" href="/assets/js/21.05021021.js"><link rel="prefetch" href="/assets/js/3.65af1edd.js"><link rel="prefetch" href="/assets/js/4.54f496b0.js"><link rel="prefetch" href="/assets/js/5.e405b15b.js"><link rel="prefetch" href="/assets/js/6.e1e66a89.js"><link rel="prefetch" href="/assets/js/7.fd30c96f.js"><link rel="prefetch" href="/assets/js/8.77569bdf.js"><link rel="prefetch" href="/assets/js/9.6d276d40.js">
<link rel="stylesheet" href="/assets/css/0.styles.f8cb2318.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/logo.png" alt="买买买文档平台" class="logo"> <span class="site-name can-hide">买买买文档平台</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">查询导览</a></div><div class="nav-item"><a href="/product/" class="nav-link">项目清单</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="团队文档" class="dropdown-title"><span class="title">团队文档</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/team/frontend/" class="nav-link router-link-active">前端</a></li><li class="dropdown-item"><!----> <a href="/team/ios/" class="nav-link">IOS端</a></li><li class="dropdown-item"><!----> <a href="/team/android/" class="nav-link">安卓端</a></li><li class="dropdown-item"><!----> <a href="/team/backend/" class="nav-link">服务端</a></li><li class="dropdown-item"><!----> <a href="/team/quality/" class="nav-link">测试端</a></li></ul></div></div><div class="nav-item"><a href="/" class="nav-link">项目管控</a></div><div class="nav-item"><a href="/" class="nav-link">行政管理</a></div><div class="nav-item"><a href="/util/" class="nav-link">协作工具</a></div><div class="nav-item"><a href="/guide/" class="nav-link">文档写作平台入门介绍</a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">查询导览</a></div><div class="nav-item"><a href="/product/" class="nav-link">项目清单</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="团队文档" class="dropdown-title"><span class="title">团队文档</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/team/frontend/" class="nav-link router-link-active">前端</a></li><li class="dropdown-item"><!----> <a href="/team/ios/" class="nav-link">IOS端</a></li><li class="dropdown-item"><!----> <a href="/team/android/" class="nav-link">安卓端</a></li><li class="dropdown-item"><!----> <a href="/team/backend/" class="nav-link">服务端</a></li><li class="dropdown-item"><!----> <a href="/team/quality/" class="nav-link">测试端</a></li></ul></div></div><div class="nav-item"><a href="/" class="nav-link">项目管控</a></div><div class="nav-item"><a href="/" class="nav-link">行政管理</a></div><div class="nav-item"><a href="/util/" class="nav-link">协作工具</a></div><div class="nav-item"><a href="/guide/" class="nav-link">文档写作平台入门介绍</a></div> <!----></nav> <ul class="sidebar-links"><li><a href="/team/frontend/" class="sidebar-link">前端 Frontend</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/team/frontend/#能力输出" class="sidebar-link">能力输出</a></li><li class="sidebar-sub-header"><a href="/team/frontend/#项目构建说明" class="sidebar-link">项目构建说明</a></li><li class="sidebar-sub-header"><a href="/team/frontend/#项目环境要求" class="sidebar-link">项目环境要求</a></li><li class="sidebar-sub-header"><a href="/team/frontend/#项目技术组成" class="sidebar-link">项目技术组成</a></li><li class="sidebar-sub-header"><a href="/team/frontend/#代码版本控制位置" class="sidebar-link">代码版本控制位置</a></li></ul></li><li><a href="/team/frontend/plugins.html" class="sidebar-link">功能插件</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/team/frontend/plugins.html#拼图验证码插件" class="sidebar-link">拼图验证码插件</a></li><li class="sidebar-sub-header"><a href="/team/frontend/plugins.html#短信验证" class="sidebar-link">短信验证</a></li><li class="sidebar-sub-header"><a href="/team/frontend/plugins.html#侧边栏抽屉" class="sidebar-link">侧边栏抽屉</a></li><li class="sidebar-sub-header"><a href="/team/frontend/plugins.html#数据表格" class="sidebar-link">数据表格</a></li><li class="sidebar-sub-header"><a href="/team/frontend/plugins.html#数据下载-导出" class="sidebar-link">数据下载/导出</a></li><li class="sidebar-sub-header"><a href="/team/frontend/plugins.html#选择器" class="sidebar-link">选择器</a></li></ul></li><li><a href="/team/frontend/components.html" class="sidebar-link">业务组件</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/team/frontend/components.html#数据导入导出" class="sidebar-link">数据导入导出</a></li><li class="sidebar-sub-header"><a href="/team/frontend/components.html#操作权限应用" class="sidebar-link">操作权限应用</a></li><li class="sidebar-sub-header"><a href="/team/frontend/components.html#选择器" class="sidebar-link">选择器</a></li></ul></li><li><a href="/team/frontend/http.html" class="active sidebar-link">数据交互格式标准</a></li><li><a href="/team/frontend/framework.html" class="sidebar-link">系统框架</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/team/frontend/framework.html#目录结构描述" class="sidebar-link">目录结构描述</a></li><li class="sidebar-sub-header"><a href="/team/frontend/framework.html#api" class="sidebar-link">API</a></li><li class="sidebar-sub-header"><a href="/team/frontend/framework.html#自定义指令集-directive" class="sidebar-link">自定义指令集 directive</a></li><li class="sidebar-sub-header"><a href="/team/frontend/framework.html#表单校验规则" class="sidebar-link">表单校验规则</a></li></ul></li><li><a href="/team/frontend/web-open-platform.html" class="sidebar-link">网页能力开放平台</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/team/frontend/web-open-platform.html#平台介绍及使用规范" class="sidebar-link">平台介绍及使用规范</a></li><li class="sidebar-sub-header"><a href="/team/frontend/web-open-platform.html#现有项目-模块" class="sidebar-link">现有项目/模块</a></li></ul></li><li><a href="/team/frontend/quality.html" class="sidebar-link">质量保证体系</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/team/frontend/quality.html#团队应用现状" class="sidebar-link">团队应用现状</a></li><li class="sidebar-sub-header"><a href="/team/frontend/quality.html#语法检查" class="sidebar-link">语法检查</a></li><li class="sidebar-sub-header"><a href="/team/frontend/quality.html#单元测试" class="sidebar-link">单元测试</a></li><li class="sidebar-sub-header"><a href="/team/frontend/quality.html#端对端测试(end-to-end)" class="sidebar-link">端对端测试(End-to-end)</a></li></ul></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="数据交互格式标准"><a href="#数据交互格式标准" aria-hidden="true" class="header-anchor">#</a> 数据交互格式标准</h1> <p>前后端数据交互格式详细说明</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token punctuation">{</span>
<span class="token comment">/**
* 请求结果
* -1:请求成功,但业务检查不通过
* 0:请求成功,数据正常返回
* 2:token 超时,主要用于用户登录超时、特定情况下主动清除用户登录状态
* 例如用户权限发生变化等场景
*/</span>
<span class="token string">"code"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token comment">/**
* 提示信息,错误时按UI规范显示错误信息,成功则返回操作成功
*/</span>
<span class="token string">"msg"</span><span class="token punctuation">:</span> <span class="token string">"姓名不能超过20个字符"</span><span class="token punctuation">,</span>
<span class="token comment">/**
* 请求返回结果 JSON类型
* 正常请求后返回的内容都应在data节点下生成
*/</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token comment">/** int、String、long等普通类型 */</span>
<span class="token string">"attr"</span><span class="token punctuation">:</span> value<span class="token punctuation">,</span>
<span class="token comment">/** 属性为JSON对象 */</span>
<span class="token string">"user"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"zhangsan"</span><span class="token punctuation">,</span>
<span class="token string">"age"</span><span class="token punctuation">:</span> <span class="token number">18</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token comment">/** 属性为一维数组,An为一维数组元素 */</span>
<span class="token string">"users"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token constant">A1</span><span class="token punctuation">,</span><span class="token constant">A2</span><span class="token punctuation">,</span><span class="token operator">...</span>An<span class="token punctuation">]</span>,
<span class="token comment">/** 属性为对象数组 */</span>
<span class="token string">"users"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span><span class="token constant">JSON</span>类型<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span><span class="token constant">JSON</span>类型<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token operator">...</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">]</span>,
<span class="token comment">/**
* grid表格结果集格式 表单记录 JSON类型
*/</span>
<span class="token string">"gridResult"</span><span class="token punctuation">:</span><span class="token punctuation">{</span>
<span class="token comment">//当前页</span>
<span class="token string">"pageNumber"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token comment">//总记录数</span>
<span class="token string">"totalRow"</span><span class="token punctuation">:</span> <span class="token number">3</span><span class="token punctuation">,</span>
<span class="token comment">//数据列表内容</span>
<span class="token string">"lists"</span><span class="token punctuation">:</span><span class="token punctuation">[</span>
<span class="token punctuation">{</span>
<span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"prop2"</span><span class="token punctuation">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
<span class="token string">"status"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"remark"</span><span class="token punctuation">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
<span class="token string">"prop1"</span><span class="token punctuation">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
<span class="token string">"statusName"</span><span class="token punctuation">:</span> <span class="token string">"启用"</span><span class="token punctuation">,</span>
<span class="token string">"description"</span><span class="token punctuation">:</span> <span class="token string">"系统标题名称"</span><span class="token punctuation">,</span>
<span class="token string">"value"</span><span class="token punctuation">:</span> <span class="token string">"后台管理系统"</span><span class="token punctuation">,</span>
<span class="token string">"prop3"</span><span class="token punctuation">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
<span class="token string">"code"</span><span class="token punctuation">:</span> <span class="token string">"SYSTEM_CAPTION"</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span>
<span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token number">12860</span><span class="token punctuation">,</span>
<span class="token string">"prop2"</span><span class="token punctuation">:</span> <span class="token string">"2"</span><span class="token punctuation">,</span>
<span class="token string">"status"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"remark"</span><span class="token punctuation">:</span> <span class="token string">"2"</span><span class="token punctuation">,</span>
<span class="token string">"prop1"</span><span class="token punctuation">:</span> <span class="token string">"2"</span><span class="token punctuation">,</span>
<span class="token string">"statusName"</span><span class="token punctuation">:</span> <span class="token string">"启用"</span><span class="token punctuation">,</span>
<span class="token string">"description"</span><span class="token punctuation">:</span> <span class="token string">"定时任务开关"</span><span class="token punctuation">,</span>
<span class="token string">"value"</span><span class="token punctuation">:</span> <span class="token string">"0"</span><span class="token punctuation">,</span>
<span class="token string">"prop3"</span><span class="token punctuation">:</span> <span class="token string">"2"</span><span class="token punctuation">,</span>
<span class="token string">"code"</span><span class="token punctuation">:</span> <span class="token string">"SYSTEM_QUARTZ"</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span>
<span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token number">12861</span><span class="token punctuation">,</span>
<span class="token string">"prop2"</span><span class="token punctuation">:</span> <span class="token string">"3"</span><span class="token punctuation">,</span>
<span class="token string">"status"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"remark"</span><span class="token punctuation">:</span> <span class="token string">"3"</span><span class="token punctuation">,</span>
<span class="token string">"prop1"</span><span class="token punctuation">:</span> <span class="token string">"3"</span><span class="token punctuation">,</span>
<span class="token string">"statusName"</span><span class="token punctuation">:</span> <span class="token string">"启用"</span><span class="token punctuation">,</span>
<span class="token string">"description"</span><span class="token punctuation">:</span> <span class="token string">"3"</span><span class="token punctuation">,</span>
<span class="token string">"value"</span><span class="token punctuation">:</span> <span class="token string">"3"</span><span class="token punctuation">,</span>
<span class="token string">"prop3"</span><span class="token punctuation">:</span> <span class="token string">"3"</span><span class="token punctuation">,</span>
<span class="token string">"code"</span><span class="token punctuation">:</span> <span class="token string">"3"</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span><span class="token operator">...</span><span class="token punctuation">}</span>
<span class="token punctuation">]</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br></div></div></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
←
<a href="/team/frontend/components.html" class="prev">业务组件</a></span> <span class="next"><a href="/team/frontend/framework.html">系统框架</a>
→
</span></p></div> </main></div><div class="global-ui"></div></div>
<script src="/assets/js/app.bf915ba5.js" defer></script><script src="/assets/js/2.930005fe.js" defer></script><script src="/assets/js/14.e63b49ae.js" defer></script>
</body>
</html>