This commit is contained in:
lzw
2021-11-03 21:14:58 +08:00
parent eb51c3c755
commit 6f79f870bb
7 changed files with 26 additions and 14 deletions

View File

@@ -50,6 +50,8 @@ namespace Yi.Framework.ApiMicroservice.Controllers
if ( user_data!=null)
{
var token = MakeJwt.app(new jwtUser() {user=user_data,menuIds= menuList});
JobModel.visitNum += 1;
return Result.Success().SetData(new { user = new { user_data.id, user_data.username, user_data.introduction, user_data.icon, user_data.nick }, token });
}
return Result.Error();

View File

@@ -29,7 +29,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
_cacheClientDB = cacheClientDB;
}
/// <summary>
/// 查
@@ -38,8 +38,8 @@ namespace Yi.Framework.ApiMicroservice.Controllers
[HttpGet]
public Result GetSetting()
{
var setDto = Common.Helper.JsonHelper.ParseFormByJson<SettingDto>(_cacheClientDB.Get<string>(RedisConst.key));
return Result.Success().SetData(setDto);
var setDto = Common.Helper.JsonHelper.StrToObj<SettingDto>(_cacheClientDB.Get<string>(RedisConst.key));
return Result.Success().SetData( setDto);
}
/// <summary>
@@ -48,14 +48,13 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// <param name="settingDto"></param>
/// <returns></returns>
[HttpPut]
public Result UpdateSetting(SettingDto settingDto)
public Result UpdateSetting(SettingDto settingDto)
{
var setDto = Common.Helper.JsonHelper.GetJSON<SettingDto>(settingDto);
var setDto = Common.Helper.JsonHelper.ObjToStr<SettingDto>(settingDto);
_cacheClientDB.Set(RedisConst.key, setDto);
_cacheClientDB.Set(RedisConst.key, setDto);
return Result.Success();
}
}
}
}

View File

@@ -101,7 +101,7 @@ namespace Yi.Framework.ApiMicroservice
#region
//错误抓取反馈注入
#endregion
//app.UseErrorHandlingService();
app.UseErrorHandlingService();
#region
//静态文件注入

View File

@@ -15,7 +15,7 @@
"Cors_Enabled": true,
"RabbitMQ_Enabled": false,
"Redis_Enabled": true,
"RedisSeed_Enabled": false,
"RedisSeed_Enabled": true,
"Kafka_Enabled": false,
"MutiDB_Enabled": false,
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB