feat: 完善微信授权登录功能
- 新增半屏授权登录窗口,从底部滑出 - 支持微信头像和昵称选择 - 新用户注册默认3个金币 - 新增注销账号功能,从数据库删除用户 - 删除旧的授权登录页面 - 退出登录和注销后跳转首页 - 优化登录交互体验
This commit is contained in:
1 parent
832f282ff9
commit
6561e9034b
11 files changed
+593
-563
No files matched your search
@@ -245,4 +245,25 @@ public class UserController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping("/deleteAccount")
|
||||
public Map<String, Object> deleteAccount(@RequestBody Map<String, Object> params) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
String userId = params.get("userId").toString();
|
||||
|
||||
boolean deleted = userInfoService.deleteAccount(userId);
|
||||
if (deleted) {
|
||||
result.put("success", true);
|
||||
result.put("message", "账号已注销");
|
||||
} else {
|
||||
result.put("success", false);
|
||||
result.put("error", "用户不存在");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("error", e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user