修改后端登陆响应为json,修复登陆页面

This commit is contained in:
qing committed 2026-07-21 22:27:48 +08:00
1 parent 0811dd7960
commit 0399715008
2 files changed
+8 -6

No files matched your search

+5 -1
View File
@@ -359,9 +359,13 @@ http::response<http::string_body> handleLogin(
std::string token = Base64::base64_encode(data);
std::string sign = _PRIV.Sign(data);
json::value jv_rr = {
{"success", true},
{"data", json::object{{"token", token + "_" + sign}}} // 双大括号
};
res.set("Connection", "close");
res.result(http::status::ok);
res.body() = token + "_" + sign;
res.body() = json::serialize(jv_rr);
}
catch (const HttpException& e) {