今天学了一下.net的WCF组件,边心血来潮,想着现在不都是前后分离,调接口开发不,于是赶紧写了一简单的后台数据,哈哈 废话不多说,直接上代码: 注意需要导入库! 实体类:Customer using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace domain { public class Cust…
这种用法包括前端和后端: 前端: 1. 转化为JSON对象方便操作 var jsonObj = JSON.parse(str); 得到的是一个json数组对象,可以通过 for (var p in jsonObj){} 来遍历数组中的每个对象,其中p表示key,jsonObj[p]表示key所对应的值. 2. 转化为字符串 var jsonStr = JSON.stringify(jsonObj) 后端:需要用到阿里的fastjson包(其他的用法可以参考博客:https://blog.csdn…