|
@@ -20,7 +20,6 @@ import com.fdkankan.ucenter.constant.QrCodeFilePath;
|
|
|
import com.fdkankan.ucenter.entity.Camera;
|
|
|
import com.fdkankan.ucenter.entity.CameraDetail;
|
|
|
import com.fdkankan.ucenter.entity.User;
|
|
|
-import com.fdkankan.ucenter.httpClient.client.FdkkClient;
|
|
|
import com.fdkankan.ucenter.service.ICameraDetailService;
|
|
|
import com.fdkankan.ucenter.service.ICameraService;
|
|
|
import com.fdkankan.ucenter.service.IUserService;
|
|
@@ -35,7 +34,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
|
|
@Service
|
|
|
public class LoginService {
|
|
@@ -55,19 +53,7 @@ public class LoginService {
|
|
|
@Value("${main.url}")
|
|
|
private String mainUrl;
|
|
|
|
|
|
- @Value("${spring.profiles.active}")
|
|
|
- private String environment;
|
|
|
- @Resource
|
|
|
- private FdkkClient fdkkClient;
|
|
|
-
|
|
|
public Object login(LoginParam param) {
|
|
|
- if(environment.equals("test")){ //测试环境登录
|
|
|
- JSONObject jsonObject = fdkkClient.fdkkLogin(param);
|
|
|
- if(jsonObject.getInteger("code") != 0){
|
|
|
- throw new BusinessException(jsonObject.getInteger("code"),jsonObject.getString("msg"));
|
|
|
- }
|
|
|
- return fdkkClient.fdkkLogin(param).getJSONObject("data");
|
|
|
- }
|
|
|
if (StringUtils.isEmpty(param.getPassword()) || StringUtils.isEmpty(param.getPhoneNum())){
|
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
|
}
|