Explorar el Código

短信,人脸整合

qzyReal hace 1 año
padre
commit
7e9ed64302

+ 7 - 1
sp-core/sp-base/pom.xml

@@ -259,7 +259,13 @@
             <artifactId>ydoc-spring-boot-starter</artifactId>
             <version>1.1.0</version>
         </dependency>
-
+        <dependency>
+            <groupId>com.tencentcloudapi</groupId>
+            <artifactId>tencentcloud-sdk-java</artifactId>
+            <!-- go to https://search.maven.org/search?q=tencentcloud-sdk-java and get the latest version. -->
+            <!-- 请到https://search.maven.org/search?q=tencentcloud-sdk-java查询所有版本,最新版本如下 -->
+            <version>3.1.322</version>
+        </dependency>
         
         
     </dependencies>

+ 10 - 3
sp-core/sp-base/src/main/java/com/pj/current/config/MyConfig.java

@@ -38,8 +38,15 @@ public class MyConfig {
 	/**
 	 * 是否彩色SQL日志 
 	 */
-	private Boolean colorSql = true;		
-	
-	
+	private Boolean colorSql = true;
+	/**
+	 * 短信配置
+	 */
+	private String smsType="dxb";
+	/**
+	 * 人脸配置
+	 */
+	private String faceType="tencen";
+
 	
 }

+ 33 - 24
sp-core/sp-base/src/main/java/com/pj/current/config/SystemObject.java

@@ -1,6 +1,7 @@
 package com.pj.current.config;
 
 import com.pj.common.core.utils.DateUtils;
+import com.pj.sms.factory.SmsFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -11,45 +12,53 @@ import java.util.Date;
 
 /**
  * 有关当前项目的一些全局工具方法封装
- * @author kong
  *
+ * @author kong
  */
 @Component
 public class SystemObject {
 
-	// ===================================== 一些二次封装的方法 ===================================================
+    // ===================================== 一些二次封装的方法 ===================================================
+
+    /**
+     * 返回md5加密后的密码,根据当前配置的salt
+     * 格式为: md5(salt + userid + password)
+     */
+    public static String getPasswordMd5(long userId, String password) {
+        return SecureUtil.md5(config.getMd5Salt() + userId + password).toUpperCase();
+    }
 
-	/** 返回md5加密后的密码,根据当前配置的salt
-	 *   格式为: md5(salt + userid + password)
-	 */
-	public static String getPasswordMd5(long userId, String password) {
-		return SecureUtil.md5(config.getMd5Salt() + userId + password).toUpperCase();
-	}
+    /**
+     * 返回md5加密后的密码,根据当前配置的salt
+     * 格式为: md5(salt + 0 + password)
+     */
+    public static String getPasswordMd5(String password) {
+        return getPasswordMd5(0, password);
+    }
 
-	/** 返回md5加密后的密码,根据当前配置的salt
-	 *  格式为: md5(salt + 0 + password)
-	 */
-	public static String getPasswordMd5(String password) {
-		return getPasswordMd5(0, password);
-	}
 
+    // ===================================== yml自定义配置信息 ===================================================
 
+    public static MyConfig config;
 
-	// ===================================== yml自定义配置信息 ===================================================
+    @Autowired
+    void setMyConfig(MyConfig config) {
+        SystemObject.config = config;
+    }
 
-	public static MyConfig config;
-	@Autowired
-	void setMyConfig(MyConfig config) {
-		SystemObject.config = config;
-	}
+    public static SmsFactory smsFactory;
 
+    @Autowired
+    void setSmsFactory(SmsFactory smsFactory) {
+        SystemObject.smsFactory = smsFactory;
+    }
 
 
-	// ===================================== 生成订单号工具类 ===================================================
+    // ===================================== 生成订单号工具类 ===================================================
 
-	public static String getREFcode(String rex, Date date){
-		return rex.concat(DateUtils.parseDateToStr("yyMMddHHmmssSSSS", date));
-	}
+    public static String getREFcode(String rex, Date date) {
+        return rex.concat(DateUtils.parseDateToStr("yyMMddHHmmssSSSS", date));
+    }
 
 
 }

