Commit ebd6ccaa authored by 赵啸非's avatar 赵啸非

修改同步用户

parent 0fd64be2
...@@ -10,6 +10,7 @@ import com.mortals.xhx.feign.device.IDeviceFeign; ...@@ -10,6 +10,7 @@ import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.module.device.model.DeviceQuery; import com.mortals.xhx.module.device.model.DeviceQuery;
import lombok.Data; import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -37,6 +38,10 @@ public class DeviceServiceImpl extends AbstractCRUDServiceImpl<DeviceDao, Device ...@@ -37,6 +38,10 @@ public class DeviceServiceImpl extends AbstractCRUDServiceImpl<DeviceDao, Device
@Autowired @Autowired
private IDeviceFeign deviceFeign; private IDeviceFeign deviceFeign;
@Value("${token.loginName:'admin'}")
private String loginName;
@Value("${token.password:'admin'}")
private String password;
@Override @Override
protected void validData(DeviceEntity entity, Context context) throws AppException { protected void validData(DeviceEntity entity, Context context) throws AppException {
...@@ -142,8 +147,8 @@ public class DeviceServiceImpl extends AbstractCRUDServiceImpl<DeviceDao, Device ...@@ -142,8 +147,8 @@ public class DeviceServiceImpl extends AbstractCRUDServiceImpl<DeviceDao, Device
private String getToken() { private String getToken() {
LoginForm loginForm = new LoginForm(); LoginForm loginForm = new LoginForm();
loginForm.setLoginName("admin"); loginForm.setLoginName(loginName);
loginForm.setPassword("xhx@yb123"); loginForm.setPassword(password);
Rest<String> rest = deviceFeign.getToken(loginForm); Rest<String> rest = deviceFeign.getToken(loginForm);
String token = rest.getData(); String token = rest.getData();
return token; return token;
......
...@@ -48,6 +48,8 @@ application: ...@@ -48,6 +48,8 @@ application:
uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/customer/login/login,/customer/login/logout,/securitycode/createCode,/customer/trial/save,/file/common/*,/file/preview/*,/test*,/api/asset/*,/api/*,/zwfw/*,/ws/*,/swagger-ui*,/topic/*,/uploads/* uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/customer/login/login,/customer/login/logout,/securitycode/createCode,/customer/trial/save,/file/common/*,/file/preview/*,/test*,/api/asset/*,/api/*,/zwfw/*,/ws/*,/swagger-ui*,/topic/*,/uploads/*
token: token:
head: mortal head: mortal
loginName: admin
password: admin
hystrix: hystrix:
command: command:
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment