@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Http;
|
|||||||
using Microsoft.AspNetCore.Http.Features;
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
using Microsoft.AspNetCore.Cors;
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Yh.Platform.Abstractions;
|
using Yh.Platform.Abstractions;
|
||||||
@@ -49,6 +50,20 @@ namespace YhCore.WebApi.Controllers.Api
|
|||||||
return BoaUserContext.Get();
|
return BoaUserContext.Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取初始化地址(对齐老 UserCenterApiController.GetInitUrl:读 Session["AppInitUrl"])。
|
||||||
|
/// 前端 main.js 首次进入时调用:resp.Data 有值则 router.replace(initUrl),否则回 /docPrint/。
|
||||||
|
/// 响应形状为混排兼容体 {"code":0,"msg":"","State":true,"Data":...}:
|
||||||
|
/// code 小写保证前端 api/index.js 的 success 回调触发(response.code==0),
|
||||||
|
/// Data/State 大写保证 main.js 的 resp.Data 取到值——故用 ContentResult 手写 JSON
|
||||||
|
/// (ContentResult 不参与全局包装,也不经 camelCase ContractResolver)。
|
||||||
|
/// </summary>
|
||||||
|
[HttpGet("GetInitUrl")]
|
||||||
|
public string GetInitUrl()
|
||||||
|
{
|
||||||
|
return HttpContext.Session.GetString("AppInitUrl");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 登出(对应 Java GET /api/base/logout:session.invalidate())。
|
/// 登出(对应 Java GET /api/base/logout:session.invalidate())。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user