diff --git a/application/api/controller/Ems.php b/application/api/controller/Ems.php index 7e487a3f..40d65f55 100644 --- a/application/api/controller/Ems.php +++ b/application/api/controller/Ems.php @@ -31,6 +31,7 @@ class Ems extends Api /** * 发送验证码 * + * @ApiMethod (POST) * @param string $email 邮箱 * @param string $event 事件名称 */ @@ -68,6 +69,7 @@ class Ems extends Api /** * 检测验证码 * + * @ApiMethod (POST) * @param string $email 邮箱 * @param string $event 事件名称 * @param string $captcha 验证码 diff --git a/application/api/controller/Sms.php b/application/api/controller/Sms.php index d1d1ec20..373b1299 100644 --- a/application/api/controller/Sms.php +++ b/application/api/controller/Sms.php @@ -18,6 +18,7 @@ class Sms extends Api /** * 发送验证码 * + * @ApiMethod (POST) * @param string $mobile 手机号 * @param string $event 事件名称 */ @@ -65,6 +66,7 @@ class Sms extends Api /** * 检测验证码 * + * @ApiMethod (POST) * @param string $mobile 手机号 * @param string $event 事件名称 * @param string $captcha 验证码 diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 5ff63766..df467131 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -32,13 +32,14 @@ class User extends Api /** * 会员登录 * + * @ApiMethod (POST) * @param string $account 账号 * @param string $password 密码 */ public function login() { - $account = $this->request->request('account'); - $password = $this->request->request('password'); + $account = $this->request->post('account'); + $password = $this->request->post('password'); if (!$account || !$password) { $this->error(__('Invalid parameters')); } @@ -54,13 +55,14 @@ class User extends Api /** * 手机验证码登录 * + * @ApiMethod (POST) * @param string $mobile 手机号 * @param string $captcha 验证码 */ public function mobilelogin() { - $mobile = $this->request->request('mobile'); - $captcha = $this->request->request('captcha'); + $mobile = $this->request->post('mobile'); + $captcha = $this->request->post('captcha'); if (!$mobile || !$captcha) { $this->error(__('Invalid parameters')); } @@ -92,6 +94,7 @@ class User extends Api /** * 注册会员 * + * @ApiMethod (POST) * @param string $username 用户名 * @param string $password 密码 * @param string $email 邮箱 @@ -100,11 +103,11 @@ class User extends Api */ public function register() { - $username = $this->request->request('username'); - $password = $this->request->request('password'); - $email = $this->request->request('email'); - $mobile = $this->request->request('mobile'); - $code = $this->request->request('code'); + $username = $this->request->post('username'); + $password = $this->request->post('password'); + $email = $this->request->post('email'); + $mobile = $this->request->post('mobile'); + $code = $this->request->post('code'); if (!$username || !$password) { $this->error(__('Invalid parameters')); } @@ -139,6 +142,7 @@ class User extends Api /** * 修改会员个人信息 * + * @ApiMethod (POST) * @param string $avatar 头像地址 * @param string $username 用户名 * @param string $nickname 昵称 @@ -147,10 +151,10 @@ class User extends Api public function profile() { $user = $this->auth->getUser(); - $username = $this->request->request('username'); - $nickname = $this->request->request('nickname'); - $bio = $this->request->request('bio'); - $avatar = $this->request->request('avatar', '', 'trim,strip_tags,htmlspecialchars'); + $username = $this->request->post('username'); + $nickname = $this->request->post('nickname'); + $bio = $this->request->post('bio'); + $avatar = $this->request->post('avatar', '', 'trim,strip_tags,htmlspecialchars'); if ($username) { $exists = \app\common\model\User::where('username', $username)->where('id', '<>', $this->auth->id)->find(); if ($exists) { @@ -174,6 +178,7 @@ class User extends Api /** * 修改邮箱 * + * @ApiMethod (POST) * @param string $email 邮箱 * @param string $captcha 验证码 */ @@ -181,7 +186,7 @@ class User extends Api { $user = $this->auth->getUser(); $email = $this->request->post('email'); - $captcha = $this->request->request('captcha'); + $captcha = $this->request->post('captcha'); if (!$email || !$captcha) { $this->error(__('Invalid parameters')); } @@ -208,14 +213,15 @@ class User extends Api /** * 修改手机号 * + * @ApiMethod (POST) * @param string $mobile 手机号 * @param string $captcha 验证码 */ public function changemobile() { $user = $this->auth->getUser(); - $mobile = $this->request->request('mobile'); - $captcha = $this->request->request('captcha'); + $mobile = $this->request->post('mobile'); + $captcha = $this->request->post('captcha'); if (!$mobile || !$captcha) { $this->error(__('Invalid parameters')); } @@ -242,14 +248,15 @@ class User extends Api /** * 第三方登录 * + * @ApiMethod (POST) * @param string $platform 平台名称 * @param string $code Code码 */ public function third() { $url = url('user/index'); - $platform = $this->request->request("platform"); - $code = $this->request->request("code"); + $platform = $this->request->post("platform"); + $code = $this->request->post("code"); $config = get_addon_config('third'); if (!$config || !isset($config[$platform])) { $this->error(__('Invalid parameters')); @@ -273,17 +280,18 @@ class User extends Api /** * 重置密码 * + * @ApiMethod (POST) * @param string $mobile 手机号 * @param string $newpassword 新密码 * @param string $captcha 验证码 */ public function resetpwd() { - $type = $this->request->request("type"); - $mobile = $this->request->request("mobile"); - $email = $this->request->request("email"); - $newpassword = $this->request->request("newpassword"); - $captcha = $this->request->request("captcha"); + $type = $this->request->post("type"); + $mobile = $this->request->post("mobile"); + $email = $this->request->post("email"); + $newpassword = $this->request->post("newpassword"); + $captcha = $this->request->post("captcha"); if (!$newpassword || !$captcha) { $this->error(__('Invalid parameters')); } diff --git a/application/api/controller/Validate.php b/application/api/controller/Validate.php index 82b3a98a..adb36d0f 100644 --- a/application/api/controller/Validate.php +++ b/application/api/controller/Validate.php @@ -22,6 +22,7 @@ class Validate extends Api /** * 检测邮箱 * + * @ApiMethod (POST) * @param string $email 邮箱 * @param string $id 排除会员ID */ @@ -39,6 +40,7 @@ class Validate extends Api /** * 检测用户名 * + * @ApiMethod (POST) * @param string $username 用户名 * @param string $id 排除会员ID */ @@ -56,6 +58,7 @@ class Validate extends Api /** * 检测昵称 * + * @ApiMethod (POST) * @param string $nickname 昵称 * @param string $id 排除会员ID */ @@ -73,6 +76,7 @@ class Validate extends Api /** * 检测手机 * + * @ApiMethod (POST) * @param string $mobile 手机号 * @param string $id 排除会员ID */ @@ -90,6 +94,7 @@ class Validate extends Api /** * 检测手机 * + * @ApiMethod (POST) * @param string $mobile 手机号 */ public function check_mobile_exist() @@ -105,6 +110,7 @@ class Validate extends Api /** * 检测邮箱 * + * @ApiMethod (POST) * @param string $mobile 邮箱 */ public function check_email_exist() @@ -120,6 +126,7 @@ class Validate extends Api /** * 检测手机验证码 * + * @ApiMethod (POST) * @param string $mobile 手机号 * @param string $captcha 验证码 * @param string $event 事件 @@ -138,6 +145,7 @@ class Validate extends Api /** * 检测邮箱验证码 * + * @ApiMethod (POST) * @param string $email 邮箱 * @param string $captcha 验证码 * @param string $event 事件 diff --git a/public/api.html b/public/api.html index fba5e716..54ade365 100755 --- a/public/api.html +++ b/public/api.html @@ -1119,7 +1119,7 @@