+ 23 - 0
sp-core/sp-base/src/main/java/com/pj/face/brand/FaceBrand.java

@@ -0,0 +1,23 @@
+package com.pj.face.brand;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum FaceBrand {
+    /**
+     * 阿里云
+     */
+    ALIYUN_SMS("aliyun"),
+    /**
+     * 腾讯云
+     */
+    TENCEN_SMS("tencen"),
+    /**
+     * 百度云
+     */
+    BAIDU_SMS("baidu");
+
+    private String type;
+}

+ 26 - 0
sp-core/sp-base/src/main/java/com/pj/face/factory/FaceFactory.java

@@ -0,0 +1,26 @@
+package com.pj.face.factory;
+
+
+import com.pj.current.config.MyConfig;
+import com.pj.current.config.SystemObject;
+import com.pj.face.handler.IFaceHandler;
+import com.pj.sms.handler.ISmsHandler;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+public class FaceFactory {
+
+    @Autowired
+    private List<IFaceHandler> handlers;
+
+    public IFaceHandler handler() {
+        String type= SystemObject.config.getFaceType();
+        return handlers.stream().filter(h -> h.faceBrand().getType().equals(type))
+                .findAny().orElseThrow(() -> new IllegalArgumentException("不支持类型人脸识别:" + type));
+    }
+
+}

+ 23 - 0
sp-core/sp-base/src/main/java/com/pj/face/handler/IFaceHandler.java

@@ -0,0 +1,23 @@
+package com.pj.face.handler;
+
+import com.pj.common.core.utils.sign.Base64;
+import com.pj.face.brand.FaceBrand;
+import com.pj.sms.brand.SmsType;
+
+public interface IFaceHandler {
+    /**
+     * 检查校验
+     * @param personId
+     * @param baseImage
+     * @return
+     */
+    boolean verify(String personId, String baseImage);
+
+    /**
+     * 是否活脸
+     * @param baseImg
+     * @return
+     */
+    boolean checkIsLive(String baseImg);
+    FaceBrand faceBrand();
+}

+ 100 - 0
sp-core/sp-base/src/main/java/com/pj/face/handler/impl/TencenFaceHandlerImpl.java

