fix 获取token修改
This commit is contained in:
@@ -13,6 +13,7 @@ using Microsoft.Extensions.Options;
|
||||
using SqlSugar;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Attributes;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Dlhis.ScheduledTask.TaskAssignment.Services.Implements;
|
||||
|
||||
@@ -160,13 +161,12 @@ public class AssignmentService : IAssignmentService
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<string> Token(long taskId)
|
||||
{
|
||||
var task = await _dbContext.Queryable<DeviceTaskEntity>().Where(x => x.Id == taskId).FirstAsync();
|
||||
|
||||
var task = await _dbContext.Queryable<DeviceTaskEntity>().Where(x => x.Id == taskId).FirstAsync();
|
||||
task.ThrowIfNull("该任务不存在");
|
||||
if (task.Status != DeviceTaskStatusEnumType.Success)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
var isSuccess = task.Status != DeviceTaskStatusEnumType.Success ? true : false;
|
||||
isSuccess.ThrowIfTrue("设备任务下发状态需为完成");
|
||||
|
||||
string newtoken="";
|
||||
Scoped.Request.Value.Create((sp) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user