# 介绍
potato cloud 自动精灵 sdk 开发包,potato cloud 全方位的后端服务平台。
# 项目地址
https://gitee.com/chengdu-xuda-network/potatocloudzdjlsdk.git (opens new window)
# 使用说明
# 1:引入 SDK 并初始化
在脚本运行前运行动作-JS代码,粘贴PotatoSDK.js
# 2:调用 SDK
var PotatoCloud = zdjl.getVar("potatoSDK");
/**
* 初始化方法
* 0 不加密
* 1 Base64
* 2 AES/ECB/PKCS5Padding
* 3 DES/ECB/PKCS7
* 4 AES/ECB/NOPadding(16位秘钥)
* 5 RC4
*/
var myApp = PotatoCloud.createApp({
askKey: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBJZCI6OTEyOTY2ODA2ODM5ODQwNzY4LCJnZXRNYW5hZ2VtZW50SWQiOjY5ODExOTE5MzkxODc4NzU4NCwiVElNRSI6MTcwNjc3OTg1OTA5OX0.4qMMQitEx8memjOKOsAs9zs-qarH_va1H6UmocV1W50",
signSecretKey: "123456",
signType: 1,
requestEncryptType: 0,
responseEncryptType: 5,
encryptSecretKey: "1111111111111111"
});
/**
* 卡密验证
*/
var verifyParam = {
"cardStr": "420A14B0FB9AD7306B0CE240318BE90E",
"mac": "12121"
};
var res = myApp.verifyCardV2(verifyParam);
if (res.code == 200) {
console.log(JSON.stringify(res.data));
}else{
console.log(res)
}
/**
* 用户登录
*/
var loginParam = {
"userNumber": "123456789",
"passWord": "123456"
};
var res = myApp.login(loginParam);
if (res.code == 200) {
// 设置token
myApp.setUserToken(res.data.apiUserToken);
}
/**
* 自动携带用户token
* 获取标签列表
*/
var getLabelParam = {
"name": "12",
"id": "1"
};
var res = myApp.getLabelList(getLabelParam);
console.log(JSON.stringify(res));
/**
* 用户注册V2
*/
var registerParam = {
"userNumber": "313097897",
"passWord": "123456",
"email": "313097897@qq.com"
};
var res = myApp.registerV2(registerParam);
console.log(JSON.stringify(res));
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
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
# 参与贡献
potato cloud 全体开发人员
← GGLua AndroidLua →