第57批续7: Java端验证密码后直接回传pwd_verified=1,PHP不再重复验密;简化绑定流程
This commit is contained in:
@@ -6297,7 +6297,7 @@ public class Main extends JavaPlugin
|
|||||||
pendingWebbindApprove.remove(p.getName());
|
pendingWebbindApprove.remove(p.getName());
|
||||||
p.sendMessage("§e正在提交批准…");
|
p.sendMessage("§e正在提交批准…");
|
||||||
webManager.submitWebEmailBindResult(reqId2, p.getName(),
|
webManager.submitWebEmailBindResult(reqId2, p.getName(),
|
||||||
"approve", "", status -> {});
|
"approve", "", true, status -> {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12394,6 +12394,12 @@ public class WebManager {
|
|||||||
public void submitWebEmailBindResult(final String reqId, final String playerName,
|
public void submitWebEmailBindResult(final String reqId, final String playerName,
|
||||||
final String action, final String failReason,
|
final String action, final String failReason,
|
||||||
final java.util.function.Consumer<String> callback) {
|
final java.util.function.Consumer<String> callback) {
|
||||||
|
submitWebEmailBindResult(reqId, playerName, action, failReason, false, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void submitWebEmailBindResult(final String reqId, final String playerName,
|
||||||
|
final String action, final String failReason, final boolean pwdVerified,
|
||||||
|
final java.util.function.Consumer<String> callback) {
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -12402,7 +12408,8 @@ public class WebManager {
|
|||||||
String bodyJson = "{\"request_id\":" + reqId
|
String bodyJson = "{\"request_id\":" + reqId
|
||||||
+ ",\"player\":\"" + escapeJson(playerName) + "\""
|
+ ",\"player\":\"" + escapeJson(playerName) + "\""
|
||||||
+ ",\"action\":\"" + escapeJson(action) + "\""
|
+ ",\"action\":\"" + escapeJson(action) + "\""
|
||||||
+ ",\"fail_reason\":\"" + escapeJson(failReason == null ? "" : failReason) + "\"}";
|
+ ",\"fail_reason\":\"" + escapeJson(failReason == null ? "" : failReason) + "\""
|
||||||
|
+ ",\"pwd_verified\":" + (pwdVerified ? "1" : "0") + "}";
|
||||||
String postUrl = webBaseUrl + "/api/sync.php?action=web_email_bind_result&secret="
|
String postUrl = webBaseUrl + "/api/sync.php?action=web_email_bind_result&secret="
|
||||||
+ java.net.URLEncoder.encode(secretKey, "UTF-8");
|
+ java.net.URLEncoder.encode(secretKey, "UTF-8");
|
||||||
String resp = doPost(postUrl, bodyJson);
|
String resp = doPost(postUrl, bodyJson);
|
||||||
|
|||||||
Reference in New Issue
Block a user