| xqd
@@ -1139,7 +1139,7 @@ class AlbumController extends Controller
|
|
|
*/
|
|
|
public function albumSavePhone(Request $request)
|
|
|
{
|
|
|
- /* $userAuth = Auth('api')->user();
|
|
|
+ $userAuth = Auth('api')->user();
|
|
|
if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
|
|
|
$validator = Validator::make($request->all(), [
|
|
|
'store_id' => 'required',
|
| xqd
@@ -1154,8 +1154,8 @@ class AlbumController extends Controller
|
|
|
]);
|
|
|
if ($validator->fails()) {
|
|
|
return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
|
|
|
- }*/
|
|
|
- dd($this->wechat_app);die;
|
|
|
+ }
|
|
|
+ $this->wechat_app = AlbumManufacturerModel::where('store_id',$storeid)->first();
|
|
|
$config = [
|
|
|
'app_id' => $this->wechat_app->xyx_id,
|
|
|
'secret' => $this->wechat_app->xyx_secret,
|
| xqd
@@ -1166,10 +1166,10 @@ class AlbumController extends Controller
|
|
|
|
|
|
|
|
|
];
|
|
|
- dd(11);
|
|
|
+
|
|
|
$app = Factory::miniProgram($config);
|
|
|
$res = $app->auth->session($request->input('code'));
|
|
|
- dd($res);
|
|
|
+
|
|
|
if (!$res || empty($res['openid'])) {
|
|
|
return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '获取用户OpenId失败!', $validator->messages());
|
|
|
}
|