|
|
@@ -38,7 +38,7 @@ use think\facade\Log;
|
|
|
class LoginController extends BaseApiController
|
|
|
{
|
|
|
|
|
|
- public array $notNeedLogin = ['register', 'account', 'logout','testWeChat','getCredentialName','passedInterview','getRegisterId','mobile','customerPhone'];
|
|
|
+ public array $notNeedLogin = ['register', 'account', 'logout','testWeChat','getCredentialName','passedInterview','getRegisterId','mobile','customerPhone','getOpenIdByCode'];
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -196,4 +196,19 @@ class LoginController extends BaseApiController
|
|
|
$result = DictData::where(['type_value' => 'customer_support'])->column('value', 'name');
|
|
|
return $this->data($result);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取微信用户openid信息
|
|
|
+ */
|
|
|
+ public function getOpenIdByCode()
|
|
|
+ {
|
|
|
+ $code = $this->request->get('code');
|
|
|
+ $res = \app\api\logic\LoginLogic::getOpenIdByCode(['code'=>$code]);
|
|
|
+ if (false === $res) {
|
|
|
+ return $this->fail(LoginLogic::getError());
|
|
|
+ }
|
|
|
+ return $this->success('', $res);
|
|
|
+ }
|
|
|
+
|
|
|
}
|