From 24a3e64f5713fb0c6f8bae865715c66308371955 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期四, 15 八月 2024 12:54:55 +0800
Subject: [PATCH] Merge branch 'master' of http://47.108.235.38:8080/r/cylsg
---
cylsg/EzUpFile/EzUpFile.csproj | 9
cylsg/EzWechat/WechatConfig.json | 6
.gitignore | 4
cylsg/cylsg.redis/RedisConfig.json | 2
cylsg/EzTencentCloud/Class1.cs | 7
cylsg/cylsg.Core/BaseModelBase.cs | 8
cylsg/cylsg.sln | 24 +
cylsg/cylsg.Web.Core/Startup.cs | 18 +
cylsg/cylsg.Web.Entry/SingleFilePublish.cs | 5
cylsg/cylsg.Web.Entry/appsettings.json | 6
cylsg/EzWechat/EzWechat.csproj | 8
cylsg/cylsg.Application/cylsg.Application.xml | 58 ++++
cylsg/cylsg.Application/cylsg.Application.csproj | 5
cylsg/EzWechat/IWechatService.cs | 15 +
cylsg/cylsg.redis/cylsg.redis.csproj | 6
cylsg/EzTencentCloud/ITencentCloudService.cs | 29 ++
cylsg/cylsg.Model/UserModel/User.cs | 21 +
cylsg/EzTencentCloud/EzTencentCloud.csproj | 23 +
cylsg/EzTencentCloud/TencentCloudConfig.json | 6
cylsg/EzWechat/WechatService.cs | 84 ++++++
cylsg/cylsg.Application/applicationsettings.json | 12
cylsg/cylsg.Authorization/IEzAuthorizationService.cs | 2
cylsg/cylsg.Web.Entry/Properties/launchSettings.json | 4
cylsg/cylsg.Web.Entry/cylsg.Web.Entry.csproj | 1
cylsg/cylsg.Application/LogoInController.cs | 164 +++++++++++++
cylsg/EzTencentCloud/TencentCloudService.cs | 141 +++++++++++
cylsg/EzUpFile/Class1.cs | 7
27 files changed, 636 insertions(+), 39 deletions(-)
diff --git a/.gitignore b/.gitignore
index 6d2e95a..f80bbf4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,7 @@
cylsg/EzUpFiles/obj/
cylsg/EzWechat/obj/
cylsg/cylsg.redis/bin/
+cylsg/EzWechat/bin/
+cylsg/EzTencentCloud/bin/
+cylsg/EzTencentCloud/obj/
+cylsg/EzUpFile/obj/
diff --git a/cylsg/EzTencentCloud/Class1.cs b/cylsg/EzTencentCloud/Class1.cs
new file mode 100644
index 0000000..5238cf9
--- /dev/null
+++ b/cylsg/EzTencentCloud/Class1.cs
@@ -0,0 +1,7 @@
+锘縩amespace EzTencentCloud
+{
+ public class Class1
+ {
+
+ }
+}
diff --git a/cylsg/EzTencentCloud/EzTencentCloud.csproj b/cylsg/EzTencentCloud/EzTencentCloud.csproj
new file mode 100644
index 0000000..8734b39
--- /dev/null
+++ b/cylsg/EzTencentCloud/EzTencentCloud.csproj
@@ -0,0 +1,23 @@
+锘�<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net8.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="TencentCloudSDK" Version="3.0.1069" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\cylsg.Core\cylsg.Core.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <None Update="TencentCloudConfig.json">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+
+</Project>
diff --git a/cylsg/EzTencentCloud/ITencentCloudService.cs b/cylsg/EzTencentCloud/ITencentCloudService.cs
new file mode 100644
index 0000000..8a43e16
--- /dev/null
+++ b/cylsg/EzTencentCloud/ITencentCloudService.cs
@@ -0,0 +1,29 @@
+锘縰sing Furion.DependencyInjection;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TencentCloud.Ocr.V20181119.Models;
+
+namespace EzTencentCloud
+{
+ /// <summary>
+ /// 鑵捐浜戞湇鍔�
+ /// </summary>
+ public interface ITencentCloudService: IScoped
+ {
+ /// <summary>
+ /// 韬唤璇佽瘑鍒紝骞跺壀瑁�
+ /// </summary>
+ /// <param name="ImageBase64"></param>
+ /// <param name="isFRONT"></param>
+ /// <returns></returns>
+ IDCardOCRResponse IdCord(string ImageBase64, bool isFRONT);
+ /// <summary>
+ /// 鑾峰彇鍓鍚庣殑韬唤璇佺収鐗�
+ /// </summary>
+ /// <returns></returns>
+ string GetIdCordImg();
+ }
+}
diff --git a/cylsg/EzTencentCloud/TencentCloudConfig.json b/cylsg/EzTencentCloud/TencentCloudConfig.json
new file mode 100644
index 0000000..e52425a
--- /dev/null
+++ b/cylsg/EzTencentCloud/TencentCloudConfig.json
@@ -0,0 +1,6 @@
+{
+ "TencentCloud": {
+ "SecretId": "AKIDIPFp9CyThfMmvoQlpeCl34pKYVBahY9T",
+ "SecretKey": "4rNcaHhrkMhmb9QQ9bmgKipfFZcOt86n"
+ }
+}
diff --git a/cylsg/EzTencentCloud/TencentCloudService.cs b/cylsg/EzTencentCloud/TencentCloudService.cs
new file mode 100644
index 0000000..5d2919d
--- /dev/null
+++ b/cylsg/EzTencentCloud/TencentCloudService.cs
@@ -0,0 +1,141 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Sockets;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+using TencentCloud.Ocr.V20181119;
+using TencentCloud.Ocr.V20181119.Models;
+using Newtonsoft.Json;
+using TencentCloud.Common;
+using TencentCloud.Common.Profile;
+using Furion.DependencyInjection;
+using Furion;
+
+namespace EzTencentCloud
+{
+ public class TencentCloudService: ITencentCloudService, IScoped
+ {
+ /// <summary>
+ /// 鍓鍚庣殑韬唤璇佸浘鐗�
+ /// </summary>
+ public string CropIdCard { get; set; }
+
+ public string GetIdCordImg()
+ {
+ if (string.IsNullOrEmpty(CropIdCard))
+ return "";
+ else
+ return CropIdCard;
+
+ }
+
+ public IDCardOCRResponse IdCord(string ImageBase64, bool isFRONT)
+ {
+ try
+ {
+ Credential cred = new Credential
+ {
+ SecretId = App.Configuration["TencentCloud:SecretId"] ??"AKIDIPFp9CyThfMmvoQlpeCl34pKYVBahY9T",
+ SecretKey = App.Configuration["TencentCloud:SecretKey"] ?? "4rNcaHhrkMhmb9QQ9bmgKipfFZcOt86n"
+ };
+
+ ClientProfile clientProfile = new ClientProfile();
+ HttpProfile httpProfile = new HttpProfile();
+
+
+ httpProfile.Endpoint = ("ocr.tencentcloudapi.com");
+ clientProfile.HttpProfile = httpProfile;
+
+ OcrClient client = new OcrClient(cred, "ap-beijing", clientProfile);
+ IDCardOCRRequest req = new IDCardOCRRequest();
+ if (isFRONT)
+ req.CardSide = "FRONT";
+ else
+ req.CardSide = "BACK";
+ req.ImageBase64 = ImageBase64;
+
+ req.Config = JsonConvert.SerializeObject(new
+ {
+ //韬唤璇佺収鐗囪鍓紙鍘绘帀璇佷欢澶栧浣欑殑杈圭紭銆佽嚜鍔ㄧ煫姝f媿鎽勮搴︼級
+ CropIdCard = true,
+ // CropPortrait = true,
+ //杈规鍜屾鍐呴伄鎸″憡璀�
+ BorderCheckWarn = true,
+ //PS妫�娴嬪憡璀�
+ DetectPsWarn = true,
+ //涓存椂韬唤璇佸憡璀�
+ TempIdWarn = true,
+ //韬唤璇佹湁鏁堟棩鏈熶笉鍚堟硶鍛婅
+ InvalidDateWarn = true,
+ //鍥剧墖璐ㄩ噺鍒嗘暟锛堣瘎浠峰浘鐗囩殑妯$硦绋嬪害锛�
+ Quality = true,
+
+ });
+ IDCardOCRResponse resp = client.IDCardOCRSync(req);
+
+ if (resp == null)
+ throw new Exception("鍥剧墖鏃犳硶璇嗗埆锛岃閲嶆柊閫夋嫨韬唤璇佸浘鐗�");
+
+
+ var adv = JsonConvert.DeserializeObject<AdvancedInfo>(resp.AdvancedInfo);
+ if (adv == null)
+ throw new Exception("鍥剧墖鏃犳硶璇嗗埆锛岃閲嶆柊閫夋嫨韬唤璇佸浘鐗�");
+ if (adv?.BorderCodeValue != null && adv.BorderCodeValue > 50)
+ throw new Exception("韬唤璇佸浘鐗囦笉瀹屾暣锛岃閲嶆柊閫夋嫨韬唤璇佸浘鐗�");
+ if (adv?.Quality != null && adv.Quality < 50)
+ throw new Exception("鍥剧墖妯$硦锛岃閲嶆柊閫夋嫨韬唤璇佸浘鐗�");
+ if (adv?.WarnInfos?.Where(x => x == -9100) == null)
+ throw new Exception("韬唤璇佹棩鏈熶笉鍚堟硶锛岃閲嶆柊閫夋嫨韬唤璇佸浘鐗�");
+ if (adv?.WarnInfos?.Where(x => x == -9106) == null)
+ throw new Exception("璇ュ浘鐗囧彲鑳芥槸琚玃S杩囷紝璇烽噸鏂伴�夋嫨韬唤璇佸浘鐗�");
+
+ CropIdCard = adv.IdCard;
+ return resp;
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+
+
+ }
+
+
+ }
+
+ //杩斿洖鎵╁睍鍙傛暟
+ internal class AdvancedInfo
+ {
+ /// <summary>
+ /// idCard 瑁佸壀鍚庤韩浠借瘉鐓х墖鐨刡ase64缂栫爜锛岃姹� Config.CropIdCard 鏃惰繑鍥烇紱
+ /// </summary>
+ public string? IdCard { get; set; }
+ /// <summary>
+ /// 韬唤璇佸ご鍍忕収鐗囩殑base64缂栫爜锛岃姹� Config.CropPortrait 鏃惰繑鍥烇紱
+ /// </summary>
+ public string? Portrait { get; set; }
+ /// <summary>
+ /// 鍥剧墖璐ㄩ噺鍒嗘暟锛岃姹� Config.Quality 鏃惰繑鍥烇紙鍙栧�艰寖鍥达細0 ~ 100锛屽垎鏁拌秺浣庤秺妯$硦锛屽缓璁槇鍊尖墺50锛�;
+ /// </summary>
+ public int? Quality { get; set; }
+ /// <summary>
+ /// 韬唤璇佽竟妗嗕笉瀹屾暣鍛婅闃堝�煎垎鏁帮紝璇锋眰 Config.BorderCheckWarn鏃惰繑鍥烇紙鍙栧�艰寖鍥达細0 ~ 100锛屽垎鏁拌秺浣庤竟妗嗛伄鎸″彲鑳芥�ц秺浣庯紝寤鸿闃堝�尖墹50锛�;
+ /// </summary>
+ public int BorderCodeValue { get; set; }
+ /// <summary>
+ /// 鍛婅淇℃伅锛孋ode 鍛婅鐮佸垪琛ㄥ拰閲婁箟锛�
+ ///-9100 韬唤璇佹湁鏁堟棩鏈熶笉鍚堟硶鍛婅锛�
+ ///-9101 韬唤璇佽竟妗嗕笉瀹屾暣鍛婅锛�
+ ///-9102 韬唤璇佸鍗颁欢鍛婅锛�
+ ///-9103 韬唤璇佺炕鎷嶅憡璀︼紝
+ ///-9105 韬唤璇佹鍐呴伄鎸″憡璀︼紝
+ ///-9104 涓存椂韬唤璇佸憡璀︼紝
+ ///-9106 韬唤璇� PS 鍛婅锛�
+ ///-9107 韬唤璇佸弽鍏夊憡璀︺��
+ /// </summary>
+ public List<int> WarnInfos { get; set; }
+ }
+
+}
diff --git a/cylsg/EzUpFile/Class1.cs b/cylsg/EzUpFile/Class1.cs
new file mode 100644
index 0000000..2d366e9
--- /dev/null
+++ b/cylsg/EzUpFile/Class1.cs
@@ -0,0 +1,7 @@
+锘縩amespace EzUpFile
+{
+ public class Class1
+ {
+
+ }
+}
diff --git a/cylsg/EzUpFile/EzUpFile.csproj b/cylsg/EzUpFile/EzUpFile.csproj
new file mode 100644
index 0000000..fa71b7a
--- /dev/null
+++ b/cylsg/EzUpFile/EzUpFile.csproj
@@ -0,0 +1,9 @@
+锘�<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net8.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+</Project>
diff --git a/cylsg/EzWechat/EzWechat.csproj b/cylsg/EzWechat/EzWechat.csproj
index f8face4..1e28ec0 100644
--- a/cylsg/EzWechat/EzWechat.csproj
+++ b/cylsg/EzWechat/EzWechat.csproj
@@ -12,6 +12,14 @@
<ItemGroup>
<ProjectReference Include="..\cylsg.Core\cylsg.Core.csproj" />
+ <ProjectReference Include="..\cylsg.redis\cylsg.redis.csproj" />
+ <ProjectReference Include="..\cylsg.utility\cylsg.utility.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <None Update="WechatConfig.json">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
</ItemGroup>
</Project>
diff --git a/cylsg/EzWechat/IWechatService.cs b/cylsg/EzWechat/IWechatService.cs
index 935346f..bde7133 100644
--- a/cylsg/EzWechat/IWechatService.cs
+++ b/cylsg/EzWechat/IWechatService.cs
@@ -1,4 +1,5 @@
-锘縰sing System;
+锘縰sing SKIT.FlurlHttpClient.Wechat.Api.Models;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -9,5 +10,17 @@
public interface IWechatService
{
+ /// <summary>
+ /// 浣跨敤jsocde 鎹㈠尯 code
+ /// </summary>
+ /// <param name="jscode"></param>
+ /// <returns></returns>
+ Task<string> GetOpenID(string jscode);
+ /// <summary>
+ /// 鑾峰彇鎵嬫満鍙风爜
+ /// </summary>
+ /// <param name="bindgetphonenumber"></param>
+ /// <returns></returns>
+ Task<string> GetPhone(string bindgetphonenumber);
}
}
diff --git a/cylsg/EzWechat/WechatConfig.json b/cylsg/EzWechat/WechatConfig.json
index a6540e1..f238b57 100644
--- a/cylsg/EzWechat/WechatConfig.json
+++ b/cylsg/EzWechat/WechatConfig.json
@@ -1,7 +1,7 @@
{
- "WechatAPP" :{
- "AppId": "寰俊 AppId",
- "AppSecret": "寰俊 AppSecret"
+ "WechatAPP": {
+ "AppId": "wx983556688354dd14",
+ "AppSecret": "2ab1aefaac926855dc9d5f7bf7f04477"
}
}
\ No newline at end of file
diff --git a/cylsg/EzWechat/WechatService.cs b/cylsg/EzWechat/WechatService.cs
index cc1cf84..1d07cce 100644
--- a/cylsg/EzWechat/WechatService.cs
+++ b/cylsg/EzWechat/WechatService.cs
@@ -1,26 +1,35 @@
-锘縰sing Furion;
+锘縰sing EzCoreNet.Redis;
+using Furion;
+using Furion.DependencyInjection;
+using Furion.DynamicApiController;
+using Furion.FriendlyException;
+using Microsoft.Extensions.Options;
using SKIT.FlurlHttpClient.Wechat.Api;
using SKIT.FlurlHttpClient.Wechat.Api.Models;
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace EzWechat
{
- public class WechatService:IWechatService
+ public class WechatService:IWechatService ,IScoped
{
+ private readonly WechatApiClient _client;
+ private readonly IEzCoreNetRedisService _redisService;
- public WechatService() {
-
+ public WechatService(IEzCoreNetRedisService ezCoreNetRedis) {
+
/* 浠ュ叕浼楀彿鑾峰彇鐢ㄦ埛淇℃伅鎺ュ彛涓轰緥 */
var request = new WechatApiClientOptions()
{
AppId = App.Configuration["WechatAPP:AppId"],
AppSecret = App.Configuration["WechatAPP:AppSecret"],
-
+ Timeout=3000,
+
//ImmeDeliveryAppKey = "鍗虫椂閰嶉�佺浉鍏虫湇鍔� AppKey锛屼笉鐢ㄥ垯涓嶅~",
//ImmeDeliveryAppSecret = "鍗虫椂閰嶉�佺浉鍏虫湇鍔� AppSecret锛屼笉鐢ㄥ垯涓嶅~",
//VirtualPaymentAppKey = "铏氭嫙鏀粯鐩稿叧鏈嶅姟 AppKey锛屼笉鐢ㄥ垯涓嶅~",
@@ -28,9 +37,74 @@
//MidasAppKey = "绫冲ぇ甯� 1.0 鐩稿叧鏈嶅姟 AppKey锛屼笉鐢ㄥ垯涓嶅~",
//MidasOfferIdV2 = "绫冲ぇ甯� 2.0 鐩稿叧鏈嶅姟 OfferId锛屼笉鐢ㄥ垯涓嶅~",
//MidasAppKeyV2 = "绫冲ぇ甯� 2.0 鐩稿叧鏈嶅姟 AppKey锛屼笉鐢ㄥ垯涓嶅~"
+ };
+ _client = WechatApiClientBuilder.Create(request).Build();
+
+ _redisService = ezCoreNetRedis;
+
+
+ }
+
+ public async Task<string> GetOpenID(string jscode)
+ {
+
+ var reques = new SnsJsCode2SessionRequest()
+ {
+
+
+
+
+ JsCode = jscode
+ };
+ var a= await _client.ExecuteSnsJsCode2SessionAsync(reques);
+ if(a.IsSuccessful())
+ {
+ return a.OpenId;
+ }
+ else
+ {
+ throw Oops.Oh($"{a.ErrorCode}+++{a.ErrorMessage}");
+ }
+ }
+ public async Task<string> GetPhone( string bindgetphonenumber)
+ {
+
+
+ var requs = new WxaBusinessGetUserPhoneNumberRequest()
+ {
+ AccessToken = await GetAccessToken(),
+ Code= bindgetphonenumber
+
};
+ var a= await _client.ExecuteWxaBusinessGetUserPhoneNumberAsync(requs);
+ if (a.IsSuccessful())
+ return a.PhoneInfo.PurePhoneNumber;
+ else
+ {
+ throw Oops.Oh($"{a.ErrorCode}+++{a.ErrorMessage}");
+ }
}
+ /// <summary>
+ /// 鑾峰彇AccToken
+ /// </summary>
+ /// <returns></returns>
+ private async Task<string> GetAccessToken()
+ {
+ string key = _redisService.Get<string>("WxAccessToken");
+ if(string.IsNullOrEmpty(key))
+ {
+ var a = await _client.ExecuteCgibinTokenAsync(new CgibinTokenRequest { });
+ if(!a.IsSuccessful())
+ {
+ throw Oops.Oh($"{a.ErrorCode}+++{a.ErrorMessage}");
+ }
+ key=a.AccessToken;
+ _redisService.Add<string>("WxAccessToken", a.AccessToken, 7000);
+ }
+ return key;
+ }
+
}
}
diff --git a/cylsg/cylsg.Application/LogoInController.cs b/cylsg/cylsg.Application/LogoInController.cs
new file mode 100644
index 0000000..8521f42
--- /dev/null
+++ b/cylsg/cylsg.Application/LogoInController.cs
@@ -0,0 +1,164 @@
+锘縰sing cylsg.Authorization;
+using cylsg.Core;
+using cylsg.Model.UserModel;
+using cylsg.utility.Extend;
+using EzWechat;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace cylsg.Application
+{
+ /// <summary>
+ /// 鐧诲綍
+ /// </summary>
+ [DynamicApiController]
+ public class LogoIn
+ {
+ private readonly IWechatService _wechatService;
+
+ private readonly IEzAuthorizationService _ezAuthorizationService;
+ public LogoIn(IWechatService wechatService,
+ IEzAuthorizationService ezAuthorizationService)
+ {
+ _wechatService = wechatService;
+ _ezAuthorizationService = ezAuthorizationService;
+
+ }
+ /// <summary>
+ /// 蹇�熺櫥褰�
+ /// </summary>
+ /// <returns></returns>
+ [HttpGet]
+ [QueryParameters]
+ public async Task<TokenInfo> LogoinFast(string jscode)
+ {
+
+ var opeid = await _wechatService.GetOpenID(jscode);
+ var UserRes = new BaseRepository<User>();
+
+
+ var user = await UserRes.GetFirstAsync(x => x.WxOpenId == opeid);
+ if (user == null)
+ {
+ throw Oops.Oh("娌℃壘鍒扮敤鎴�,闇�瑕侀噸鏂版敞鍐岀櫥褰�");
+ }
+ var jwt = new EzJwtModel()
+ {
+ ITCode = user.ItCode,
+ NickName = user.Nickname,
+ UserID = user.Id,
+
+
+ };
+
+
+ return _ezAuthorizationService.CreateToken<EzJwtModel>(jwt);
+
+
+
+
+
+ }
+
+
+ /// <summary>
+ /// 娉ㄥ唽鐢ㄦ埛骞剁櫥褰�
+ /// </summary>
+ /// <param name="Param">logoinjscode</param>
+ /// <returns></returns>
+ [HttpPost]
+ public async Task<TokenInfo> CreateUser(UserInfoIn Param)
+ {
+
+ var opeid = await _wechatService.GetOpenID(Param.JsCode);
+ var UserRes = new BaseRepository<User>();
+
+
+ var user = await UserRes.GetFirstAsync(x => x.WxOpenId == opeid);
+ if (user == null)
+ {
+ //娌℃湁鐢ㄦ埛 锛岄渶瑕佹柊寤虹敤鎴�
+ var phone = await _wechatService.GetPhone(Param.Bindgetphonenumber);
+
+ user = new User
+ {
+
+ Avatar = phone,
+ Nickname = Param.Nickname??phone.PrivacyStr(),
+ name = Param.Name ?? phone,
+ Phone = phone,
+ ItCode = phone,
+ PassWord = "123456",
+ WxOpenId = opeid,
+
+
+
+ };
+
+ await UserRes.EzInsertAsync(user);
+
+
+ }
+ var jwt = new EzJwtModel()
+ {
+ ITCode = user.ItCode,
+ NickName = user.Nickname,
+ UserID = user.Id,
+
+
+ };
+
+
+ return _ezAuthorizationService.CreateToken<EzJwtModel>(jwt);
+
+
+
+
+
+
+
+ }
+
+
+
+
+
+ }
+ /// <summary>
+ /// 鍒涘缓鐢ㄦ埛妯″瀷
+ /// </summary>
+
+ public class UserInfoIn()
+ {
+ /// <summary>
+ /// 澶村儚
+ /// </summary>
+ public string? Avatar { get; set; }
+ /// <summary>
+ /// 鏄电О
+ /// </summary>
+ public string? Nickname { get; set; }
+ /// <summary>
+ /// 鐢佃瘽
+ /// </summary>
+ public string? Phone { get; set; }
+ /// <summary>
+ /// 鍚嶇О
+ /// </summary>
+ public string? Name { get; set; }
+
+ /// <summary>
+ /// 鎵嬫満鍙锋崲鍙栫爜
+ /// </summary>
+ [Required]
+ public string Bindgetphonenumber { get; set; }
+ /// <summary>
+ /// jscode
+ /// </summary>
+ [Required]
+ public string JsCode { get; set;}
+ }
+}
diff --git a/cylsg/cylsg.Application/applicationsettings.json b/cylsg/cylsg.Application/applicationsettings.json
index b01b457..4b91598 100644
--- a/cylsg/cylsg.Application/applicationsettings.json
+++ b/cylsg/cylsg.Application/applicationsettings.json
@@ -1,22 +1,22 @@
锘縶
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
"SpecificationDocumentSettings": {
- "DocumentTitle": "Furion | 瑙勮寖鍖栨帴鍙�",
+ "DocumentTitle": "Furion | 宸濆嵃闆舵椂宸�",
"GroupOpenApiInfos": [
{
"Group": "Default",
- "Title": "瑙勮寖鍖栨紨绀�",
- "Description": "宸濆嵃鐏垫椂宸�",
+ "Title": "宸濆嵃闆舵椂宸�",
+ "Description": "宸濆嵃闆舵椂宸�",
"Version": "1.0.0",
-
+
"Contact": {
"Name": "",
-
+
"Email": "monksoul@outlook.com"
},
"License": {
"Name": "Apache-2.0"
-
+
}
}
]
diff --git a/cylsg/cylsg.Application/cylsg.Application.csproj b/cylsg/cylsg.Application/cylsg.Application.csproj
index 71a7b0e..75373a4 100644
--- a/cylsg/cylsg.Application/cylsg.Application.csproj
+++ b/cylsg/cylsg.Application/cylsg.Application.csproj
@@ -22,8 +22,13 @@
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\cylsg.Authorization\cylsg.Authorization.csproj" />
<ProjectReference Include="..\cylsg.Core\cylsg.Core.csproj" />
<ProjectReference Include="..\cylsg.Model\cylsg.Model.csproj" />
+ <ProjectReference Include="..\cylsg.redis\cylsg.redis.csproj" />
+ <ProjectReference Include="..\cylsg.utility\cylsg.utility.csproj" />
+ <ProjectReference Include="..\EzTencentCloud\EzTencentCloud.csproj" />
+ <ProjectReference Include="..\EzWechat\EzWechat.csproj" />
</ItemGroup>
<ItemGroup>
diff --git a/cylsg/cylsg.Application/cylsg.Application.xml b/cylsg/cylsg.Application/cylsg.Application.xml
index bc89ada..b9d8279 100644
--- a/cylsg/cylsg.Application/cylsg.Application.xml
+++ b/cylsg/cylsg.Application/cylsg.Application.xml
@@ -4,6 +4,64 @@
<name>cylsg.Application</name>
</assembly>
<members>
+ <member name="T:cylsg.Application.LogoIn">
+ <summary>
+ 鐧诲綍
+ </summary>
+ </member>
+ <member name="M:cylsg.Application.LogoIn.LogoinFast(System.String)">
+ <summary>
+ 蹇�熺櫥褰�
+ </summary>
+ <returns></returns>
+ </member>
+ <member name="M:cylsg.Application.LogoIn.CreateUser(cylsg.Application.UserInfoIn)">
+ <summary>
+ 娉ㄥ唽鐢ㄦ埛骞剁櫥褰�
+ </summary>
+ <param name="Param">logoinjscode</param>
+ <returns></returns>
+ </member>
+ <member name="T:cylsg.Application.UserInfoIn">
+ <summary>
+ 鍒涘缓鐢ㄦ埛妯″瀷
+ </summary>
+ </member>
+ <member name="M:cylsg.Application.UserInfoIn.#ctor">
+ <summary>
+ 鍒涘缓鐢ㄦ埛妯″瀷
+ </summary>
+ </member>
+ <member name="P:cylsg.Application.UserInfoIn.Avatar">
+ <summary>
+ 澶村儚
+ </summary>
+ </member>
+ <member name="P:cylsg.Application.UserInfoIn.Nickname">
+ <summary>
+ 鏄电О
+ </summary>
+ </member>
+ <member name="P:cylsg.Application.UserInfoIn.Phone">
+ <summary>
+ 鐢佃瘽
+ </summary>
+ </member>
+ <member name="P:cylsg.Application.UserInfoIn.Name">
+ <summary>
+ 鍚嶇О
+ </summary>
+ </member>
+ <member name="P:cylsg.Application.UserInfoIn.Bindgetphonenumber">
+ <summary>
+ 鎵嬫満鍙锋崲鍙栫爜
+ </summary>
+ </member>
+ <member name="P:cylsg.Application.UserInfoIn.JsCode">
+ <summary>
+ jscode
+ </summary>
+ </member>
<member name="T:cylsg.Application.SystemAppService">
<summary>
绯荤粺鏈嶅姟鎺ュ彛
diff --git a/cylsg/cylsg.Authorization/IEzAuthorizationService.cs b/cylsg/cylsg.Authorization/IEzAuthorizationService.cs
index 19e9986..fd2736b 100644
--- a/cylsg/cylsg.Authorization/IEzAuthorizationService.cs
+++ b/cylsg/cylsg.Authorization/IEzAuthorizationService.cs
@@ -12,7 +12,7 @@
public interface IEzAuthorizationService
{
TokenInfo CreateToken<T>(T jwt) where T : EzJwtModel;
- public Task<TokenInfo?> RefreshToken<T>(string refToken) where T : EzJwtModel;
+ Task<TokenInfo?> RefreshToken<T>(string refToken) where T : EzJwtModel;
}
diff --git a/cylsg/cylsg.Core/BaseModelBase.cs b/cylsg/cylsg.Core/BaseModelBase.cs
index c267d1d..2982fd3 100644
--- a/cylsg/cylsg.Core/BaseModelBase.cs
+++ b/cylsg/cylsg.Core/BaseModelBase.cs
@@ -17,25 +17,25 @@
/// 鍒涘缓鏃堕棿
/// </summary>
[Display(Name = "鍒涘缓鏃堕棿 ")]
- [SugarColumn(ColumnDescription = "鍒涘缓鏃堕棿 ")]
+ [SugarColumn(ColumnDescription = "鍒涘缓鏃堕棿 " , IsNullable = true)]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 鍒涘缓浜�
/// </summary>
[Display(Name = "鍒涘缓浜� ")]
- [SugarColumn(ColumnDescription = "鍒涘缓浜� ", ColumnDataType = "nvarchar(100)")]
+ [SugarColumn(ColumnDescription = "鍒涘缓浜� ", ColumnDataType = "nvarchar(100)", IsNullable = true)]
public string CreateBy { get; set; }
/// <summary>
/// 淇敼鏃堕棿
/// </summary>
[Display(Name = "淇敼鏃堕棿 ")]
- [SugarColumn(ColumnDescription = "淇敼鏃堕棿 ")]
+ [SugarColumn(ColumnDescription = "淇敼鏃堕棿 ", IsNullable = true)]
public DateTime? UpDataTime { get; set; }
/// <summary>
/// 淇敼浜�
/// </summary>
[Display(Name = "淇敼浜� ")]
- [SugarColumn(ColumnDescription = "淇敼浜� ", ColumnDataType = "nvarchar(100)")]
+ [SugarColumn(ColumnDescription = "淇敼浜� ", ColumnDataType = "nvarchar(100)", IsNullable = true)]
public string UpDataBy { get; set; }
diff --git a/cylsg/cylsg.Model/UserModel/User.cs b/cylsg/cylsg.Model/UserModel/User.cs
index bc6a074..739353a 100644
--- a/cylsg/cylsg.Model/UserModel/User.cs
+++ b/cylsg/cylsg.Model/UserModel/User.cs
@@ -15,7 +15,7 @@
/// </summary>
[Description("鐢ㄦ埛妯″瀷")]
[CoderFirst]
- public class User:BaseModelBase
+ public class User: BaseModel
{
/// <summary>
/// 鐢ㄦ埛Id
@@ -26,7 +26,7 @@
/// <summary>
/// 鐢佃瘽
/// </summary>
- [SugarColumn(ColumnDescription = "鐢佃瘽", ColumnDataType = "nvarchar(30)")]
+ [SugarColumn(ColumnDescription = "鐢佃瘽", ColumnDataType = "nvarchar(30)", IsNullable = true)]
public string Phone { get; set; }
/// <summary>
@@ -43,20 +43,25 @@
/// <summary>
/// 鏄电О
/// </summary>
- [SugarColumn(ColumnDescription = "鐢ㄦ埛ID", ColumnDataType = "nvarchar(100)")]
- public string Nickname { get; set; }
+ [SugarColumn(ColumnDescription = "鐢ㄦ埛ID", ColumnDataType = "nvarchar(100)", IsNullable = true)]
+ public string? Nickname { get; set; }
/// <summary>
/// 瀵嗙爜
/// </summary>
- [SugarColumn(ColumnDescription = "瀵嗙爜", ColumnDataType = "nvarchar(100)")]
- public string PassWord { get; set; }
+ [SugarColumn(ColumnDescription = "瀵嗙爜", ColumnDataType = "nvarchar(100)", IsNullable = true)]
+ public string? PassWord { get; set; }
/// <summary>
/// 澶村儚鍦板潃
/// </summary>
- [SugarColumn(ColumnDescription = "澶村儚鍦板潃", ColumnDataType = "nvarchar(500)")]
- public string Avatar { get; set; }
+ [SugarColumn(ColumnDescription = "澶村儚鍦板潃", ColumnDataType = "nvarchar(500)", IsNullable = true)]
+ public string? Avatar { get; set; }
+ /// <summary>
+ /// 寰俊WxOpenId
+ /// </summary>
+ [SugarColumn(ColumnDescription = "WxOpenId", ColumnDataType = "nvarchar(100)", IsNullable = true)]
+ public string? WxOpenId { get; set; }
}
}
diff --git a/cylsg/cylsg.Web.Core/Startup.cs b/cylsg/cylsg.Web.Core/Startup.cs
index 0737f0c..9bda758 100644
--- a/cylsg/cylsg.Web.Core/Startup.cs
+++ b/cylsg/cylsg.Web.Core/Startup.cs
@@ -7,6 +7,9 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SqlSugar;
+using System.Text.Encodings.Web;
+using System.Text.Json.Serialization;
+using System.Text.Unicode;
namespace cylsg.Web.Core;
@@ -25,7 +28,20 @@
return DbContext.Instance;
}
);
-
+ services.AddJsonOptions(options =>
+ {
+ //鏇存敼杈撳嚭杈撳叆鏋氫妇灞炴�т负 瀛楁鍚�
+ options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
+ //绌哄�间笉杈撳嚭json鏍煎紡
+ options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
+ options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
+ options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
+
+
+ // options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
+ // options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create();
+ });
+
services.AddControllersWithViews()
.AddInjectWithUnifyResult<EzCoreRESTFulResultProvider>();
}
diff --git a/cylsg/cylsg.Web.Entry/Properties/launchSettings.json b/cylsg/cylsg.Web.Entry/Properties/launchSettings.json
index 025cb44..f5c975c 100644
--- a/cylsg/cylsg.Web.Entry/Properties/launchSettings.json
+++ b/cylsg/cylsg.Web.Entry/Properties/launchSettings.json
@@ -3,7 +3,7 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
- "applicationUrl": "http://localhost:58595",
+ "applicationUrl": "http://127.0.0.1:58595",
"sslPort": 44326
}
},
@@ -19,7 +19,7 @@
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
- "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "applicationUrl": "http://0.0.0.0:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
diff --git a/cylsg/cylsg.Web.Entry/SingleFilePublish.cs b/cylsg/cylsg.Web.Entry/SingleFilePublish.cs
index 4e0f945..418785e 100644
--- a/cylsg/cylsg.Web.Entry/SingleFilePublish.cs
+++ b/cylsg/cylsg.Web.Entry/SingleFilePublish.cs
@@ -16,7 +16,10 @@
{
"cylsg.Application",
"cylsg.Core",
- "cylsg.Web.Core"
+ "cylsg.Web.Core",
+ "EzWechat",
+ "EzWechat",
+ "cylsg.redis"
};
}
}
\ No newline at end of file
diff --git a/cylsg/cylsg.Web.Entry/appsettings.json b/cylsg/cylsg.Web.Entry/appsettings.json
index 8f4963f..c9ec59a 100644
--- a/cylsg/cylsg.Web.Entry/appsettings.json
+++ b/cylsg/cylsg.Web.Entry/appsettings.json
@@ -24,6 +24,12 @@
],
+ "DynamicApiControllerSettings": {
+ "KeepName": true,
+ "KeepVerb": true,
+ "LowercaseRoute": false
+ },
+
"JWTSettings": {
"ValidateIssuerSigningKey": true, // 鏄惁楠岃瘉瀵嗛挜锛宐ool 绫诲瀷锛岄粯璁rue
"IssuerSigningKey": "129(*dasd09213)*(*jKDl65656656532jiohi", // 瀵嗛挜锛宻tring 绫诲瀷锛屽繀椤绘槸澶嶆潅瀵嗛挜锛岄暱搴﹀ぇ浜�16
diff --git a/cylsg/cylsg.Web.Entry/cylsg.Web.Entry.csproj b/cylsg/cylsg.Web.Entry/cylsg.Web.Entry.csproj
index f8a41c3..ecabffa 100644
--- a/cylsg/cylsg.Web.Entry/cylsg.Web.Entry.csproj
+++ b/cylsg/cylsg.Web.Entry/cylsg.Web.Entry.csproj
@@ -12,6 +12,7 @@
<ItemGroup>
<ProjectReference Include="..\cylsg.Web.Core\cylsg.Web.Core.csproj" />
+ <ProjectReference Include="..\EzWechat\EzWechat.csproj" />
</ItemGroup>
</Project>
diff --git a/cylsg/cylsg.redis/RedisConfig.json b/cylsg/cylsg.redis/RedisConfig.json
index f817c47..d4bb4aa 100644
--- a/cylsg/cylsg.redis/RedisConfig.json
+++ b/cylsg/cylsg.redis/RedisConfig.json
@@ -2,7 +2,7 @@
//璇蜂繚鎸乺edis涓烘甯稿彲鐢�
"RedisConfig": {
// 濡傛灉閲囩敤瀹瑰櫒鍖栭儴缃睸ervice 瑕佸啓鎴恟edis鐨勬湇鍔″悕锛屽惁鍒欏啓鍦板潃
- "ConnectionString": "127.0.0.1:6379,password=,connectTimeout=30000,responseTimeout=30000,abortConnect=false,connectRetry=1,syncTimeout=10000,DefaultDatabase=1" //redis鏁版嵁搴撹繛鎺ュ瓧绗︿覆
+ "ConnectionString": "127.0.0.1:6379,password=,connectTimeout=30000,responseTimeout=30000,abortConnect=false,connectRetry=1,syncTimeout=10000,DefaultDatabase=3" //redis鏁版嵁搴撹繛鎺ュ瓧绗︿覆
}
}
diff --git a/cylsg/cylsg.redis/cylsg.redis.csproj b/cylsg/cylsg.redis/cylsg.redis.csproj
index d71de94..10a89fc 100644
--- a/cylsg/cylsg.redis/cylsg.redis.csproj
+++ b/cylsg/cylsg.redis/cylsg.redis.csproj
@@ -14,4 +14,10 @@
<ProjectReference Include="..\cylsg.Core\cylsg.Core.csproj" />
</ItemGroup>
+ <ItemGroup>
+ <None Update="RedisConfig.json">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+
</Project>
diff --git a/cylsg/cylsg.sln b/cylsg/cylsg.sln
index bb4f5ca..963e45a 100644
--- a/cylsg/cylsg.sln
+++ b/cylsg/cylsg.sln
@@ -11,17 +11,21 @@
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cylsg.Web.Entry", "cylsg.Web.Entry\cylsg.Web.Entry.csproj", "{9826E365-EEE9-4721-A738-B02AB64D47E5}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cylsg.Model", "cylsg.Model\cylsg.Model.csproj", "{09E3AFC0-0975-4842-891F-9B5C78E12458}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cylsg.Model", "cylsg.Model\cylsg.Model.csproj", "{09E3AFC0-0975-4842-891F-9B5C78E12458}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cylsg.utility", "cylsg.utility\cylsg.utility.csproj", "{5ED2C481-2D74-43BC-ABAF-1455A052FAA4}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cylsg.utility", "cylsg.utility\cylsg.utility.csproj", "{5ED2C481-2D74-43BC-ABAF-1455A052FAA4}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EzWechat", "EzWechat\EzWechat.csproj", "{709CC927-07D3-4400-BD57-838A44B4FBD4}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EzWechat", "EzWechat\EzWechat.csproj", "{709CC927-07D3-4400-BD57-838A44B4FBD4}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cylsg.services", "cylsg.services\cylsg.services.csproj", "{28CCF771-A760-4191-B299-4E53B5B23D91}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cylsg.services", "cylsg.services\cylsg.services.csproj", "{28CCF771-A760-4191-B299-4E53B5B23D91}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cylsg.redis", "cylsg.redis\cylsg.redis.csproj", "{15042E77-32D5-46DE-9CE5-24D093C63422}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cylsg.redis", "cylsg.redis\cylsg.redis.csproj", "{15042E77-32D5-46DE-9CE5-24D093C63422}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cylsg.Authorization", "cylsg.Authorization\cylsg.Authorization.csproj", "{1197C9BB-C73D-42FB-A114-AFB0A7466615}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cylsg.Authorization", "cylsg.Authorization\cylsg.Authorization.csproj", "{1197C9BB-C73D-42FB-A114-AFB0A7466615}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EzTencentCloud", "EzTencentCloud\EzTencentCloud.csproj", "{8E2530EC-45FE-4EC6-A29A-1B8F25E0F94B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EzUpFile", "EzUpFile\EzUpFile.csproj", "{040F7EE0-B57B-4134-8538-20B9599FB898}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -69,6 +73,14 @@
{1197C9BB-C73D-42FB-A114-AFB0A7466615}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1197C9BB-C73D-42FB-A114-AFB0A7466615}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1197C9BB-C73D-42FB-A114-AFB0A7466615}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8E2530EC-45FE-4EC6-A29A-1B8F25E0F94B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8E2530EC-45FE-4EC6-A29A-1B8F25E0F94B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8E2530EC-45FE-4EC6-A29A-1B8F25E0F94B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8E2530EC-45FE-4EC6-A29A-1B8F25E0F94B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {040F7EE0-B57B-4134-8538-20B9599FB898}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {040F7EE0-B57B-4134-8538-20B9599FB898}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {040F7EE0-B57B-4134-8538-20B9599FB898}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {040F7EE0-B57B-4134-8538-20B9599FB898}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
--
Gitblit v1.9.1