|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- 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");
- /// <summary>
- /// 登陆
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- public int Login(string loginname, string loginpwd)
- {
- string url = APIRequestAddress + "/user/login";//地址
- Dictionary<string, object> dic = new Dictionary<string, object>
- {
- { "loginname", loginname},
- { "loginpwd", loginpwd}
- };
- string body = JsonHelper.ToJson(dic);
- ResultVo<Model_UserInfo> result = HttpHelper.PostAndRespSignle<ResultVo<Model_UserInfo>>(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;
- }
- }
- }
- }
|