Skip to content

Commit 4f76e6d

Browse files
committed
complex请求改为和readme一致;优化注释
1 parent 0d71592 commit 4f76e6d

4 files changed

Lines changed: 16 additions & 18 deletions

File tree

APIJSON-JavaScript/access_permitted.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"Wallet":{
1313
"userId":38710
1414
},
15+
//以下都不需要了,新版APIJSON已用session做了自动化登录验证及自动化角色权限管理
1516
"currentUserId":38710,
1617
"loginPassword":"apijson"
1718
};

APIJSON-JavaScript/get/array.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<body>
99
<script >
1010
var json = {
11-
"User[]":{ //数组命名和内部对象同名时会将对象去包装
11+
"User[]":{ //数组命名和内部对象同名时会将对象去包装 "User[]":[{"User":{Content}}, ...] => "User[]":[{Content}, ...]
1212
"count":5,
1313
"page":1,
1414
"User":{
@@ -17,7 +17,7 @@
1717
}
1818
};
1919

20-
rq = request(url_get, json, false, function () {
20+
var rq = request(url_get, json, false, function () {
2121
if (rq.readyState !== 4) {
2222
return;
2323
}

APIJSON-JavaScript/get/complex.html

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,23 @@
77
</head>
88
<body>
99
<script >
10+
//貌似在JavaScript里JSON注释前不能多于一个空格,否则不能解析
1011
var json = {
11-
"[]":{
12-
"count":3,
13-
"page":0,
12+
"[]":{ //请求一个数组
13+
"page":0, //数组条件
14+
"count":2,
1415
"Moment":{
15-
"@column":"id,userId,content,praiseUserIdList",
16-
"userId{}":[
17-
38710,
18-
70793
19-
]
16+
"content$":"%a%" //对象条件,搜索content中包含 "a" 的动态
2017
},
21-
"User":{
22-
"@column":"id,name,head",
23-
"id@":"/Moment/userId" //已通过encode函数自动转义 encodeURIComponent("/Moment/userId")
18+
"User":{ //请求一个名为User的对象
19+
"id@":"/Moment/userId", //缺省依赖路径,从所处容器的父容器路径开始
20+
"@column":"id,name,head" //指定返回字段
2421
},
25-
"[]":{
26-
"count":3,
22+
"Comment[]":{ //请求一个名为Comment的数组,并去除Comment包装
23+
"count":2,
2724
"Comment":{
28-
"momentId@":"[]/Moment/id" //已通过encode函数自动转义 encodeURIComponent("[]/Moment/id")
29-
},
25+
"momentId@":"[]/Moment/id" //完整依赖路径
26+
}
3027
}
3128
}
3229
};

APIJSON-JavaScript/put.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"tag":"Moment",
1212
"Moment":{
1313
"id":15,
14-
"praiseUserIdList-":[
14+
"praiseUserIdList-":[ //去除以下userId
1515
82001,
1616
82002
1717
],

0 commit comments

Comments
 (0)