var myDate = newDate(); var data_time = myDate.toLocaleDateString()
functionsleep(d){ for(var t = Date.now();Date.now() - t <= d;); } var value= "" for (let ii = 2; ii <= 20; ii++){ dyg = "A"+ii
var refresh_token = Application.Range(dyg).Text if(refresh_token != ""){ // 发起网络请求-获取token let data = HTTP.post("https://auth.aliyundrive.com/v2/account/token", JSON.stringify({ "grant_type": "refresh_token", "refresh_token":refresh_token }) ) data = data.json() var access_token = data['access_token'] var phone = data["user_name"]
if (access_token == undefined){ var value ="单元格【"+dyg+"】内的token值错误,程序执行失败,请重新复制正确的token值"+"\n" }else{ try{ var access_token2 = 'Bearer '+access_token // 签到 let data2 = HTTP.post("https://member.aliyundrive.com/v1/activity/sign_in_list", JSON.stringify({"_rx-s": "mobile"}), {headers:{"Authorization":access_token2}} ) data2=data2.json() var signin_count = data2['result']['signInCount'] var value =value+ "账号:"+data["user_name"]+"-签到成功, 本月累计签到"+ signin_count+"天"+"\n"
}catch{ var value ="单元格【"+dyg+"】内的token签到失败"+"\n" return } sleep(1000)
var sflq = Application.Range("B"+ii).Text if (sflq == "是"){ try{ // 领取奖励 let data3 = HTTP.post( "https://member.aliyundrive.com/v1/activity/sign_in_reward?_rx-s=mobile", JSON.stringify({"signInDay": signin_count}), {headers:{"Authorization":access_token2}} ) data3=data3.json() var value = value +"本次签到获得"+data3["result"]["name"] +","+data3["result"]["description"]+"\n" }catch{ var value = value+ "账号:"+data["user_name"]+"-领取奖励失败"+"\n" } }else{ value = value +" 奖励待领取"+"\n" } } } } console.log(value) var sftz = Application.Range("E"+1).Text if (sftz=="是"){ var jsyx = Application.Range("E"+2).Text
var zdyfs = Application.Range("H"+1).Text if (zdyfs == "是"){ var zdy_host = Application.Range("H"+2).Text var zdy_post =Number(Application.Range("H"+3).Text) var zdy_username = Application.Range("H"+4).Text var zdy_pasd = Application.Range("H"+5).Text }else{ var zdy_host = "smtp.163.com" var zdy_post = 465 var zdy_username = "fs8484848@163.com" var zdy_pasd = "QADSEMPKDHDAVWVD" }