|
@@ -20,6 +20,7 @@ import com.fdkankan.ucenter.constant.QrCodeFilePath;
|
|
import com.fdkankan.ucenter.entity.Camera;
|
|
import com.fdkankan.ucenter.entity.Camera;
|
|
import com.fdkankan.ucenter.entity.CameraDetail;
|
|
import com.fdkankan.ucenter.entity.CameraDetail;
|
|
import com.fdkankan.ucenter.entity.User;
|
|
import com.fdkankan.ucenter.entity.User;
|
|
|
|
+import com.fdkankan.ucenter.httpClient.client.FdkkClient;
|
|
import com.fdkankan.ucenter.service.ICameraDetailService;
|
|
import com.fdkankan.ucenter.service.ICameraDetailService;
|
|
import com.fdkankan.ucenter.service.ICameraService;
|
|
import com.fdkankan.ucenter.service.ICameraService;
|
|
import com.fdkankan.ucenter.service.IUserService;
|
|
import com.fdkankan.ucenter.service.IUserService;
|
|
@@ -34,6 +35,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+
|
|
@Service
|
|
@Service
|
|
public class LoginService {
|
|
public class LoginService {
|
|
|
|
|
|
@@ -52,7 +55,15 @@ public class LoginService {
|
|
@Value("${main.url}")
|
|
@Value("${main.url}")
|
|
private String mainUrl;
|
|
private String mainUrl;
|
|
|
|
|
|
- public LoginVo login(LoginParam param) {
|
|
|
|
|
|
+ @Value("${spring.profiles.active}")
|
|
|
|
+ private String environment;
|
|
|
|
+ @Resource
|
|
|
|
+ private FdkkClient fdkkClient;
|
|
|
|
+
|
|
|
|
+ public Object login(LoginParam param) {
|
|
|
|
+ if(environment.equals("test")){
|
|
|
|
+ return fdkkClient.fdkkLogin(param);
|
|
|
|
+ }
|
|
if (StringUtils.isEmpty(param.getPassword()) || StringUtils.isEmpty(param.getPhoneNum())){
|
|
if (StringUtils.isEmpty(param.getPassword()) || StringUtils.isEmpty(param.getPhoneNum())){
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
}
|
|
}
|
|
@@ -278,7 +289,7 @@ public class LoginService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public LoginVo loginClear(LoginParam param) {
|
|
|
|
|
|
+ public Object loginClear(LoginParam param) {
|
|
param.setClear("YES"); //明文登录
|
|
param.setClear("YES"); //明文登录
|
|
return login(param);
|
|
return login(param);
|
|
}
|
|
}
|