店铺考核提供备注功能 微信带货助手采集功能
This commit is contained in:
1 parent
4fa1fc03ca
commit
119b2f4f3e
64 files changed
+7940
-908
No files matched your search
@@ -63,50 +63,70 @@ namespace KJD_Web.BLL.WXXD
|
||||
+ mobile + "' and u.password='" + password + "'";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
UserLoginResultParam user = new UserLoginResultParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
user_name = row["user_name"].ToString(),
|
||||
nick_name = row["nick_name"].ToString(),
|
||||
mobile = row["user_name"].ToString(),
|
||||
password = row["password"].ToString(),
|
||||
group_id = row["group_id"].ToString(),
|
||||
card_id = row["card_id"].ToString(),
|
||||
company_name = row["company_name"].ToString(),
|
||||
is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0,
|
||||
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
|
||||
authority = row.Table.Columns.Contains("authority") ? row["authority"].ParseToString() : "",
|
||||
points = row.Table.Columns.Contains("points") ? row["points"].ParseToInt() : 0,
|
||||
};
|
||||
var main_authority = row.Table.Columns.Contains("main_authority") ? row["main_authority"].ParseToString() : "";
|
||||
// 子账号积分用户权限跟随
|
||||
if (user.group_id != "3")
|
||||
{
|
||||
var userAuthLst = user.authority.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||
if (!main_authority.Contains("积分用户"))
|
||||
{
|
||||
userAuthLst.Remove("积分用户");
|
||||
user.authority = string.Join(",", userAuthLst);
|
||||
}
|
||||
else if (!user.authority.Contains("积分用户"))
|
||||
{
|
||||
user.authority = (user.authority + "," + "积分用户").Trim(',');
|
||||
}
|
||||
}
|
||||
if (string.IsNullOrEmpty(user.company_name))
|
||||
{
|
||||
user.company_name = "-";
|
||||
}
|
||||
var data = JsonUtils.SerializeObjectToString(user);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
return "{\"code\":1,\"msg\":\"用户名或密码错误\"}";
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
|
||||
if (dt == null)
|
||||
dt = new DataTable();
|
||||
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
UserLoginResultParam user = new UserLoginResultParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
user_name = row["user_name"].ToString(),
|
||||
nick_name = row["nick_name"].ToString(),
|
||||
mobile = row["user_name"].ToString(),
|
||||
password = row["password"].ToString(),
|
||||
group_id = row["group_id"].ToString(),
|
||||
card_id = row["card_id"].ToString(),
|
||||
company_name = row["company_name"].ToString(),
|
||||
is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0,
|
||||
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
|
||||
authority = row.Table.Columns.Contains("authority") ? row["authority"].ParseToString() : "",
|
||||
parent_user_name = row["parent_user_name"].ToString(),
|
||||
points = row.Table.Columns.Contains("points") ? row["points"].ParseToInt() : 0,
|
||||
};
|
||||
var main_authority = row.Table.Columns.Contains("main_authority") ? row["main_authority"].ParseToString() : "";
|
||||
// 子账号积分用户权限跟随
|
||||
if (user.group_id != "3")
|
||||
{
|
||||
var userAuthLst = user.authority.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||
if (!main_authority.Contains("积分用户"))
|
||||
{
|
||||
userAuthLst.Remove("积分用户");
|
||||
user.authority = string.Join(",", userAuthLst);
|
||||
}
|
||||
else if (!user.authority.Contains("积分用户"))
|
||||
{
|
||||
user.authority = (user.authority + "," + "积分用户").Trim(',');
|
||||
}
|
||||
}
|
||||
if (string.IsNullOrEmpty(user.company_name))
|
||||
{
|
||||
user.company_name = "-";
|
||||
}
|
||||
if (user.group_id != "3" && !string.IsNullOrEmpty(user.parent_user_name))
|
||||
{
|
||||
sql = "select authority from wxxd.user where user_name='" + user.parent_user_name + "'";
|
||||
var rst = mySql.ExecuteFirst(sql);
|
||||
if (mySql.Message.IsNullOrEmpty())
|
||||
{
|
||||
user.parent_authority = rst;
|
||||
}
|
||||
}
|
||||
|
||||
var data = JsonUtils.SerializeObjectToString(user);
|
||||
|
||||
mySql.Close();
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
mySql.Close();
|
||||
return "{\"code\":1,\"msg\":\"用户名或密码错误\"}";
|
||||
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
@@ -652,6 +672,67 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
}
|
||||
|
||||
public string UpdateWxSaleAssistantCookie(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var id = (RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'")).ParseToInt();
|
||||
if (id == 0)
|
||||
id = 1;
|
||||
var cookie = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cookie"))?.Replace("'", "\\'");
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "update wxxd.wx_sale_assistant_user set cookie='" + cookie + "' WHERE id=" + id + ";";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst && string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string GetWxSaleAssistantCookie(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var id = (RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'")).ParseToInt();
|
||||
if (id == 0)
|
||||
id = 1;
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select cookie from wxxd.wx_sale_assistant_user WHERE id=" + id + ";";
|
||||
|
||||
var rst = mySql.ExecuteDataTableRow(sql);
|
||||
mySql.Close();
|
||||
if (string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":200,\"cookie\":" + rst["cookie"] + "}";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// temu退回包裹的密钥
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user