From a8ef74732bf04ce10624d73946cc8700e0625b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Tue, 2 Apr 2024 09:32:45 +0800 Subject: [PATCH] =?UTF-8?q?pc=20=E7=99=BB=E5=BD=95bug=20fixed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Front/CustomerController.cs | 9 +++++++++ New_College.Api/Controllers/OAuthController.cs | 17 +++++++++++++++++ New_College.Api/appsettings.Development.json | 4 ++-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/New_College.Api/Controllers/Front/CustomerController.cs b/New_College.Api/Controllers/Front/CustomerController.cs index a2993c8..1795ab2 100644 --- a/New_College.Api/Controllers/Front/CustomerController.cs +++ b/New_College.Api/Controllers/Front/CustomerController.cs @@ -103,6 +103,15 @@ namespace New_College.Api.Controllers.Front //await _services.UpdateCustomer(custome);//注册已后台数据库自动完成 } } + else + { + await _services.Add(new V_CustomerInfo() { + + + + + }); + } } break; } diff --git a/New_College.Api/Controllers/OAuthController.cs b/New_College.Api/Controllers/OAuthController.cs index 640c182..b4db518 100644 --- a/New_College.Api/Controllers/OAuthController.cs +++ b/New_College.Api/Controllers/OAuthController.cs @@ -122,6 +122,23 @@ namespace New_College.Controllers user = baseuser; await _CustomerInfoServices.Update(baseuser); } + else + { + //没有用户则注册一个新用户 + + user = new Model.Models.V_CustomerInfo() + { + IsDelete = false, + UUID = userinfo.sub, + Phone = userinfo.phone, + OpenId = userinfo.aud, + CreateTime = DateTime.UtcNow, + IsVIP = false, + Gender = 0 + }; + user.Id = await _CustomerInfoServices.Add(user); + + } } else { diff --git a/New_College.Api/appsettings.Development.json b/New_College.Api/appsettings.Development.json index 99adffa..4ed1d9e 100644 --- a/New_College.Api/appsettings.Development.json +++ b/New_College.Api/appsettings.Development.json @@ -97,14 +97,14 @@ "DBType": 0, "Enabled": true, "HitRate": 20, - "Connection": "Server=192.168.103.102; Port=3306;SslMode=None;Database=volunteerapp; Uid=ycymedu; Pwd=Vs..127134;CharSet=utf8mb4;AllowLoadLocalInfile=true" + "Connection": "Server=192.168.104.108; Port=3306;SslMode=None;Database=volunteerapp; Uid=root; Pwd=Vs..127134;CharSet=utf8mb4;AllowLoadLocalInfile=true" }, { "ConnId": "MYSQL_CasDoor", "DBType": 0, "Enabled": true, "HitRate": 20, - "Connection": "Server=192.168.103.102; Port=3306;SslMode=None;Database=casdoor; Uid=ycymedu; Pwd=Vs..127134;CharSet=utf8mb4;AllowLoadLocalInfile=true" + "Connection": "Server=192.168.104.108; Port=3306;SslMode=None;Database=casdoor; Uid=root; Pwd=Vs..127134;CharSet=utf8mb4;AllowLoadLocalInfile=true" }, { "ConnId": "WMBLOG_ORACLE",