common.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. import request from "@/utils/request"
  2. // 刷新令牌
  3. export const refreshToken = (refreshToken) => {
  4. return request({
  5. url: '/app-api/menduner/system/auth/refresh-token',
  6. method: "POST",
  7. params: {
  8. refreshToken
  9. },
  10. custom: {
  11. showLoading: false,
  12. showError: false
  13. }
  14. })
  15. }
  16. // 发送手机验证码
  17. export const sendSmsCode = (data) => {
  18. return request({
  19. url: '/app-api/menduner/system/auth/send-sms-code',
  20. method: "POST",
  21. data,
  22. custom: {
  23. loadingMsg: '发送中',
  24. showSuccess: true,
  25. successMsg: '发送成功'
  26. }
  27. })
  28. }
  29. // 短信登录
  30. export const smsLogin = (data) => {
  31. return request({
  32. url: '/app-api/menduner/system/auth/sms-login',
  33. method: 'POST',
  34. data,
  35. custom: {
  36. showLoading: false
  37. }
  38. })
  39. }
  40. // 密码登录
  41. export const passwordLogin = (data) => {
  42. return request({
  43. url: '/app-api/menduner/system/auth/login',
  44. method: 'POST',
  45. data,
  46. custom: {
  47. showLoading: false
  48. }
  49. })
  50. }
  51. // 退出登录
  52. export const logout = () => {
  53. return request({
  54. url: '/app-api/menduner/system/auth/logout',
  55. method: 'POST',
  56. custom: {
  57. showLoading: false,
  58. auth: true
  59. }
  60. })
  61. }
  62. // 字典
  63. export const getDictData = (params) => {
  64. return request({
  65. url: '/app-api/system/dict-data/type',
  66. method: 'GET',
  67. params,
  68. custom: {
  69. showLoading: false,
  70. auth: false
  71. }
  72. })
  73. }
  74. // 获取行业列表
  75. export const getIndustryListData = (params) => {
  76. return request({
  77. url: '/app-api/menduner/system/industry/list',
  78. method: 'GET',
  79. params,
  80. custom: {
  81. showLoading: false,
  82. auth: false
  83. }
  84. })
  85. }
  86. // 获取技能列表
  87. export const getSkillList = () => {
  88. return request({
  89. url: '/app-api/menduner/system/skill/list',
  90. method: 'GET',
  91. custom: {
  92. showLoading: false,
  93. auth: false
  94. }
  95. })
  96. }
  97. // 获取行业树形
  98. export const getIndustryTreeData = (params) => {
  99. return request({
  100. url: '/app-api/menduner/system/industry/get/tree',
  101. method: 'GET',
  102. params,
  103. custom: {
  104. showLoading: false,
  105. auth: false
  106. }
  107. })
  108. }
  109. // 获取地区列表
  110. export const getAreaListData = (params) => {
  111. return request({
  112. url: '/app-api/menduner/system/area/list',
  113. method: 'GET',
  114. params,
  115. custom: {
  116. showLoading: false,
  117. auth: false
  118. }
  119. })
  120. }
  121. // 获取地区获取地区map
  122. export const getAreaMapData = (params) => {
  123. return request({
  124. url: '/app-api/menduner/system/area/map',
  125. method: 'GET',
  126. params,
  127. custom: {
  128. showLoading: false,
  129. auth: false
  130. }
  131. })
  132. }
  133. // 获得职位类型
  134. export const getPositionTreeData = (params) => {
  135. return request({
  136. url: '/app-api/menduner/system/position/get/tree',
  137. method: 'GET',
  138. params,
  139. custom: {
  140. showLoading: false,
  141. auth: false
  142. }
  143. })
  144. }
  145. // 获取职位列表
  146. export const getPositionData = (params) => {
  147. return request({
  148. url: '/app-api/menduner/system/position/list',
  149. method: 'GET',
  150. params,
  151. custom: {
  152. showLoading: false,
  153. auth: false
  154. }
  155. })
  156. }
  157. // 获取区域树形
  158. export const getAreaTreeData = () => {
  159. return request({
  160. url: '/app-api/menduner/system/area/get/tree',
  161. method: 'GET',
  162. custom: {
  163. showLoading: false,
  164. auth: false
  165. }
  166. })
  167. }
  168. // 同步最近会话
  169. export const getConversationSync = async (data) => {
  170. return request({
  171. url: '/app-api/im/conversation/sync',
  172. method: 'POST',
  173. data,
  174. custom: {
  175. showLoading: false,
  176. auth: true
  177. }
  178. })
  179. }
  180. // 获取聊天秘钥信息
  181. export const getChatKey = async (data) => {
  182. return request({
  183. url: '/app-api/im/user/get',
  184. method: 'POST',
  185. data,
  186. custom: {
  187. showLoading: false,
  188. auth: true
  189. }
  190. })
  191. }
  192. // 同步最近会话
  193. export const getMessageSync = async (data) => {
  194. return request({
  195. url: '/app-api/im/im/channel/messagesync',
  196. method: 'POST',
  197. data,
  198. custom: {
  199. showLoading: false,
  200. auth: true
  201. }
  202. })
  203. }
  204. // 设置最近会话未读数量
  205. export const setUnread = async (data) => {
  206. return request({
  207. url: '/app-api/im/conversations/setUnread',
  208. method: 'POST',
  209. data,
  210. custom: {
  211. showLoading: false,
  212. auth: true
  213. }
  214. })
  215. }
  216. // 设置最近会话未读数量
  217. export const deleteConversation = async (data) => {
  218. return request({
  219. url: '/app-api/im/conversation/delete',
  220. method: 'POST',
  221. data,
  222. custom: {
  223. showLoading: false,
  224. auth: true
  225. }
  226. })
  227. }
  228. // 求职端-根据邀请人id获取面试邀约列表
  229. export const getInterviewInviteListByInviteUserId = async (inviteUserId) => {
  230. return request({
  231. url: `/app-api/menduner/system/interview-invite/get/list/by/${inviteUserId}`,
  232. method: 'GET',
  233. custom: {
  234. showLoading: false,
  235. auth: true
  236. }
  237. })
  238. }