星火微课系统客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Common.system;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using XHWK.Model;
  8. namespace XHWK.WKTool.DAL
  9. {
  10. public class Interface
  11. {
  12. /// <summary>
  13. /// 登陆
  14. /// </summary>
  15. /// <param name="request"></param>
  16. /// <returns></returns>
  17. public int Login(string loginname, string loginpwd)
  18. {
  19. string url = "http://schoolapi.xhkjedu.com/user/login";//地址
  20. Dictionary<string, object> dic = new Dictionary<string, object>
  21. {
  22. { "loginname", loginname},
  23. { "loginpwd", loginpwd}
  24. };
  25. string body = JsonHelper.ToJson(dic);
  26. ResultVo<Model_UserInfo> result = HttpHelper.PostAndRespSignle<ResultVo<Model_UserInfo>>(url, postData: body);
  27. if (result != null)
  28. {
  29. APP.UserInfo = new Model_UserInfo();
  30. APP.ServerMsg = result.msg;
  31. APP.UserInfo = result.obj;
  32. return result.code;
  33. }
  34. else
  35. {
  36. APP.ServerMsg = "网络异常!";
  37. APP.UserInfo =new Model_UserInfo();
  38. return 1;
  39. }
  40. }
  41. }
  42. }