移动系统liao
2024-08-15 d47565bee39818a5bed69696d151c018473f0f08
调整登录流程。完成登录测试,登录OK
7个文件已修改
54 ■■■■■ 已修改文件
cylsg/EzWechat/EzWechat.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/EzWechat/WechatService.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/cylsg.Application/LogoInController.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/cylsg.Application/cylsg.Application.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/cylsg.Core/BaseModelBase.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/cylsg.Model/UserModel/User.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/cylsg.sln 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/EzWechat/EzWechat.csproj
@@ -13,6 +13,7 @@
  <ItemGroup>
    <ProjectReference Include="..\cylsg.Core\cylsg.Core.csproj" />
    <ProjectReference Include="..\cylsg.redis\cylsg.redis.csproj" />
    <ProjectReference Include="..\cylsg.utility\cylsg.utility.csproj" />
  </ItemGroup>
  <ItemGroup>
cylsg/EzWechat/WechatService.cs
@@ -48,14 +48,15 @@
        public async Task<string> GetOpenID(string jscode)
        {
        
            var reques = new SnsComponentJsCode2SessionRequest()
            var reques = new SnsJsCode2SessionRequest()
            {
                AppId = App.Configuration["WechatAPP:AppId"],
               
              
                JsCode = jscode
            };
          var a= await _client.ExecuteSnsComponentJsCode2SessionAsync(reques);
          var a= await _client.ExecuteSnsJsCode2SessionAsync(reques);
            if(a.IsSuccessful())
            {
                return a.OpenId;
cylsg/cylsg.Application/LogoInController.cs
@@ -1,6 +1,7 @@
using cylsg.Authorization;
using cylsg.Core;
using cylsg.Model.UserModel;
using cylsg.utility.Extend;
using EzWechat;
using System;
using System.Collections.Generic;
@@ -39,7 +40,7 @@
            var UserRes = new BaseRepository<User>();
            var user = await UserRes.GetFirstAsync(x => x.WxAppId == opeid);
            var user = await UserRes.GetFirstAsync(x => x.WxOpenId == opeid);
            if (user == null)
            {
                throw Oops.Oh("没找到用户,需要重新注册登录");
@@ -76,7 +77,7 @@
            var UserRes = new BaseRepository<User>();
            var user = await UserRes.GetFirstAsync(x => x.WxAppId == opeid);
            var user = await UserRes.GetFirstAsync(x => x.WxOpenId == opeid);
            if (user == null)
            {
                //没有用户 ,需要新建用户
@@ -86,12 +87,12 @@
                {
                    Avatar = phone,
                    Nickname = Param.Nickname,
                    Nickname = Param.Nickname??phone.PrivacyStr(),
                    name = Param.Name ?? phone,
                    Phone = phone,
                    ItCode = phone,
                    PassWord = "123456",
                    WxAppId = opeid,
                    WxOpenId = opeid,
cylsg/cylsg.Application/cylsg.Application.csproj
@@ -26,6 +26,7 @@
        <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>
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 = "创建人 ", Length = 100)]
        [SugarColumn(ColumnDescription = "创建人 ", IsNullable = true, Length = 100)]
        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 = "修改人 ", Length = 100)]
        [SugarColumn(ColumnDescription = "修改人 ", IsNullable = true,Length = 100)]
        public string UpDataBy { get; set; }
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 = "电话")]
        [SugarColumn(ColumnDescription = "电话", IsNullable = true)]
        public string Phone { get; set; }
        /// <summary>
@@ -43,25 +43,25 @@
        /// <summary>
        /// 昵称
        /// </summary>
        [SugarColumn(ColumnDescription = "昵称", Length = 100)]
        public string Nickname { get; set; }
        [SugarColumn(ColumnDescription = "昵称", Length = 100, IsNullable =true)]
        public string? Nickname { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [SugarColumn(ColumnDescription = "密码", Length = 100)]
        public string PassWord { get; set; }
        [SugarColumn(ColumnDescription = "密码", Length = 100,IsNullable = true)]
        public string? PassWord { get; set; }
        /// <summary>
        /// 头像地址
        /// </summary>
        [SugarColumn(ColumnDescription = "头像地址")]
        public string Avatar { get; set; }
        [SugarColumn(ColumnDescription = "头像地址" ,IsNullable =true)]
        public string? Avatar { get; set; }
        /// <summary>
        /// 微信APPID
        /// 微信WxOpenId
        /// </summary>
        [SugarColumn(ColumnDescription = "WxAppId",Length =30)]
        public string?  WxAppId { get; set; }
        [SugarColumn(ColumnDescription = "WxOpenId", Length =100,IsNullable = true)]
        public string?  WxOpenId { get; set; }
    }
}
cylsg/cylsg.sln
@@ -25,6 +25,8 @@
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
        Debug|Any CPU = Debug|Any CPU
@@ -75,6 +77,10 @@
        {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