|
@@ -10,7 +10,6 @@ use think\Config;
|
|
use think\Validate;
|
|
use think\Validate;
|
|
|
|
|
|
use think\Db;
|
|
use think\Db;
|
|
-use miniprogram\wxBizDataCrypt;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 会员接口
|
|
* 会员接口
|
|
@@ -52,6 +51,13 @@ class User extends Api
|
|
if (!$account || !$password) {
|
|
if (!$account || !$password) {
|
|
$this->error(__('Invalid parameters'));
|
|
$this->error(__('Invalid parameters'));
|
|
}
|
|
}
|
|
|
|
+ //先判断是老师还是学员
|
|
|
|
+ $coach_find = Db::name('coach')->where('email',$account)->find();
|
|
|
|
+ if($coach_find){
|
|
|
|
+ return action('api/coach/user/emaillogin');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //学员登录
|
|
$ret = $this->auth->login($account, $password);
|
|
$ret = $this->auth->login($account, $password);
|
|
if ($ret) {
|
|
if ($ret) {
|
|
$data = $this->auth->getUserinfo();
|
|
$data = $this->auth->getUserinfo();
|
|
@@ -222,6 +228,13 @@ class User extends Api
|
|
$this->success();
|
|
$this->success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //用户详细资料
|
|
|
|
+ public function userInfo(){
|
|
|
|
+ $info = $this->auth->getUserinfo();
|
|
|
|
+
|
|
|
|
+ $this->success(__('success'),$info);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 修改邮箱
|
|
* 修改邮箱
|
|
*
|
|
*
|