From cfdba652242559ee3e6080d584fd0d52c9d28933 Mon Sep 17 00:00:00 2001 From: zpc Date: Thu, 11 Sep 2025 13:27:25 +0800 Subject: [PATCH] AnonymousLogin --- CoreCms.Net.IServices/User/ICoreCmsUserServices.cs | 10 ++++++++-- .../Controllers/UserController.cs | 13 +++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CoreCms.Net.IServices/User/ICoreCmsUserServices.cs b/CoreCms.Net.IServices/User/ICoreCmsUserServices.cs index e5e5497..212953c 100644 --- a/CoreCms.Net.IServices/User/ICoreCmsUserServices.cs +++ b/CoreCms.Net.IServices/User/ICoreCmsUserServices.cs @@ -102,8 +102,14 @@ namespace CoreCms.Net.IServices /// /// Task SmsLogin(FMWxAccountCreate entity, - int loginType = (int) GlobalEnumVars.LoginType.WeChatPhoneNumber, int platform = 1); + int loginType = (int)GlobalEnumVars.LoginType.WeChatPhoneNumber, int platform = 1); + /// + /// 匿名登录 + /// + /// + /// + Task AnonymousLogin(int user_id); /// /// 根据条件查询分页数据 @@ -132,6 +138,6 @@ namespace CoreCms.Net.IServices /// Task> StatisticsOrder(int day); - + } } \ No newline at end of file diff --git a/CoreCms.Net.Web.WebApi/Controllers/UserController.cs b/CoreCms.Net.Web.WebApi/Controllers/UserController.cs index 548366f..3fc3ad7 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/UserController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/UserController.cs @@ -288,6 +288,19 @@ namespace CoreCms.Net.Web.WebApi.Controllers } + /// + /// 匿名登录 + /// + /// + [HttpPost] + [Authorize] + public async Task AnonymousLogin() + { + var userId = _user.ID; + var jm = new WebApiCallBack(); + jm = await _userServices.AnonymousLogin(userId); + return jm; + } #region wx.login登陆成功之后发送的请求=========================================================