适配登录方式传送机制

This commit is contained in:
dathlin
2017-07-24 20:54:40 +08:00
parent 417dc64fa7
commit 4fc472fced
5 changed files with 13 additions and 5 deletions

View File

@@ -72,6 +72,10 @@ namespace CommonLibrary
/// </summary> /// </summary>
public static string PasswordText { get { return "Password"; } } public static string PasswordText { get { return "Password"; } }
/// <summary> /// <summary>
/// 用于存储和传送的名称
/// </summary>
public static string LoginWayText { get { return "LoginWay"; } }
/// <summary>
/// 深度拷贝当前的账户信息 /// 深度拷贝当前的账户信息
/// </summary> /// </summary>
/// <typeparam name="T">返回的类型,应该为继承后的类型</typeparam> /// <typeparam name="T">返回的类型,应该为继承后的类型</typeparam>

View File

@@ -147,7 +147,8 @@ namespace 软件系统客户端Wpf
JObject json = new JObject JObject json = new JObject
{ {
{ UserAccount.UserNameText, new JValue(UserName) }, { UserAccount.UserNameText, new JValue(UserName) },
{ UserAccount.PasswordText, new JValue(UserPassword) } { UserAccount.PasswordText, new JValue(UserPassword) },
{ UserAccount.LoginWayText, new JValue("wpf") }
}; };
result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode., json.ToString()); result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode., json.ToString());
if (result.IsSuccess) if (result.IsSuccess)

View File

@@ -209,8 +209,9 @@ namespace 软件系统客户端模版
//包装数据 //包装数据
JObject json = new JObject JObject json = new JObject
{ {
{ UserAccount.UserNameText, new Newtonsoft.Json.Linq.JValue(textBox_userName.Text) }, { UserAccount.UserNameText, new JValue(textBox_userName.Text) },
{ UserAccount.PasswordText, new Newtonsoft.Json.Linq.JValue(textBox_password.Text) } { UserAccount.PasswordText, new JValue(textBox_password.Text) },
{ UserAccount.LoginWayText, new JValue("winform") }
}; };
result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode., json.ToString()); result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode., json.ToString());
if (result.IsSuccess) if (result.IsSuccess)

View File

@@ -496,8 +496,9 @@ namespace 软件系统服务端模版
//提取账户,密码 //提取账户,密码
string name = SoftBasic.GetValueFromJsonObject(json, UserAccount.UserNameText, ""); string name = SoftBasic.GetValueFromJsonObject(json, UserAccount.UserNameText, "");
string password = SoftBasic.GetValueFromJsonObject(json, UserAccount.PasswordText, ""); string password = SoftBasic.GetValueFromJsonObject(json, UserAccount.PasswordText, "");
string way = SoftBasic.GetValueFromJsonObject(json, UserAccount.LoginWayText, "winform");
UserAccount account = UserServer.ServerAccounts.CheckAccount(name, password, state.GetRemoteEndPoint().Address.ToString()); UserAccount account = UserServer.ServerAccounts.CheckAccount(name, password, state.GetRemoteEndPoint().Address.ToString(), way);
//检测是否重复登录 //检测是否重复登录
if(account.LoginEnable) if(account.LoginEnable)
{ {

View File

@@ -58,7 +58,8 @@ namespace 软件系统浏览器模版.Controllers
JObject json = new JObject JObject json = new JObject
{ {
{ UserAccount.UserNameText, new JValue(fc["UserName"]) }, { UserAccount.UserNameText, new JValue(fc["UserName"]) },
{ UserAccount.PasswordText, new JValue(fc["UserPassword"]) } { UserAccount.PasswordText, new JValue(fc["UserPassword"]) },
{ UserAccount.LoginWayText, new JValue("webApp") }
}; };
result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode., json.ToString()); result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode., json.ToString());
if (result.IsSuccess) if (result.IsSuccess)