index.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import request from './request'
  2. import qs from 'qs'
  3. import { Base64 } from 'js-base64'
  4. import store from '@/store'
  5. /**
  6. * 公共接口-登录接口获取token
  7. */
  8. export function authorizeLogin(data) {
  9. return request({
  10. url: ` /ubms-foreign/authorize/login`,
  11. method: 'post',
  12. data: qs.stringify(data),
  13. })
  14. }
  15. /**
  16. * 公共接口-刷新token
  17. */
  18. export function oauthToken(data) {
  19. return request({
  20. url: `/ubms-foreign/oauth/token`,
  21. method: 'post',
  22. data: qs.stringify(data),
  23. })
  24. }
  25. /**
  26. * 物业公告-通知列表
  27. */
  28. export function findManagementNoticePage(data) {
  29. return request({
  30. url: `/ubms-foreign/base/managementnotice/foreignFindManagementNoticePage`,
  31. method: 'post',
  32. data,
  33. })
  34. }
  35. /**
  36. * 物业公告-通知详情
  37. */
  38. export function findNoticeById(data) {
  39. return request({
  40. url: `/ubms-foreign/base/managementnotice/foreignFindNoticeById`,
  41. method: 'post',
  42. data,
  43. })
  44. }
  45. /**
  46. * 获取服务地址-积余访客zsjy(只用在招商积余大厦项目上)
  47. * 唯一编码:code=th_va
  48. */
  49. export function getAuthorVisitorJumpAddress(page = 'home') {
  50. const userInfo = store.state.userInfo
  51. const origin = 'https://zsjy-txmobile.cmpo1914.com:8443'
  52. const pagePathMap = {
  53. home: {
  54. serviceName: '积余访客zsjy', // 操作权限 - 用户只需登录
  55. jumpPath: 'pages/vistorInviteOrBook/vistorInviteOrBook',
  56. jumpAddress: `${origin}/#/pages/vistorInviteOrBook/vistorInviteOrBook?loginToken=${Base64.encode(
  57. userInfo.userMobile,
  58. )}`,
  59. },
  60. detail: {
  61. serviceName: '访客预约详情页', // 操作权限 - 用户只需登录
  62. description: '访客预约详情页(短信跳转)',
  63. jumpPath: 'pages/visiotrAppointment/toUpload/toUpload',
  64. jumpAddress: `${origin}/#/pages/visiotrAppointment/toUpload/toUpload/?loginToken=${Base64.encode(
  65. userInfo.userMobile,
  66. )}&id={id}`,
  67. },
  68. approval: {
  69. serviceName: '被访人审核页面', // 操作权限 - 用户只需登录
  70. description: '被访人审核页面(短信跳转)',
  71. jumpPath: 'pages/visiotrAppointmentApproval/approval/approval',
  72. jumpAddress: `${origin}/#/pages/visiotrAppointmentApproval/approval/approval/?loginToken=${Base64.encode(
  73. userInfo.userMobile,
  74. )}&id={id}&type=detail`,
  75. },
  76. }
  77. let current = pagePathMap[page] || pagePathMap['home']
  78. const result = current.jumpAddress
  79. return result
  80. }
  81. /**
  82. * 获取服务地址-访客预约(兰溪谷一期)
  83. * @description
  84. * 唯一编码:code=th_applet
  85. */
  86. export function getWeChatAppletJumpAddress(page = 'home') {
  87. const userInfo = store.state.userInfo
  88. const origin = 'https://ai-cmty.cmsk1979.com/applet'
  89. const pagePathMap = {
  90. home: {
  91. serviceName: '访客预约', // 操作权限 - 用户只需登录
  92. jumpPath: '/',
  93. jumpAddress: `${origin}/#/pages/visitor/temp_visitor_register/temp_visitor_register?projectId=14cffa4b73a74572&wechatId=${userInfo.openid}`,
  94. },
  95. }
  96. let current = pagePathMap[page]
  97. const result = current.jumpAddress
  98. return result
  99. }
  100. export default {
  101. authorizeLogin,
  102. oauthToken,
  103. findManagementNoticePage,
  104. findNoticeById,
  105. getAuthorVisitorJumpAddress,
  106. getWeChatAppletJumpAddress,
  107. }