From 595df5dac0a782bfdadab766b4dd62d326b0a383 Mon Sep 17 00:00:00 2001
From: 小飞侠 <8277136+liaoxujun@user.noreply.gitee.com>
Date: 星期二, 21 十月 2025 14:53:04 +0800
Subject: [PATCH] 增加川印设备维修回写
---
cylsg/cylsg.Application/LogoInController.cs | 35 +++++++++++++++++++++++------------
1 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/cylsg/cylsg.Application/LogoInController.cs b/cylsg/cylsg.Application/LogoInController.cs
index 6f00d81..0ee4cfd 100644
--- a/cylsg/cylsg.Application/LogoInController.cs
+++ b/cylsg/cylsg.Application/LogoInController.cs
@@ -1,6 +1,7 @@
锘縰sing cylsg.Authorization;
using cylsg.Core;
using cylsg.Model.UserModel;
+using cylsg.utility.Extend;
using EzWechat;
using System;
using System.Collections.Generic;
@@ -14,6 +15,7 @@
/// 鐧诲綍
/// </summary>
[DynamicApiController]
+ [ApiDescriptionSettings("Default@1")]
public class LogoIn
{
private readonly IWechatService _wechatService;
@@ -39,14 +41,14 @@
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("娌℃壘鍒扮敤鎴�,闇�瑕侀噸鏂版敞鍐岀櫥褰�");
}
var jwt = new EzJwtModel()
{
- ITCode = user.ItCode,
+ //ITCode = user.ItCode, 涓嶅湪鏄庢枃涓娇鐢↖tcode
NickName = user.Nickname,
UserID = user.Id,
@@ -76,34 +78,45 @@
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)
{
//娌℃湁鐢ㄦ埛 锛岄渶瑕佹柊寤虹敤鎴�
var phone = await _wechatService.GetPhone(Param.Bindgetphonenumber);
+
+ user = await UserRes.GetFirstAsync(x => x.ItCode == phone);
+ if(user == null) {
user = new User
{
Avatar = phone,
- Nickname = Param.Nickname,
+ Nickname = Param.Nickname??phone.PrivacyStr(),
name = Param.Name ?? phone,
Phone = phone,
ItCode = phone,
PassWord = "123456",
- WxAppId = opeid,
-
+ 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,
@@ -121,9 +134,7 @@
}
-
-
-
+
}
/// <summary>
--
Gitblit v1.9.1