├── README.md ├── assets ├── IMG_4350.jpg ├── IMG_4351.jpg ├── IMG_4352.jpg ├── IMG_4353.jpg ├── IMG_4354.jpg ├── IMG_4355.jpg ├── IMG_4356.jpg ├── IMG_4357.jpg ├── IMG_4358.jpg ├── IMG_4359.jpg └── IMG_4361.jpg └── buaaCheck.js /README.md: -------------------------------------------------------------------------------- 1 | # buaa_daily_check 2 | 3 | 适用于ios的自动每日健康上报脚本,不需要定位。 4 | 5 | ## 使用方法 6 | 7 | 1. 先在ios上下载Scriptable软件 8 | 9 | 2. buaaCheck.js添加到Scriptable内 10 | 11 | 12 | 13 | 3. 修改buaaCheck.js的username和password为自己统一身份认证的用户名和密码 14 | 15 | 16 | 17 | 4. 运行脚本查看是否有错误 18 | 19 | 20 | 21 | 5. 在快捷指令app里面添加一个每天下午5:30的自动化 22 | 23 | 24 | 25 | 26 | 6. 选择Scriptable里面的buaaCheck脚本,将运行前询问去掉 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /assets/IMG_4350.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4350.jpg -------------------------------------------------------------------------------- /assets/IMG_4351.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4351.jpg -------------------------------------------------------------------------------- /assets/IMG_4352.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4352.jpg -------------------------------------------------------------------------------- /assets/IMG_4353.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4353.jpg -------------------------------------------------------------------------------- /assets/IMG_4354.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4354.jpg -------------------------------------------------------------------------------- /assets/IMG_4355.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4355.jpg -------------------------------------------------------------------------------- /assets/IMG_4356.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4356.jpg -------------------------------------------------------------------------------- /assets/IMG_4357.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4357.jpg -------------------------------------------------------------------------------- /assets/IMG_4358.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4358.jpg -------------------------------------------------------------------------------- /assets/IMG_4359.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4359.jpg -------------------------------------------------------------------------------- /assets/IMG_4361.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zackertypical/buaa_daily_check/4ab50ee860e6ed48def6313260bef54b1249a549/assets/IMG_4361.jpg -------------------------------------------------------------------------------- /buaaCheck.js: -------------------------------------------------------------------------------- 1 | // Variables used by Scriptable. 2 | // These must be at the very top of the file. Do not edit. 3 | // icon-color: deep-purple; icon-glyph: magic; 4 | 5 | username = ""; 6 | password = ""; 7 | 8 | userdata={"username": username,"password":password}; 9 | 10 | login_url = "https://app.buaa.edu.cn/uc/wap/login/check"; 11 | info_url = "https://app.buaa.edu.cn/buaaxsncov/wap/default/get-info"; 12 | save_url = "https://app.buaa.edu.cn/buaaxsncov/wap/default/save"; 13 | 14 | notify = new Notification(); 15 | notify.title = "今日打卡"; 16 | 17 | function encode_formdata(obj){ 18 | var str = []; 19 | for (var key in obj) { 20 | if (obj.hasOwnProperty(key)) { 21 | str.push(encodeURIComponent(key) + "=" + encodeURIComponent(obj[key])) 22 | // console.log(key + " -> " + obj[key]); 23 | } 24 | } 25 | return str.join("&"); 26 | }; 27 | 28 | 29 | async function check(){ 30 | var req_login = new Request(login_url); 31 | req_login.headers = {"Content-Type":"application/x-www-form-urlencoded"}; 32 | req_login.method = "POST"; 33 | req_login.body = encode_formdata(userdata); 34 | await req_login.load(); 35 | 36 | var resp = req_login.response; 37 | 38 | if(resp.statusCode != 200){ 39 | console.log("login failed."); 40 | notify.body="登陆失败"; 41 | return false; 42 | }; 43 | console.log("login success!"); 44 | var cookie = ""; 45 | resp.cookies.forEach(element => { 46 | cookie = cookie+element["name"]+"="+element["value"]+"; " 47 | }); 48 | 49 | // console.log(cookie); 50 | 51 | var req_info = new Request(info_url); 52 | // req_info.headers = {"Cookie": cookie}; 53 | 54 | var info_data = await req_info.loadJSON(); 55 | 56 | if(req_info.response.statusCode!=200){ 57 | console.log("rediret failed.") 58 | notify.body="获取信息失败"; 59 | return false; 60 | } 61 | 62 | // console.log(info_data) 63 | 64 | var save_data = { 65 | "sfzs": "1", 66 | "bzxyy": "", "bzxyy_other": "", 67 | "brsfzc": "1", "tw": "", "sfcxzz": "", "zdjg": "", 68 | "zdjg_other": "", "sfgl": "", "gldd": "", 69 | "gldd_other": "", "glyy": "", "glyy_other": "", 70 | "gl_start": "", "gl_end": "", "sfmqjc": "", 71 | "sfzc_14": "1", "sfqw_14": "0", "sfqw_14_remark": "", 72 | "sfzgfx": "0", "sfzgfx_remark": "", 73 | "sfjc_14": "0", "sfjc_14_remark": "", "sfjcqz_14": "0", 74 | "sfjcqz_14_remark": "", "sfgtjz_14": "0", 75 | "sfgtjz_14_remark": "", "szsqqz": "0", "sfyqk": "", 76 | "szdd": "1", "area": "北京市 海淀区", 77 | "city": "北京市", "province": "北京市", 78 | "address": "北京市海淀区花园路街道北京航空航天大学学生公寓13号楼北京航空航天大学学院路校区", 79 | "gwdz": "", "is_move": "0", "move_reason": "", "move_remark": "", 80 | "realname": "XX", "number": "XX", "uid": "XX", "created": "XX", 81 | "date": "XX", "id": "XX" 82 | }; 83 | 84 | save_data["realname"] = info_data["d"]["uinfo"]["realname"]; 85 | save_data["number"] = info_data["d"]["uinfo"]["role"]["number"]; 86 | save_data["uid"] = info_data["d"]["info"]["uid"]; 87 | save_data["created"] = info_data["d"]["info"]["created"]; 88 | save_data["date"] = info_data["d"]["info"]["date"]; 89 | save_data["id"] = info_data["d"]["info"]["id"]; 90 | 91 | var req_save = new Request(save_url); 92 | req_save.method = "POST"; 93 | // req_save.headers = {"Cookie": cookie,"Content-Type":"application/x-www-form-urlencoded"}; 94 | 95 | req_save.body = encode_formdata(save_data); 96 | var resp_json = await req_save.loadJSON(); 97 | 98 | console.log(resp_json); 99 | notify.body=JSON.stringify(resp_json); 100 | return true; 101 | }; 102 | 103 | await check(); 104 | notify.schedule(); 105 | Script.complete(); --------------------------------------------------------------------------------