登录账户任意填写都能登录的BUG
This commit is contained in:
@@ -112,7 +112,7 @@ namespace dy.net.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
var user = await _userService.GetUser();
|
||||
var user = await _userService.GetUser(loginUserInfo.UserName);
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ docker run -d --restart=always \
|
||||
-v /你的/本地/数据库/路径:/app/db \
|
||||
-p 18101:10101 \
|
||||
--name dysync2025 \
|
||||
registry.cn-hangzhou.aliyuncs.com/jianzhichu/dysync.net:v1.0.3
|
||||
registry.cn-hangzhou.aliyuncs.com/jianzhichu/dysync.net
|
||||
|
||||
###-p 后面的第二个端口 必须10101(源码里面写死了)
|
||||
```
|
||||
@@ -73,7 +73,7 @@ version: '3.8'
|
||||
|
||||
services:
|
||||
dysync:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/jianzhichu/dysync.net:v1.0.3
|
||||
image: registry.cn-hangzhou.aliyuncs.com/jianzhichu/dysync.net
|
||||
container_name: dysync2025 # 容器名称,可自定义
|
||||
restart: always # 容器异常退出时自动重启
|
||||
ports:
|
||||
|
||||
@@ -50,9 +50,16 @@ namespace dy.net.repository
|
||||
}
|
||||
|
||||
|
||||
public async Task<LoginUserInfo> GetUser()
|
||||
public async Task<LoginUserInfo> GetUser(string userName=null)
|
||||
{
|
||||
return await this.GetFirstAsync(x=>!string.IsNullOrWhiteSpace(x.Id));
|
||||
if (string.IsNullOrWhiteSpace(userName))
|
||||
{
|
||||
return await this.GetFirstAsync(x=>!string.IsNullOrWhiteSpace(x.Id));
|
||||
}
|
||||
else
|
||||
{
|
||||
return await this.GetFirstAsync(x => x.UserName == userName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ namespace dy.net.service
|
||||
return await _userRepository.UpdatePwd(loginUser);
|
||||
}
|
||||
|
||||
public async Task<LoginUserInfo> GetUser()
|
||||
public async Task<LoginUserInfo> GetUser(string userName=null)
|
||||
{
|
||||
return await _userRepository.GetUser();
|
||||
return await _userRepository.GetUser(userName);
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateAvatar(string avatar)
|
||||
|
||||
Reference in New Issue
Block a user