dispose.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. } else {
  16. uni.navigateTo({
  17. url: '/pages/login/selectSite'
  18. })
  19. }
  20. }
  21. /* 获取用户权限 */
  22. function query_userauth() {
  23. that.$Http.basic({
  24. "classname": "sysmanage.develop.userauth.userauth",
  25. "method": "query_userauth",
  26. content: {
  27. nocache: true
  28. }
  29. }).then(res => {
  30. console.log("查询用户权限", res)
  31. if (res.msg != '成功') return uni.showToast({
  32. title: res.msg,
  33. icon: "none"
  34. });
  35. parsingAuth(res.data)
  36. count += 1;
  37. toHome();
  38. });
  39. }
  40. /* 查询站点数据 */
  41. function querySite_Parameter() {
  42. that.$Http.basic({
  43. "classname": "webmanage.site.site",
  44. "method": "querySite_Parameter", //查询站点数据
  45. "content": {}
  46. }).then(res => {
  47. console.log("查询站点数据", res)
  48. if (res.msg != '成功') return uni.showToast({
  49. title: res.msg,
  50. icon: "none"
  51. });
  52. uni.setStorageSync('siteP', res.data);
  53. count += 1;
  54. toHome();
  55. })
  56. }
  57. /* 查询轮播图 */
  58. function query_adspacelist() {
  59. that.$Http.basic({
  60. id: 20230608100802,
  61. "content": {}
  62. }).then(res => {
  63. console.log("查询轮播图", res)
  64. if (res.msg != '成功') return uni.showToast({
  65. title: res.msg,
  66. icon: "none"
  67. });
  68. uni.setStorageSync('banner_list', res.data)
  69. count += 1;
  70. toHome();
  71. })
  72. }
  73. function toHome() {
  74. if (count < 2) return;
  75. uni.reLaunch({
  76. url: '/pages/index/index',
  77. });
  78. count = 0;
  79. /* that.$Socket.initSocket()
  80. console.log("Socket", that.$Socket) */
  81. }
  82. /* 站点数据查询 */
  83. module.exports = {
  84. loginMsg,
  85. query_userauth
  86. }