66use Illuminate \Support \Facades \Log ;
77use Illuminate \Support \Facades \Session ;
88use Illuminate \Support \Str ;
9+ use ModStart \Core \Assets \AssetsUtil ;
910use ModStart \Core \Exception \BizException ;
1011use ModStart \Core \Input \InputPackage ;
1112use ModStart \Core \Input \Request ;
1213use ModStart \Core \Input \Response ;
1314use ModStart \Core \Util \CurlUtil ;
1415use ModStart \Core \Util \EventUtil ;
16+ use ModStart \Core \Util \RandomUtil ;
1517use ModStart \Core \Util \StrUtil ;
1618use ModStart \Misc \Captcha \CaptchaFacade ;
1719use ModStart \Module \ModuleBaseController ;
@@ -426,10 +428,13 @@ public function oauthCallback($oauthType = null, $callback = null)
426428 return Response::generateSuccess ();
427429 }
428430 }
429-
431+ if (empty ($ userInfo ['username ' ])) {
432+ $ userInfo ['username ' ] = modstart_config ('Member_RegisterUsernameSuggest ' , '用户 ' ) . RandomUtil::hexString (6 );
433+ }
430434 Session::put ('oauthUserInfo ' , $ userInfo );
431435 return Response::generate (0 , 'ok ' , [
432436 'user ' => $ userInfo ,
437+ 'avatarEmpty ' => AssetsUtil::fixFull ('asset/image/avatar.svg ' ),
433438 ]);
434439 }
435440
@@ -456,7 +461,7 @@ public function oauthLogin($oauthType = null, $callback = null)
456461 $ ret = $ oauth ->processRedirect ($ param );
457462 BizException::throwsIfResponseError ($ ret );
458463 return Response::generate (0 , 'ok ' , [
459- 'redirect ' => $ ret ['data ' ]['redirect ' ],
464+ 'redirect ' => isset ( $ ret ['data ' ]['redirect ' ]) ? $ ret [ ' data ' ][ ' redirect ' ] : null ,
460465 ]);
461466 }
462467
0 commit comments