function main() {
logd("检查自动化环境...")
logd("开始执行脚本...")
let appId = "sjfjvkpw"
let appSecret = "ykjscxcs"
let cardNo = "cbwolrftnw"
let inited = ecNetCard.netCardInit(appId, appSecret, "1")
logd("inited card => " + JSON.stringify(inited));
let bind = ecNetCard.netCardBind(cardNo)
logd("bind " + JSON.stringify(bind))
loge("bind {}", JSON.stringify(bind))
let bindResult = false;
if (bind != null && bind != undefined && bind["code"] == 0) {
loge("卡密绑定成功")
loge("剩余时间:" + bind['data']['leftDays'] + "天")
loge("激活时间:" + bind['data']['startTime'])
loge("过期时间:" + bind['data']['expireTime'])
bindResult = true;
} else {
if (bind == null || bind == undefined) {
loge("卡密绑定失败,无返回值 ")
} else {
loge("卡密绑定失败: " + bind["msg"])
}
}
sleep(5000)
if (!bindResult) {
return
}
let user_ageJson = ecNetCard.netCardGetCloudVar("user_age")
loge("user age=> " + JSON.stringify(user_ageJson))
loge("user age的字=> " + user_ageJson['data'])
let up = ecNetCard.netCardUpdateCloudVar("user_age", "12222");
loge("netCardUpdateCloudVar => " + JSON.stringify(up))
if (up['code'] == 0) {
loge("netCardUpdateCloudVar 更新成功")
}
let unddd = ecNetCard.netCardUnbind(cardNo, "12323")
loge("netCardUnbind {}", JSON.stringify(unddd))
sleep(2000)
while (true) {
sleep(1000)
}
}
main();