4. After the creation is successful, name it casually. Here I name it: Aliyun disk sign-in
5. Click【Service】-【Add Service】
6. Add all three services
7. Copy the following code into the editor
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 !=""){
// 发起网络请求-获取tokenlet 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"}}}}var sftz = Application.Range("E"+1).Text
if(sftz=="是"){
var jsyx = Application.Range("E"+2).Text
// 配置发送邮箱let mailer =SMTP.login({
host:"smtp.163.com",// 邮箱 的SMTP服务器的域名port:465,username:"[email protected]",// 邮箱地址password:"QADSEMPKDHDAVWVD",// 邮箱的SMTP密码,非密码secure:true});
mailer.send({
from:"阿里云盘签到<[email protected]>",// 发件人to: jsyx,// 收件人subject:"阿里云盘签到通知-"+data_time,// 主题text: value,// 文本})}else{
console.log(value)}
8. Obtain the value of refresh_token from the browser: log in to Alibaba Cloud Disk with the browser
9. Copy the refresh_token value to the table, (A2-A20) can write multiple account tokens
10. Fill in the form whether to receive the reward (if yes, you will automatically receive the sign-in reward, if not, you will only sign in, and you can manually receive the sign-in reward when you need it), whether to send an email notification, if you send an email notification, you must write it in the receiving mailbox Address, don’t write it if you don’t send it, pay attention to the correct position, remember to save it after editing the form.
11. In the script, click the [Save] button above, and then click the [Run] button
12. Close the code editing box, click [Efficiency] - [Advanced Development] - [Timed Task]
13. Click [Create Task] to set the running time every day, select the script you just selected, save it, and you're done
14. You can set your own mailbox and SMTP protocol in the script