using Common.system; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using XHWK.Model; namespace XHWK.WKTool.DAL { public class Interface { string APIRequestAddress = FileToolsCommon.GetConfigValue("APIRequestAddress"); string FileRequestAddress = FileToolsCommon.GetConfigValue("FileRequestAddress"); string schoolfileRequestAddress = FileToolsCommon.GetConfigValue("schoolfileRequestAddress"); /// /// 登陆 /// /// /// public int Login(string loginname, string loginpwd) { string url = APIRequestAddress + "/user/login";//地址 Dictionary dic = new Dictionary { { "loginname", loginname}, { "loginpwd", loginpwd} }; string body = JsonHelper.ToJson(dic); ResultVo result = HttpHelper.PostAndRespSignle>(url, postData: body); if (result != null) { APP.UserInfo = new Model_UserInfo(); APP.ServerMsg = result.msg; APP.UserInfo = result.obj; return result.code; } else { APP.ServerMsg = "网络异常!"; APP.UserInfo =new Model_UserInfo(); return 1; } } } }