接口返回数据前端换行显示方法

后端接口返回换行标签<br/>

前端用<pre></pre>预格式化标签接收后端数据即可

 

举个栗子:

"eventData": "{\r\n \"captureLibResult\": [\r\n {\r\n \"faces\": [\r\n {\r\n \"URL\": \"http://10.33.47.14:6040/pic?4dd943i5e-3ce498181m3epmbIq2sD0oiuBc0he & Expires = 1537864795 & Signature =Ko0xhlkahKKIEgVb + vE0iyjgwIaVe9k0dJySlrBryGs = & Algorithm = 1 \", \r\n \"age\": {\r\n \"ageGroup\": \"unknown\"\r\n }, \r\n \"faceRect\": {\r\n \"height\": 0.1070000007748604, \r\n \"width\": 0.06100000068545342, \r\n \"x\": 0.425000011920929, \r\n \"y\": 0.3700000047683716\r\n }, \r\n \"faceScore\": {\r\n \"enable\": \"true\", \r\n \"totalScore\": 0, \r\n \"type\": 1\r\n }, \r\n \"gender\": {\r\n \"value\": \"unknown\"\r\n }, \r\n \"glass\": {\r\n \"value\": \"unknown\"\r\n }\r\n }\r\n ], \r\n \"targetAttrs\": {\r\n \"bkgUrl\": \"http://10.33.47.14:6040/pic?=d71i666e6i985-f335aa--cf835d1a6d0ccicb=PbQloIsYLjSnnsiIRVtR2UpkKXTAZsDKvS8sVBGey4=&Algorithm=1\", \r\n \"cameraIndexCode\": \"9bb11d8fe23b4c348214d29cf02e7ac8\", \r\n \"deviceIndexCode\": \"5c1c1e18938640f5b3db936323519e70\", \r\n \"faceTime\": \"2018-09-25T16:23:29.000+08:00\", \r\n \"picServerIndexCode\": \"fb98a466-8ddb-46fb-8620-5b4d2f02fea7\", \r\n \"rect\": {\r\n \"height\": 0.3659999966621399, \r\n \"width\": 0.2060000002384186, \r\n \"x\": 0.04800000041723251, \r\n \"y\": 0.3459999859333038\r\n }\r\n }\r\n }\r\n ], \r\n \"channelID\": 1, \r\n \"dataType\": \"face\", \r\n \"ipAddress\": \"10.67.183.178\", \r\n \"portNo\": 8500\r\n }"
}

posted @ 2020-09-23 09:54  敲代码的羔羊  阅读(2501)  评论(0编辑  收藏  举报