购买api
This commit is contained in:
@@ -149,6 +149,27 @@ namespace Hncore.Pass.Vpn.Service
|
||||
return new ApiResult(1);
|
||||
}
|
||||
|
||||
public async Task<ApiResult> ApiUpdateAccountPwd(UpdateAccountPwdRequest request,int userid)
|
||||
{
|
||||
var entity = await this.Query(m => m.Account == request.Account && m.Pwd == request.Pwd && m.DeleteTag == 0 && m.UserId == userid).FirstOrDefaultAsync();
|
||||
if (entity == null)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "账号不存在");
|
||||
}
|
||||
if (request.Pwd.NotHas())
|
||||
{
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "密码不能为空");
|
||||
}
|
||||
var agentRet = await m_AgentService.UpdateAccountPwd(entity.ProductId.Value, entity.Account, request.RePwd);
|
||||
if (!agentRet)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "远程更新失败");
|
||||
}
|
||||
entity.Pwd = request.Pwd;
|
||||
await this.Update(entity);
|
||||
return new ApiResult(1);
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<ProductAccountEntity>> GetUserTestAccount(int userId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user