commit
This commit is contained in:
@@ -6,6 +6,7 @@ import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.sms.SmsService;
|
||||
import com.budwk.app.base.sms.impl.ncu.util.SmsTokenUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
@@ -25,6 +26,9 @@ import java.util.stream.Stream;
|
||||
@IocBean
|
||||
public class SmsNcuServiceImpl implements SmsService {
|
||||
|
||||
@Inject
|
||||
private SmsTokenUtil smsTokenUtil;
|
||||
|
||||
private static final String SEND_MSG_URL = "https://poa.ncu.edu.cn/apis/messagecenter/v1/poaMessage/messageSend";
|
||||
private static final String APP_ID = "72e34a101d3011f1a74cbae5193504f4";
|
||||
private static final String TEMPLATE_ID = "MT1773223005000";
|
||||
@@ -105,7 +109,7 @@ public class SmsNcuServiceImpl implements SmsService {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String token = SmsTokenUtil.getInstance().getToken();
|
||||
String token = smsTokenUtil.getToken();
|
||||
if (Lang.isEmpty(token)) {
|
||||
log.error("【log】send fail by token is null");
|
||||
return;
|
||||
|
||||
@@ -30,10 +30,6 @@ public class SmsTokenUtil {
|
||||
@Inject
|
||||
private RedisService redisService;
|
||||
|
||||
public static SmsTokenUtil getInstance() {
|
||||
return Mvcs.getIoc().get(SmsTokenUtil.class);
|
||||
}
|
||||
|
||||
private static final String TOKEN_URL = "https://poa.ncu.edu.cn/oauth2/token";
|
||||
private static final String CLINT_ID = "dP7SXC1MoYAJHPh6k8Cgsda8tGY=";
|
||||
private static final String CLINT_SECRET = "PFAwVcXOsVFzP3Jwb4RyO5V97o8j8zNTQ8QSTre8oIc=";
|
||||
|
||||
Reference in New Issue
Block a user