From e9dea45dd97c772c0af926ceaf345694c69655b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Tue, 19 Sep 2023 17:31:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E5=90=8D=E7=A7=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Front/CustomerController.cs | 25 +++++++++++++++++++ New_College.Api/New_College.xml | 7 ++++++ New_College.Api/appsettings.json | 2 +- New_College.Common/Helper/AliYunOssHelper.cs | 2 +- .../V_CustomerInfoServices.cs | 2 ++ 5 files changed, 36 insertions(+), 2 deletions(-) diff --git a/New_College.Api/Controllers/Front/CustomerController.cs b/New_College.Api/Controllers/Front/CustomerController.cs index 8edb47d..8069d5c 100644 --- a/New_College.Api/Controllers/Front/CustomerController.cs +++ b/New_College.Api/Controllers/Front/CustomerController.cs @@ -227,6 +227,31 @@ namespace New_College.Api.Controllers.Front }; } + + + /// + /// 修改用户头像与名称 + /// + /// + /// + [HttpPost] + public async Task> UpdateCustomerAvatarUrl(UpdateCustomerQuery query) + { + var result = await _services.UpdateCustomerInfo(query); + if (result.Id > 0) + { + var token = JwtHelper.IssueJwt(new TokenModelJwt() { Uid = result.Id, Role = "学生" }); + result.Token = token; + } + return new MessageModel() + { + success = result.Status == 1, + msg = result.Status == 1 ? "成功" : "失败", + response = result + }; + } + + /// /// 根绝Id获取用户信息 /// diff --git a/New_College.Api/New_College.xml b/New_College.Api/New_College.xml index 6f65242..24f863d 100644 --- a/New_College.Api/New_College.xml +++ b/New_College.Api/New_College.xml @@ -148,6 +148,13 @@ + + + 修改用户头像与名称 + + + + 根绝Id获取用户信息 diff --git a/New_College.Api/appsettings.json b/New_College.Api/appsettings.json index 2263d80..344d533 100644 --- a/New_College.Api/appsettings.json +++ b/New_College.Api/appsettings.json @@ -201,7 +201,7 @@ }, "AliYunOss": { - "wendpoint": "https://static-data-ycymedu.oss-cn-shanghai.aliyuncs.com", + "wendpoint": "https://static-data.ycymedu.com", "accessKeyId": "LTAI5tKs3TXSbt7E4WMDcxwR", "accessKeySecret": "EvC8MjRaQC1kHubgU4MtecZnofOb0v", "bucket": "static-data-ycymedu", diff --git a/New_College.Common/Helper/AliYunOssHelper.cs b/New_College.Common/Helper/AliYunOssHelper.cs index c13f233..ffd62cc 100644 --- a/New_College.Common/Helper/AliYunOssHelper.cs +++ b/New_College.Common/Helper/AliYunOssHelper.cs @@ -26,7 +26,7 @@ namespace New_College.Common { // 上传文件。 var cc = client.PutObject(AliYunOssConfig.bucket, key, filepath); - var newurl = string.Format("{0}{1}", AliYunOssConfig.wendpoint, key); + var newurl = string.Format("{0}/{1}", AliYunOssConfig.wendpoint, key); return newurl; } catch (ClientException ex) diff --git a/New_College.Services/V_CustomerInfoServices.cs b/New_College.Services/V_CustomerInfoServices.cs index cadcbcf..11d3e12 100644 --- a/New_College.Services/V_CustomerInfoServices.cs +++ b/New_College.Services/V_CustomerInfoServices.cs @@ -117,6 +117,8 @@ namespace New_College.Services } } + + /// /// 完善用户信息 ///