@@ -0,0 +1,100 @@
+package com.pj.face.handler.impl;
+
+import cn.hutool.core.net.URLEncoder;
+import cn.hutool.crypto.digest.MD5;
+import cn.hutool.http.HttpUtil;
+import com.pj.face.brand.FaceBrand;
+import com.pj.face.handler.IFaceHandler;
+import com.pj.face.properties.TencenProperties;
+import com.pj.sms.brand.SmsType;
+import com.pj.sms.handler.ISmsHandler;
+import com.pj.sms.properties.DuanXinBaoProperties;
+import com.pj.utils.sg.AjaxError;
+import com.tencentcloudapi.common.Credential;
+import com.tencentcloudapi.common.exception.TencentCloudSDKException;
+import com.tencentcloudapi.common.profile.ClientProfile;
+import com.tencentcloudapi.common.profile.HttpProfile;
+import com.tencentcloudapi.iai.v20200303.IaiClient;
+import com.tencentcloudapi.iai.v20200303.models.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 人脸库管理地址
+ * https://console.cloud.tencent.com/aiface/face-lib
+ */
+@Service
+@Slf4j
+public class TencenFaceHandlerImpl implements IFaceHandler {
+    @Resource
+    private TencenProperties tencenProperties;
+
+    @Override
+    public boolean verify(String personId, String baseImage) {
+        IaiClient client = this.createClient();
+        VerifyPersonRequest req = new VerifyPersonRequest();
+        req.setImage(baseImage);
+        req.setPersonId(personId);
+        // 返回的resp是一个VerifyPersonResponse的实例,与请求对象对应
+        VerifyPersonResponse resp;
+        try {
+            resp = client.VerifyPerson(req);
+        } catch (TencentCloudSDKException e) {
+            log.error("verify person : {} fail,{}", personId, e.getMessage());
+            throw new AjaxError(e.getMessage());
+        }
+        return resp != null && resp.getIsMatch();
+    }
+    public void createPersonByBase(String personId, String name, String imageBase) {
+        IaiClient client = this.createClient();
+        // 实例化一个请求对象,每个接口都会对应一个request对象
+        CreatePersonRequest req = new CreatePersonRequest();
+        req.setGroupId(tencenProperties.getGroupId());
+        req.setPersonName(name);
+        req.setPersonId(personId);
+        req.setImage(imageBase);
+        // 返回的resp是一个CreatePersonResponse的实例,与请求对象对应
+        try {
+            client.CreatePerson(req);
+        } catch (TencentCloudSDKException e) {
+            e.printStackTrace();
+        }
+
+    }
+    public boolean checkIsLive(String baseImg) {
+        IaiClient client = this.createClient();
+        DetectLiveFaceRequest req = new DetectLiveFaceRequest();
+        req.setImage(baseImg);
+        DetectLiveFaceResponse resp;
+        // 返回的resp是一个DetectLiveFaceResponse的实例,与请求对象对应
+        try {
+            resp = client.DetectLiveFace(req);
+        } catch (TencentCloudSDKException e) {
+            log.error("check live fail,{}", e.getMessage());
+            throw new AjaxError(e.getMessage());
+        }
+        return resp != null && resp.getIsLiveness();
+    }
+    @Override
+    public FaceBrand faceBrand() {
+        return FaceBrand.TENCEN_SMS;
+    }
+
+    private IaiClient createClient() {
+        // 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey,此处还需注意密钥对的保密
+        // 密钥可前往https://console.cloud.tencent.com/cam/capi网站进行获取
+        Credential cred = new Credential(tencenProperties.getSecretId(), tencenProperties.getSecretKey());
+        // 实例化一个http选项,可选的,没有特殊需求可以跳过
+        HttpProfile httpProfile = new HttpProfile();
+        httpProfile.setEndpoint("iai.tencentcloudapi.com");
+        // 实例化一个client选项,可选的,没有特殊需求可以跳过
+        ClientProfile clientProfile = new ClientProfile();
+        clientProfile.setHttpProfile(httpProfile);
+        // 实例化要请求产品的client对象,clientProfile是可选的
+        return new IaiClient(cred, "ap-chongqing", clientProfile);
+    }
+
+}

+ 16 - 0
sp-core/sp-base/src/main/java/com/pj/face/properties/TencenProperties.java

@@ -0,0 +1,16 @@
+package com.pj.face.properties;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@ConfigurationProperties("tencen")
+public class TencenProperties {
+    private String secretId;
+    private String secretKey;
+    private String groupId;
+    private String groupName;
+
+}

+ 28 - 0
sp-core/sp-base/src/main/java/com/pj/sms/brand/SmsType.java

@@ -0,0 +1,28 @@
+package com.pj.sms.brand;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum SmsType {
+    /**
+     * 短信宝
+     */
+    DUAN_XIN_BAO("dxb"),
+    /**
+     * 阿里云
+     */
+    ALIYUN_SMS("aliyun"),
+    /**
+     * 腾讯云
+     */
+    TENCEN_SMS("tencen"),
+    /**
+     * 百度云
+     */
+    BAIDU_SMS("baidu");
+
+    private String type;
+
+}

+ 26 - 0
sp-core/sp-base/src/main/java/com/pj/sms/factory/SmsFactory.java

