|
@@ -25,13 +25,25 @@ public class CommonService {
|
|
|
@Autowired
|
|
|
private SysProperty sysProperty;
|
|
|
|
|
|
+ public User login(Long rootOrgId, String loginName, String password) {
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("rootOrgId", rootOrgId);
|
|
|
+ params.put("accountValue", loginName);
|
|
|
+ params.put("password", password);
|
|
|
+ return this.doLogin(params);
|
|
|
+ }
|
|
|
+
|
|
|
public User login(String domain, String loginName, String password) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
- // params.put("rootOrgId", 0L);
|
|
|
params.put("domain", domain);
|
|
|
- params.put("accountType", "COMMON_LOGIN_NAME");
|
|
|
params.put("accountValue", loginName);
|
|
|
params.put("password", password);
|
|
|
+ return this.doLogin(params);
|
|
|
+ }
|
|
|
+
|
|
|
+ private User doLogin(Map<String, Object> params) {
|
|
|
+ params.put("accountType", "COMMON_LOGIN_NAME");
|
|
|
+ params.put("smsCode", "5220");
|
|
|
|
|
|
String url = sysProperty.getServerUrl() + "/api/ecs_core/auth/login";
|
|
|
String result = HttpHelper.post(url, null, params);
|