Interface URL address
Loading table...
Interface description
Loading table...
Request parameter
Loading table...
Response parameter
Loading table...
Error Code
2218: Incorrect username or password, login failed.
2270: Login is not allowed now.
2214: The current user is logged out, the login failed
2215: The current user has been blocked and failed to log in. Please contact customer service.
2217: Account has been disabled, please contact customer service.
2632: Access is too frequent, please try again later
37153: You already have a credit conversion operation in progress, please try again later
21116: Regional restrictions
2220: The number of incorrect passwords has reached the upper limit, the system limits you to log in after 30 minutes
21110: Player account is illegal
21101: Player account error
21102: Player account does not exist
21003: Login too often, please try again later
37197: API customer information does not exist
37203: API clients are disabled
Example
@WebMethod("open.operator.user.login")
public void login() {
RequestContext rc = RequestContext.holder.get();
ParamUtil pu = ParamUtil.wrap(rc.params());
String random = pu.getNotNullStr("random");
String digest = pu.getNotNullStr("digest");
String sn = pu.getNotNullStr("sn");
String loginId = pu.getNotNullStr("loginId");
String password = pu.getNotNullStr("password");
String secretCode = PropertyUtil.get("mega.open.user.login."+sn);
String getDigest = HashUtil.md5Hex(random + sn + loginId + secretCode);
if (!digest.equals(getDigest)) {
Map<String, Object> rtv = new HashMap<String, Object>();
rtv.put("success", 0);
rtv.put("errorCode", "37197");
rc.setResult(rtv);
return;
}
String salt = SeqUUIDUtil.toSequenceUUID();
String saltedPassword = HashUtil.sha1Base64(password)+ salt;
String loginIp = pu.getStr("clientIp", rc.getFromIp());
String saltedPasswordf = HashUtil.sha1Base64(saltedPassword);
rc.params().put("sn", sn);
rc.params().put("loginIp", loginIp);
rc.params().put("saltedPassword", saltedPasswordf);
rc.params().put("salt", salt);
rc.params().put("loginId", loginId);
rc.params().put("api_from", "megaapi");
rc.params().put("terminal", 14);
Map<String, Object> rtv = null;
try {
rtv = fac.getRpc().login(rc.params());
rtv.put("success", 1);
} catch (LogicError e) {
rtv = new HashMap<String, Object>();
rtv.put("success", 0);
rtv.put("errorCode", e.getCode());
rc.setResult(rtv);
return;
}
rc.setResult(rtv);
}
Response Example
{
"id": "1deaf133-c579-400a-a3c2-e54123adb9ca",
"result": {
"success": "1",
"sessionId": "ld0073020ABA1604AE63AC28A2F28B05",
"msg": "登录成功"
},
"error": null,
"jsonrpc": "2.0"
}