|
|
@@ -58,12 +58,6 @@ public class ShareMaterialController extends AppBaseController
|
|
|
*/
|
|
|
@PostMapping("/submitPhone")
|
|
|
public R submitPhone(@RequestBody CollectionUserPhoneDTO param){
|
|
|
- long userId;
|
|
|
- try {
|
|
|
- userId = Long.parseLong(getUserId());
|
|
|
- }catch (Exception e){
|
|
|
- return R.error("用户登录信息异常");
|
|
|
- }
|
|
|
final WxMaService wxService = WxMaConfiguration.getMaService(param.getAppId());
|
|
|
try {
|
|
|
WxMaJscode2SessionResult session = wxService.getUserService().getSessionInfo(param.getCode());
|
|
|
@@ -71,6 +65,12 @@ public class ShareMaterialController extends AppBaseController
|
|
|
WxMaPhoneNumberInfo phoneNoInfo = wxService.getUserService().getPhoneNoInfo(session.getSessionKey(), param.getEncryptedData(), param.getIv());
|
|
|
String phoneNumber = phoneNoInfo.getPhoneNumber();
|
|
|
param.setUserPhone(phoneNumber);
|
|
|
+ long userId;
|
|
|
+ try {
|
|
|
+ userId = Long.parseLong(getUserId());
|
|
|
+ }catch (Exception e){
|
|
|
+ return R.error("用户登录信息获取异常");
|
|
|
+ }
|
|
|
param.setUserId(userId);
|
|
|
int result = companyQrcPhoneService.submitPhone(param);
|
|
|
return result>0?R.ok():R.error("提交失败");
|