官网 管理后台
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.

index.js 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. jQuery.extend({
  2. baseUrl: "//xhwebapitest.xhkjedu.com/",
  3. showImageUrl: "//xhwebstatictest.xhkjedu.com/",
  4. //毫秒时间转换为yyyy-MM-dd
  5. msToDateString: function (ms) {
  6. let date = new Date(ms);
  7. let year = date.getFullYear();
  8. let month = date.getMonth() + 1;
  9. let day = date.getDate();
  10. if (month < 10) {
  11. month = "0" + month;
  12. }
  13. if (day < 10) {
  14. day = "0" + day;
  15. }
  16. return year + "-" + month + "-" + day;
  17. },
  18. // 秒时间转换为yyyy-MM-dd HH:mm:ss
  19. dateFormat: function(unixtimestamp) {
  20. unixtimestamp = new Date(unixtimestamp * 1000);
  21. let year = 1900 + unixtimestamp.getYear();
  22. let month = "0" + (unixtimestamp.getMonth() + 1);
  23. let date = "0" + unixtimestamp.getDate();
  24. let hour = "0" + unixtimestamp.getHours();
  25. let minute = "0" + unixtimestamp.getMinutes();
  26. let second = "0" + unixtimestamp.getSeconds();
  27. return (
  28. year +
  29. "-" +
  30. month.substring(month.length - 2, month.length) +
  31. "-" +
  32. date.substring(date.length - 2, date.length) +
  33. " " +
  34. hour.substring(hour.length - 2, hour.length) +
  35. ":" +
  36. minute.substring(minute.length - 2, minute.length) +
  37. ":" +
  38. second.substring(second.length - 2, second.length)
  39. );
  40. },
  41. // 读取url参数
  42. getQueryletiable: function(letiable) {
  43. let query = window.location.search.substring(1);
  44. query = decodeURI(query);
  45. let lets = query.split("&");
  46. for (let i = 0; i < lets.length; i++) {
  47. let pair = lets[i].split("=");
  48. if (pair[0] === letiable) {
  49. return pair[1];
  50. }
  51. }
  52. return false;
  53. },
  54. userInfo: JSON.parse(localStorage.getItem("xhWebAdminUser")) || {},
  55. isLogin: function () {
  56. let xhWebAdminUser = JSON.parse(localStorage.getItem("xhWebAdminUser"));
  57. return xhWebAdminUser ? true : false;
  58. }
  59. });