|
@@ -22,6 +22,7 @@ import com.huiju.estateagents.common.JWTUtils;
|
22
|
22
|
import com.huiju.estateagents.third.entity.TaThirdPartyMiniappConfig;
|
23
|
23
|
import com.huiju.estateagents.third.service.ITaThirdPartyMiniappConfigService;
|
24
|
24
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
25
|
+import org.apache.commons.collections.CollectionUtils;
|
25
|
26
|
import org.apache.commons.lang3.StringUtils;
|
26
|
27
|
import org.apache.http.HttpStatus;
|
27
|
28
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -31,6 +32,7 @@ import org.springframework.web.bind.annotation.*;
|
31
|
32
|
import javax.annotation.Resource;
|
32
|
33
|
import javax.servlet.http.HttpServletRequest;
|
33
|
34
|
import java.time.LocalDateTime;
|
|
35
|
+import java.util.Collections;
|
34
|
36
|
import java.util.HashMap;
|
35
|
37
|
import java.util.List;
|
36
|
38
|
import java.util.Map;
|
|
@@ -77,6 +79,9 @@ public class MiniAppController extends BaseController {
|
77
|
79
|
@Autowired
|
78
|
80
|
public ITaThirdPartyMiniappConfigService iTaThirdPartyMiniappConfigService;
|
79
|
81
|
|
|
82
|
+ @Autowired
|
|
83
|
+ private ITaCustomImgService iTaCustomImgService;
|
|
84
|
+
|
80
|
85
|
|
81
|
86
|
/**
|
82
|
87
|
* 验证接入
|
|
@@ -220,6 +225,14 @@ public class MiniAppController extends BaseController {
|
220
|
225
|
result.put("extraInfo", extraInfo);
|
221
|
226
|
result.put("miniAuthorized", null != taPerson.getAvatarurl() && taPerson.getAvatarurl().indexOf("wx.qlogo.cn") > 0);
|
222
|
227
|
|
|
228
|
+ //返回是否授权标识
|
|
229
|
+ QueryWrapper<TaCustomImg> queryWrapper = new QueryWrapper<>();
|
|
230
|
+ queryWrapper.eq("org_id", getOrgId(request));
|
|
231
|
+ queryWrapper.eq("img_type", "auth");
|
|
232
|
+ List<TaCustomImg> taCustomImgs = iTaCustomImgService.list(queryWrapper);
|
|
233
|
+ result.put("avatarAuth", CollectionUtils.isEmpty(taCustomImgs) ? false : "1".equals(taCustomImgs.get(0).getImgUrl()) ? true: false);
|
|
234
|
+
|
|
235
|
+
|
223
|
236
|
String token = (String) miniResp.get("token");
|
224
|
237
|
sysTokenService.saveToken(token);
|
225
|
238
|
|