1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using Common.system;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using XHWK.Model;
- using XHWK.WKTool.Config;
-
- 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 = ZConfig.apiUrl + "/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;
- }
- }
- }
- }
|