[fix]登录用户返回userSig
This commit is contained in:
parent
f058de3736
commit
5c603c6151
@ -33,6 +33,7 @@ public class MemberAccount extends BaseAudit {
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 账户类型 1 用户 2 商家 3 代理 4 平台
|
||||
*/
|
||||
|
@ -72,6 +72,7 @@ public class MemberRegisterService {
|
||||
// 生成 UserSig
|
||||
String userSig = tencentIMServicce.createTencentIMAccount(member);
|
||||
member.setUserSig(userSig);
|
||||
memberService.updateById(member);
|
||||
|
||||
|
||||
recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.register.success"));
|
||||
|
@ -2,17 +2,13 @@ package com.wzj.soopin.member.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.ResponseBody;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import com.wzj.soopin.member.service.ITencentIMServicce;
|
||||
import com.wzj.soopin.member.util.GenerateTestUserSig;
|
||||
import com.wzj.soopin.member.util.TLSSigAPIv2;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -22,7 +18,8 @@ import java.util.concurrent.TimeUnit;
|
||||
@Service
|
||||
public class TencentIMServiceImpl implements ITencentIMServicce {
|
||||
|
||||
|
||||
@Value("${tencent.im.administrator}")
|
||||
private String adminAccount;
|
||||
|
||||
/**
|
||||
* 创建腾讯云IM账号
|
||||
@ -33,7 +30,8 @@ public class TencentIMServiceImpl implements ITencentIMServicce {
|
||||
String phone=member.getPhoneHidden();
|
||||
try {
|
||||
|
||||
String userSig=generateUserSig("administrator");
|
||||
//这里生成一个管理员签名,
|
||||
String adminSig=generateUserSig(adminAccount);
|
||||
String random = String.valueOf(System.currentTimeMillis());
|
||||
|
||||
|
||||
@ -48,8 +46,8 @@ public class TencentIMServiceImpl implements ITencentIMServicce {
|
||||
"https://console.tim.qq.com/v4/im_open_login_svc/account_import" +
|
||||
"?sdkappid=%s&identifier=%s&usersig=%s&random=%s&contenttype=json",
|
||||
GenerateTestUserSig.SDKAPPID,
|
||||
"administrator", // 使用管理员账号
|
||||
userSig, // 使用管理员的UserSig
|
||||
adminAccount, // 使用管理员账号
|
||||
adminSig, // 使用管理员的UserSig
|
||||
random);
|
||||
// return userSig;
|
||||
|
||||
@ -78,7 +76,8 @@ public class TencentIMServiceImpl implements ITencentIMServicce {
|
||||
|
||||
if (errorCode == 0) {
|
||||
log.info("创建IM账号成功: {}", phone);
|
||||
return userSig;
|
||||
// 生成用户的UserSig
|
||||
return generateUserSig(member.getId()+"");
|
||||
} else {
|
||||
log.error("创建IM账号失败: {}, 错误码: {}, 错误信息: {}",
|
||||
phone, errorCode, jsonResponse.get("ErrorInfo"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user