http.html 22.2 KB
<!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.ec3b592e.css" as="style"><link rel="preload" href="/assets/js/app.98818bfe.js" as="script"><link rel="preload" href="/assets/js/2.673282d9.js" as="script"><link rel="preload" href="/assets/js/14.c6959c97.js" as="script"><link rel="prefetch" href="/assets/js/10.627ba247.js"><link rel="prefetch" href="/assets/js/11.11702af9.js"><link rel="prefetch" href="/assets/js/12.3ee7fc03.js"><link rel="prefetch" href="/assets/js/13.75566897.js"><link rel="prefetch" href="/assets/js/15.3c56b86a.js"><link rel="prefetch" href="/assets/js/16.4cc6f711.js"><link rel="prefetch" href="/assets/js/17.8812e53b.js"><link rel="prefetch" href="/assets/js/18.9db1ce50.js"><link rel="prefetch" href="/assets/js/19.0ef31c07.js"><link rel="prefetch" href="/assets/js/20.44e8c3a1.js"><link rel="prefetch" href="/assets/js/3.da4f96ed.js"><link rel="prefetch" href="/assets/js/4.68306dfc.js"><link rel="prefetch" href="/assets/js/5.d821aca2.js"><link rel="prefetch" href="/assets/js/6.2d152780.js"><link rel="prefetch" href="/assets/js/7.21c59694.js"><link rel="prefetch" href="/assets/js/8.351351cf.js"><link rel="prefetch" href="/assets/js/9.16e4977d.js">
    <link rel="stylesheet" href="/assets/css/0.styles.ec3b592e.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"><a href="/util/" class="nav-link">协作工具</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">工作团队</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/team/design/" 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/frontend/" class="nav-link router-link-active">前端</a></li><li class="dropdown-item"><!----> <a href="/team/android/" class="nav-link">安卓端</a></li><li class="dropdown-item"><!----> <a href="/team/ios/" 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="/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"><a href="/util/" class="nav-link">协作工具</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">工作团队</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/team/design/" 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/frontend/" class="nav-link router-link-active">前端</a></li><li class="dropdown-item"><!----> <a href="/team/android/" class="nav-link">安卓端</a></li><li class="dropdown-item"><!----> <a href="/team/ios/" 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="/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/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/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><li><a href="/team/frontend/http.html" class="active sidebar-link">数据交互格式标准</a></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">&quot;code&quot;</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">&quot;msg&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;姓名不能超过20个字符&quot;</span><span class="token punctuation">,</span>
	<span class="token comment">/**
	 * 请求返回结果 JSON类型
	 * 正常请求后返回的内容都应在data节点下生成
	 */</span>
    <span class="token string">&quot;data&quot;</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>  
		<span class="token comment">/** int、String、long等普通类型 */</span>
		<span class="token string">&quot;attr&quot;</span><span class="token punctuation">:</span> value<span class="token punctuation">,</span> 
		 <span class="token comment">/**  属性为JSON对象  */</span> 
		<span class="token string">&quot;user&quot;</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
			<span class="token string">&quot;name&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;zhangsan&quot;</span><span class="token punctuation">,</span>
			<span class="token string">&quot;age&quot;</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">&quot;users&quot;</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">&quot;users&quot;</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">&quot;gridResult&quot;</span><span class="token punctuation">:</span><span class="token punctuation">{</span>
			<span class="token comment">//当前页</span>
			<span class="token string">&quot;pageNumber&quot;</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">&quot;totalRow&quot;</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">&quot;lists&quot;</span><span class="token punctuation">:</span><span class="token punctuation">[</span>
				<span class="token punctuation">{</span>
					<span class="token string">&quot;id&quot;</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
					<span class="token string">&quot;prop2&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;status&quot;</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
					<span class="token string">&quot;remark&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;prop1&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;statusName&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;启用&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;description&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;系统标题名称&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;value&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;后台管理系统&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;prop3&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;code&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;SYSTEM_CAPTION&quot;</span>
				<span class="token punctuation">}</span><span class="token punctuation">,</span>
				<span class="token punctuation">{</span>
					<span class="token string">&quot;id&quot;</span><span class="token punctuation">:</span> <span class="token number">12860</span><span class="token punctuation">,</span>
					<span class="token string">&quot;prop2&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;2&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;status&quot;</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
					<span class="token string">&quot;remark&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;2&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;prop1&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;2&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;statusName&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;启用&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;description&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;定时任务开关&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;value&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;0&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;prop3&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;2&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;code&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;SYSTEM_QUARTZ&quot;</span>
				<span class="token punctuation">}</span><span class="token punctuation">,</span>
				<span class="token punctuation">{</span>
					<span class="token string">&quot;id&quot;</span><span class="token punctuation">:</span> <span class="token number">12861</span><span class="token punctuation">,</span>
					<span class="token string">&quot;prop2&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;3&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;status&quot;</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
					<span class="token string">&quot;remark&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;3&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;prop1&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;3&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;statusName&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;启用&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;description&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;3&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;value&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;3&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;prop3&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;3&quot;</span><span class="token punctuation">,</span>
					<span class="token string">&quot;code&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;3&quot;</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/quality.html" class="prev">
          质量保证体系
        </a></span> <!----></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/assets/js/app.98818bfe.js" defer></script><script src="/assets/js/2.673282d9.js" defer></script><script src="/assets/js/14.c6959c97.js" defer></script>
  </body>
</html>