@@ -0,0 +1,26 @@
+package com.pj.sms.factory;
+
+
+import com.pj.current.config.MyConfig;
+import com.pj.current.config.SystemObject;
+import com.pj.sms.handler.ISmsHandler;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+public class SmsFactory {
+    @Resource
+    private MyConfig myConfig;
+    @Autowired
+    private List<ISmsHandler> handlers;
+
+    public ISmsHandler handler() {
+        String type= SystemObject.config.getSmsType();
+        return handlers.stream().filter(h -> h.smsType().getType().equals(type))
+                .findAny().orElseThrow(() -> new IllegalArgumentException("不支持类型短信发送:" + type));
+    }
+
+}

+ 9 - 0
sp-core/sp-base/src/main/java/com/pj/sms/handler/ISmsHandler.java

@@ -0,0 +1,9 @@
+package com.pj.sms.handler;
+
+import com.pj.sms.brand.SmsType;
+
+public interface ISmsHandler {
+    void sendSMS(String phone,String content);
+    void sendSMS(String phone,String templateCode,String content);
+    SmsType smsType();
+}

+ 42 - 0
sp-core/sp-base/src/main/java/com/pj/sms/handler/impl/DuanXinBaoHandlerImpl.java

@@ -0,0 +1,42 @@
+package com.pj.sms.handler.impl;
+
+import cn.hutool.core.net.URLEncoder;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.crypto.digest.MD5;
+import cn.hutool.http.HttpUtil;
+import com.pj.api.consts.FeignFactory;
+import com.pj.sms.handler.ISmsHandler;
+import com.pj.sms.brand.SmsType;
+import com.pj.sms.properties.DuanXinBaoProperties;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+
+@Service
+@Slf4j
+public class DuanXinBaoHandlerImpl implements ISmsHandler {
+    @Resource
+    private DuanXinBaoProperties duanXinBaoProperties;
+    @Override
+    public void sendSMS(String phone,String content) {
+        String pwd = MD5.create().digestHex(duanXinBaoProperties.getPwd());
+        final String url = "https://api.smsbao.com/sms?u=" + duanXinBaoProperties.getUsername() +
+                "&p=" + pwd + "&m=" + phone + "&c=" +
+                URLEncoder.createDefault().encode("[" + duanXinBaoProperties.getSign() + "]" + content, StandardCharsets.UTF_8);
+        String result = HttpUtil.get(url);
+        log.info("send duan xin bao  sms result:{},{},{}", phone, content, result);
+    }
+
+    @Override
+    public void sendSMS(String phone, String templateCode, String content) {
+
+    }
+
+    @Override
+    public SmsType smsType() {
+        return SmsType.DUAN_XIN_BAO;
+    }
+}

+ 15 - 0
sp-core/sp-base/src/main/java/com/pj/sms/properties/DuanXinBaoProperties.java

@@ -0,0 +1,15 @@
+package com.pj.sms.properties;
+
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@ConfigurationProperties(prefix = "dxb")
+@Component
+@Data
+public class DuanXinBaoProperties {
+    private String pwd;
+    private String username;
+    private String sign;
+}

+ 0 - 14
sp-core/sp-base/src/main/resources/application.yml

@@ -1,17 +1,3 @@
 # 端口
 
 
-feign:
-  hystrix:
-    enabled: true
-hystrix:
-  command:
-    default:
-      execution:
-        isolation:
-          thread:
-            timeoutInMilliseconds: 150000
-ribbon:
-  eager-load:
-    enabled: true
-    clients: sp-home,sp-admin,level-one-server,level-two-server,transport-server

+ 64 - 40
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserService.java

@@ -8,15 +8,18 @@ import java.util.stream.Collectors;
 
 import cn.dev33.satoken.spring.SpringMVCUtil;
 import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.util.RandomUtil;
 import cn.hutool.json.JSONUtil;
 import cn.hutool.log.StaticLog;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.pj.api.client.admin.AdminInterface;
 import com.pj.api.client.level_one_server.LevelOneServerInterface;
 import com.pj.api.client.level_two_server.LevelTwoServerInterface;
 import com.pj.api.client.transport.TransportInterface;
 import com.pj.api.dto.*;
 import com.pj.common.core.exception.ServiceException;
