dispose.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. let count = 0; //接口完成数量
  2. import {
  3. parsingAuth
  4. } from "../../../utils/auth";
  5. let that = null;
  6. function loginMsg(account_list, _this, storage = true) {
  7. that = _this;
  8. if (storage) uni.setStorageSync("account_list", account_list);
  9. uni.setStorageSync("isAgreement", true);
  10. if (account_list.length == 1) {
  11. uni.setStorageSync('userMsg', account_list[0])
  12. query_userauth();
  13. // query_adspacelist();
  14. querySite_Parameter();
  15. querySite(that)
  16. } else {
  17. uni.navigateTo({
  18. url: '/pages/login/selectSite'
  19. })
  20. }
  21. }
  22. /* 获取用户权限 */
  23. function query_userauth() {
  24. that.$Http.basic({
  25. "classname": "sysmanage.develop.userauth.userauth",
  26. "method": "query_userauth",
  27. content: {
  28. nocache: true
  29. }
  30. }).then(res => {
  31. console.log("查询用户权限", res)
  32. if (res.msg != '成功') return uni.showToast({
  33. title: res.msg,
  34. icon: "none"
  35. });
  36. parsingAuth(res.data)
  37. count += 1;
  38. toHome();
  39. });
  40. }
  41. /* 查询站点数据 */
  42. function querySite_Parameter() {
  43. that.$Http.basic({
  44. "classname": "webmanage.site.site",
  45. "method": "querySite_Parameter", //查询站点数据
  46. "content": {}
  47. }).then(res => {
  48. console.log("查询站点配置", res)
  49. if (res.msg != '成功') return uni.showToast({
  50. title: res.msg,
  51. icon: "none"
  52. });
  53. uni.setStorageSync('siteP', res.data);
  54. count += 1;
  55. toHome();
  56. })
  57. }
  58. /* 查询站点数据 */
  59. function querySite(that) {
  60. that.$Http.basic({
  61. "classname": "webmanage.site.site",
  62. "method": "querySite",
  63. "content": {},
  64. }).then(res => {
  65. console.log("查询站点数据", res)
  66. if (res.msg != '成功') return uni.showToast({
  67. title: res.msg,
  68. icon: "none"
  69. });
  70. res.data.logo = res.data.attinfos.length ? that.getSpecifiedImage(res.data.attinfos.find(s => s.usetype == "actionlogo") || res.data.attinfos[0]) : ''
  71. uni.setStorageSync('site', res.data);
  72. count += 1;
  73. toHome();
  74. })
  75. }
  76. /* 查询轮播图 */
  77. function query_adspacelist() {
  78. that.$Http.basic({
  79. id: 20230608100802,
  80. "content": {}
  81. }).then(res => {
  82. console.log("查询轮播图", res)
  83. if (res.msg != '成功') return uni.showToast({
  84. title: res.msg,
  85. icon: "none"
  86. });
  87. uni.setStorageSync('banner_list', res.data)
  88. count += 1;
  89. toHome();
  90. })
  91. }
  92. function toHome() {
  93. if (count < 3) return;
  94. uni.reLaunch({
  95. url: '/pages/index/index',
  96. });
  97. count = 0;
  98. /* that.$Socket.initSocket()
  99. console.log("Socket", that.$Socket) */
  100. }
  101. /* 站点数据查询 */
  102. module.exports = {
  103. loginMsg,
  104. query_userauth
  105. }