|
|
@@ -50,6 +50,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
@@ -79,6 +80,10 @@ public class WxController {
|
|
|
|
|
|
@Value("${yt.ios.appid:}")
|
|
|
private String appId;
|
|
|
+
|
|
|
+ @Value("${spring.application.name-zh:}")
|
|
|
+ private String applicationNameZh;
|
|
|
+
|
|
|
private final static String GRANT_TYPE = "authorization_code";
|
|
|
|
|
|
|
|
|
@@ -209,8 +214,13 @@ public class WxController {
|
|
|
} else {
|
|
|
user = appUserMapper.getYtAppUserForIos(param.getIosId(), param.getDitchId());
|
|
|
}
|
|
|
- if (user == null || StrUtil.isEmpty(user.getNickName())) {
|
|
|
- userInfo.setNickname("Tourists" + IdUtil.fastSimpleUUID().substring(0, 8));
|
|
|
+ if (user == null || StrUtil.isEmpty(user.getNickName())) {
|
|
|
+ String nickNamePrefix = "Tourists";
|
|
|
+ List<String> list = Arrays.asList("朝暮日记", "班务助手", "成语拼拼乐");
|
|
|
+ if (StrUtil.isNotEmpty(applicationNameZh) && list.contains(applicationNameZh)) {
|
|
|
+ nickNamePrefix = applicationNameZh;
|
|
|
+ }
|
|
|
+ userInfo.setNickname(nickNamePrefix + IdUtil.fastSimpleUUID().substring(0, 8));
|
|
|
} else {
|
|
|
userInfo.setNickname(user.getNickName());
|
|
|
}
|