+import com.pj.current.config.SystemObject;
 import com.pj.current.dto.APPLoginUserInfo;
 import com.pj.current.satoken.StpAPPUserUtil;
 import com.pj.current.satoken.StpUserUtil;
@@ -32,7 +35,9 @@ import com.pj.project.app_user_login_log.AppUserLoginLogService;
 import com.pj.project.re_role_menu.ReRoleMenu;
 import com.pj.project.re_role_menu.ReRoleMenuMapper;
 import com.pj.retry.SmsRetryService;
+import com.pj.sms.factory.SmsFactory;
 import com.pj.utils.cache.RedisUtil;
+import com.pj.utils.sg.AjaxError;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.sg.WebNbUtil;
 import com.pj.utils.so.SoMap;
@@ -45,9 +50,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
+
 
 /**
  * Service: app_user -- 移动端账号
+ *
  * @author qzy
  */
 @Service
@@ -84,6 +92,7 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
     @Autowired
     AppUserLoginLogService appUserLoginLogService;
 
+
     /**
      * 验证码前缀
      */
@@ -383,30 +392,41 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
                 return AjaxJson.getSuccess("密码找回成功!");
             } else {
 
-				return AjaxJson.getError("两次密码校验不匹配,请重新尝试!");
+                return AjaxJson.getError("两次密码校验不匹配,请重新尝试!");
 
-			}
+            }
 
-		}
+        }
 
-		//验证码匹配错误
-		return AjaxJson.getError("验证码输入错误,请检查!");
-	}
+        //验证码匹配错误
+        return AjaxJson.getError("验证码输入错误,请检查!");
+    }
 
     /**
      * 获取验证码
      */
