移动系统liao
2024-09-24 72e71a7a31b14f30f38a2a3acecb7311049c608a
cylsg/cylsg.Application/LogoInController.cs
@@ -15,6 +15,7 @@
    /// 登录
    /// </summary>
    [DynamicApiController]
    [ApiDescriptionSettings("Default@1")]
    public class LogoIn
    {
        private readonly IWechatService _wechatService;
@@ -47,7 +48,7 @@
            }
            var jwt = new EzJwtModel()
            {
                ITCode = user.ItCode,
                //ITCode = user.ItCode, 不在明文中使用Itcode
                NickName = user.Nickname,
                UserID = user.Id,
@@ -83,6 +84,9 @@
                //没有用户 ,需要新建用户
                var phone = await _wechatService.GetPhone(Param.Bindgetphonenumber);
                 user = await UserRes.GetFirstAsync(x => x.ItCode == phone);
                if(user == null) {
                user = new User
                {
@@ -93,18 +97,25 @@
                    ItCode = phone,
                    PassWord = "123456",
                    WxOpenId = opeid,
                    CreateBy="微信注册登录",
                    CreateTime = DateTime.UtcNow,
                };
                await UserRes.EzInsertAsync(user);
              user=    await UserRes.InsertReturnEntityAsync(user);
                }
                else
                {
                    user.WxOpenId = opeid;
                    await UserRes.EzUpdateAsync(user);
                }
            }
            var jwt = new EzJwtModel()
            {
                ITCode = user.ItCode,
               // ITCode = user.ItCode,
                NickName = user.Nickname,
                UserID = user.Id,
@@ -122,9 +133,7 @@
        }
    }
    /// <summary>