123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\api\controller;
- /**
-
- *
-
- *
- * ----------------------------------------------------------------------------
- *
-
- * 登出控制器
- */
- class Logout extends MobileMember
- {
- public function initialize()
- {
- parent::initialize(); // TODO: Change the autogenerated stub
- }
- /**
- * @api {POST} api/Logout/index 注销
- * @apiVersion 1.0.0
- * @apiGroup Logout
- *
- * @apiHeader {String} X-DS-KEY 用户授权token
- *
- * @apiParam {String} username 用户名
- * @apiParam {String} client 用户端 wap手机端
- *
- * @apiSuccess {String} code 返回码,10000为成功
- * @apiSuccess {String} message 返回消息
- */
- public function index()
- {
- if (empty(input('post.username')) || !in_array(input('post.client'), $this->client_type_array)) {
- ds_json_encode(10001, lang('param_error'));
- }
- $mbusertoken_model = model('mbusertoken');
- if ($this->member_info['member_name'] == trim(input('post.username'))) {
- $condition = array();
- $condition[] = array('member_id', '=', $this->member_info['member_id']);
- $condition[] = array('member_clienttype', '=', input('post.client'));
- $mbusertoken_model->delMbusertoken($condition);
- session(null); //删除session中的member_id下,因为次登录时要整合cookie中的商品到数据库中
- ds_json_encode(10000, '', '', '', true);
- } else {
- ds_json_encode(10001, lang('param_error'));
- }
- }
- }
|