mantou132 / nesbox

Online multiplayer games platform
https://nesbox.xianqiao.wang/
MIT License
387 stars 33 forks source link

好友添加,不存在的用户提示”用户不存在“ #227

Closed hehehai closed 2 years ago

hehehai commented 2 years ago

问题

当前添加好友,无论用户是否存在,都不显示发送成功。建议不存在的用户显示”用户不存在“

image image

调整

image
mantou132 commented 2 years ago

这是故意这么设计的。不希望后端直接暴露其他用户的用户名。

就像登录时用户名错误,报错“用户名或者密码错误”一样。

hehehai commented 2 years ago

这是故意这么设计的。不希望后端直接暴露其他用户的用户名。

就像登录时用户名错误,报错“用户名或者密码错误”一样。

嗯,明白的。这里的调整实际依然没有直接保留用户名。

场景 1

  1. 用户 a 想要添加用户 b 为好友
  2. 点击添加,输入 b
  3. 点击确认,好友请求发送成功

场景 2

  1. 用户 a 想要添加用户 b 为好友
  2. 点击添加,输入 c(很明显它没有输入正确的用户名称)
  3. 点击确认
  4. “OH,该用户不存在”。好吧,用户 a 发现他输入错误了
  5. 修改后,点击确认,好友请求发送成功

场景 3

  1. 用户 a 想要添加用户 b 为好友
  2. 点击添加,输入 c(很明显它没有输入正确的用户名称)
  3. 点击确认,好友请求发送成功(虽然错了,但刚好 用户 c 是存在的)

🤔 这里没有模糊匹配

场景 3 的话,我想或许可以有一个已经发送的好友请求的展示(在没有确认前,可以取消发送)

@mantou132 你认为怎么样 ?

mantou132 commented 2 years ago

暂时的修改

Screen Shot 2022-09-22 at 09 26 34 Screen Shot 2022-09-22 at 09 26 20 Screen Shot 2022-09-22 at 10 11 39