/** * 当前周次 * @return string */ public function currentWeek() { $currentWeek = new CurrentWeek($this->cookie); return $currentWeek->get(); }
<?php header("Content-type: text/html; charset=utf-8"); //Init if (isset($_GET['role']) && isset($_GET['hash'])) { $role = $_GET['role']; $hash = $_GET['hash']; } else { exit('{"code":65535,"msg":"缺失参数"}'); } //Verify Hash include 'lib/VerifyHash.class.php'; $verify = new VerifyHash($role, $hash); if (!$verify->checkRole()) { exit('{"code":-1,"msg":"接口调用身份验证失败"}'); } //Get Data include 'lib/CurrentWeek.class.php'; $api = new CurrentWeek(); echo $api->getData();