1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- // +----------------------------------------------------------------------
- // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
- // +----------------------------------------------------------------------
- // | Author: CRMEB Team <admin@crmeb.com>
- // +----------------------------------------------------------------------
- namespace app\controller\out;
- use app\Request;
- use app\services\out\OutAccountServices;
- use crmeb\basic\BaseController;
- use app\validate\out\LoginValidate;
- use think\facade\App;
- /**
- * Class Login
- * @package app\kefu\controller
- */
- class OutAccount extends BaseController
- {
- /**
- * Login constructor.
- * @param App $app
- * @param OutAccountServices $services
- */
- public function __construct(App $app, OutAccountServices $services)
- {
- parent::__construct($app);
- $this->services = $services;
- }
- /**
- * 客服登录
- * @param Request $request
- * @return mixed
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function getToken(Request $request)
- {
- [$appid, $appsecret] = $request->postMore([
- ['appid', ''],
- ['appsecret', ''],
- ], true);
- $this->validate(['appid' => $appid, 'appsecret' => $appsecret], LoginValidate::class);
- $token = $this->services->authLogin($appid, $appsecret);
- return $this->success('获取成功', $token);
- }
- }
|