| 226 | } |
| 227 | |
| 228 | function StartSignGuild(v) { //巴哈姆特公会签到 |
| 229 | |
| 230 | //签到成功: {"ok":1,"msg":"本日簽到成功!獲得5貢獻度"} |
| 231 | //已签过: {"error":1,"msg":"您今天已經簽到過了!"} |
| 232 | //公会ID错误: {"error":1,"msg":"此公會社團不存在。"} |
| 233 | //未加入公会: {"error":1,"msg":"你還不是成員,歡迎加入!"} |
| 234 | //未登录: {"error":1,"msg":"請先登入"} |
| 235 | |
| 236 | return $.http.post({ //使用post方法签到公会 (Promise实例对象) |
| 237 | url: 'https://guild.gamer.com.tw/ajax/guildSign.php', //公会签到接口 |
| 238 | headers: {}, //请求头, 客户端将自动设置Cookie字段 |
| 239 | body: `sn=${v.sn}` //把查询到的公会ID放进请求体 |
| 240 | }) |
| 241 | .then((res) => { //网络请求成功后的处理 |
| 242 | const body = JSON.parse(res.body); //解析响应体json为对象 |
| 243 | $.log('', `🔷<${v.name}>`, `${body.ok?`✅`:`❌`}${body.msg}`); //打印日志, 包含签到结果 |
| 244 | if (body.ok) { //如果签到成功 |
| 245 | return 1; //返回1表示成功 |
| 246 | } else { |
| 247 | return 0; //返回0表示失败 |
| 248 | } |
| 249 | }) |
| 250 | .catch(e => { //捕获异常, 打印日志 |
| 251 | $.log('', `🔷<${v.name}>`, `❌签到失败: ${e.message||e}`); |
| 252 | return 0; //返回0表示失败 |
| 253 | }); |
| 254 | } |
| 255 | |
| 256 | function BahamutAnswer() { //动画疯答题 |
| 257 | |