-    boolean getPhoneSmsCode(String phone) throws Exception {
+    boolean getPhoneSmsCode(String phone) {
+      AppUser appUser=  this.findByPhone(phone);
+      if (appUser!=null){
+          throw new AjaxError("该手机号已注册");
+      }
         //生成4位随机数
-        Random random = new Random();
-        int randomNumber = random.nextInt(9000) + 1000;
+        String code=RandomUtil.randomNumbers(4);
         //保存到缓存,默认1分钟 todo:届时放开手机验证码 randomNumber
-        RedisUtil.setByMINUTES(PREFIX + phone, 123 + "", 1);
+        RedisUtil.setByMINUTES(PREFIX + phone, code, 5);
+        SystemObject.smsFactory.handler().sendSMS(phone,"您的验证码是"+code+"。如非本人操作,请忽略本短信");
         //发送验证码短信
         return true;
 
     }
 
+    private AppUser findByPhone(String phone) {
+        QueryWrapper<AppUser>ew=new QueryWrapper<>();
+        ew.lambda().eq(AppUser::getPhone,phone);
+        List<AppUser>list=list(ew);
+        return list.isEmpty()?null:list.get(0);
+    }
+
 
     /**
      * 更换角色
@@ -488,42 +508,46 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
         return update == 1;
     }
 
-	/** 远程调用: 当从航通导入数据时,自动给边民生成账号 */
-	public boolean generatePeopleAccount(HtPeopleDto peopleDto) throws Exception {
-		//检查是否重复注册
-		List<AppUser> appUsers = appUserMapper.selectList(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, peopleDto.getBorderTel()));
-		if(appUsers.size() != 0){
+    /**
+     * 远程调用: 当从航通导入数据时,自动给边民生成账号
+     */
+    public boolean generatePeopleAccount(HtPeopleDto peopleDto) throws Exception {
+        //检查是否重复注册
+        List<AppUser> appUsers = appUserMapper.selectList(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, peopleDto.getBorderTel()));
+        if (appUsers.size() != 0) {
             log.error("\n该用户已注册! phone = " + peopleDto.getBorderTel() + "\n");
             return true;
         }
-		//创建保存对象
-		AppUser appUser = new AppUser();
-		//设置基本属性
-		appUser.setAuth(1 + ""); // 默认已认证
-		appUser.setUserType(1); // 用户类型 1
-		appUser.setCreateTime(new Date()); // 创建时间
-		appUser.setPhone(peopleDto.getBorderTel()); // 电话
-		appUser.setStatus("1"); // 可用状态
-		appUser.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode()); // 默认可用
-		appUser.setAuthTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); // 认证时间
-		appUser.setName(peopleDto.getBorderName()); // 昵称
-		appUser.setFkId(peopleDto.getId()); // 外键
-		appUser.setCreateUnit("航通");
-		//随机生成6位数密码
-//		int password = (int) (Math.random() * (999999 - 100000 + 1) + 100000);
-        String password=appUser.getPhone();
-		//密码加密
-		String encodePassword = passwordEncoder.encode(password + "");
-		//设置密码
-		appUser.setPassword(encodePassword);
-		//保存
-		int insert = appUserMapper.insert(appUser);
-		//发送短信
-		if(insert == 1){
-			//todo: 届时放开注释
+        //创建保存对象
+        AppUser appUser = new AppUser();
+        //设置基本属性
+        appUser.setAuth(1 + ""); // 默认已认证
+        appUser.setUserType(1); // 用户类型 1
+        appUser.setCreateTime(new Date()); // 创建时间
+        appUser.setPhone(peopleDto.getBorderTel()); // 电话
+        appUser.setStatus("1"); // 可用状态
+        appUser.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode()); // 默认可用
+        appUser.setAuthTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); // 认证时间
+        appUser.setName(peopleDto.getBorderName()); // 昵称
+        appUser.setFkId(peopleDto.getId()); // 外键
+        appUser.setCreateUnit("航通");
+        //随机生成6位数密码
+        String password = RandomUtil.randomNumbers(8);
+//        String password=appUser.getPhone();
+        //密码加密
+        String encodePassword = passwordEncoder.encode(password + "");
+        //设置密码
+        appUser.setPassword(encodePassword);
+        //保存
+        int insert = appUserMapper.insert(appUser);
+        //发送短信
+        if (insert == 1) {
+            //todo: 届时放开注释
+            String content="您好,您的[边民互市]app账号已生成。账号:" + peopleDto.getBorderTel() + ", 初始密码:" + password + "。可前往app进行修改";
 //			boolean msg = smsRetryService.sendSmsRegisteMsg(null, "您好,您已成功注册[边民互市]app账号。账号:" + peopleDto.getBorderTel() + ", 初始密码:" + password + "。可前往app进行修改");
 //			return msg;
             System.out.println("注册成功! 账户 = " + peopleDto.getBorderTel() + " password = " + password);
+            SystemObject.smsFactory.handler().sendSMS(peopleDto.getBorderTel(),content);
             return true;
         }
         throw new RuntimeException("同步航通信息时,边民注册app信息失败,边民手机号为: " + peopleDto.getBorderTel() + "。 时间: " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));

+ 2 - 1
sp-service/sp-admin/src/main/java/com/pj/project4sp/admin4login/SpAccAdminController.java

@@ -9,6 +9,7 @@ import cn.hutool.core.util.StrUtil;
 import cn.hutool.crypto.asymmetric.KeyType;
 import cn.hutool.crypto.asymmetric.RSA;
 import cn.hutool.json.JSONUtil;
+import com.pj.current.config.SystemObject;
 import com.pj.current.satoken.AuthConst;
 import com.pj.utils.cache.RedisUtil;
 import com.wf.captcha.ArithmeticCaptcha;
@@ -52,7 +53,7 @@ public class SpAccAdminController {
 	/** 账号、密码登录  */
 	@RequestMapping("doLogin")
 	AjaxJson doLogin(String key, String password, String code, String verCode) {
-		// 1、验证参数 
+		// 1、验证参数
 		if(NbUtil.isOneNull(key, password)) {
 			return AjaxJson.getError("请提供key与password参数");
 		}