fix CN Client cannot modify nickname through /user/set-info

This commit is contained in:
HongchengQ
2025-12-07 20:05:05 +08:00
committed by Melledy
parent a7eddd2ed0
commit f8bd7d5db2
2 changed files with 4 additions and 3 deletions

View File

@@ -162,9 +162,9 @@ public class HttpServer {
getApp().post("/user/detail", new UserLoginHandler());
getApp().post("/user/set", new UserSetDataHandler());
getApp().post("/user/set-info", new UserSetDataHandler()); // CN
getApp().post("/user/login", new UserLoginHandler());
getApp().post("/user/quick-login", new UserLoginHandler());
getApp().post("/user/set-info", new HttpJsonResponse("{\"Code\":200,\"Data\":{},\"Msg\":\"OK\"}"));
getApp().post("/user/send-sms", new HttpJsonResponse("{\"Code\":200,\"Data\":{},\"Msg\":\"OK\"}"));
getApp().post("/yostar/get-auth", new GetAuthHandler());

View File

@@ -32,7 +32,8 @@ public class UserSetDataHandler extends UserLoginHandler {
return;
}
if (req.Key.equals("Nickname")) {
// OS uses the former, CN uses the latter
if (req.Key.equals("Nickname") || req.Key.equals("nickname")) {
account.setNickname(req.Value);
account.save();
}