common.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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 userRegister = (data) => {
  42. return request({
  43. url: '/app-api/menduner/system/auth/register',
  44. method: 'POST',
  45. data,
  46. custom: {
  47. showLoading: false
  48. }
  49. })
  50. }
  51. // 密码登录
  52. export const passwordLogin = (data) => {
  53. return request({
  54. url: '/app-api/menduner/system/auth/login',
  55. method: 'POST',
  56. data,
  57. custom: {
  58. showLoading: false
  59. }
  60. })
  61. }
  62. // 退出登录
  63. export const logout = () => {
  64. return request({
  65. url: '/app-api/menduner/system/auth/logout',
  66. method: 'POST',
  67. custom: {
  68. showLoading: false,
  69. auth: true
  70. }
  71. })
  72. }
  73. // 字典
  74. export const getDictData = (params) => {
  75. return request({
  76. url: '/app-api/system/dict-data/type',
  77. method: 'GET',
  78. params,
  79. custom: {
  80. showLoading: false,
  81. auth: false
  82. }
  83. })
  84. }
  85. // 获取行业列表
  86. export const getIndustryListData = (params) => {
  87. return request({
  88. url: '/app-api/menduner/system/industry/list',
  89. method: 'GET',
  90. params,
  91. custom: {
  92. showLoading: false,
  93. auth: false
  94. }
  95. })
  96. }
  97. // 获取技能列表
  98. export const getSkillList = () => {
  99. return request({
  100. url: '/app-api/menduner/system/skill/list',
  101. method: 'GET',
  102. custom: {
  103. showLoading: false,
  104. auth: false
  105. }
  106. })
  107. }
  108. // 获取行业树形
  109. export const getIndustryTreeData = (params) => {
  110. return request({
  111. url: '/app-api/menduner/system/industry/get/tree',
  112. method: 'GET',
  113. params,
  114. custom: {
  115. showLoading: false,
  116. auth: false
  117. }
  118. })
  119. }
  120. // 获取地区列表
  121. export const getAreaListData = (params) => {
  122. return request({
  123. url: '/app-api/menduner/system/area/list',
  124. method: 'GET',
  125. params,
  126. custom: {
  127. showLoading: false,
  128. auth: false
  129. }
  130. })
  131. }
  132. // 获取地区获取地区map
  133. export const getAreaMapData = (params) => {
  134. return request({
  135. url: '/app-api/menduner/system/area/map',
  136. method: 'GET',
  137. params,
  138. custom: {
  139. showLoading: false,
  140. auth: false
  141. }
  142. })
  143. }
  144. // 获得职位类型
  145. export const getPositionTreeData = (params) => {
  146. return request({
  147. url: '/app-api/menduner/system/position/get/tree',
  148. method: 'GET',
  149. params,
  150. custom: {
  151. showLoading: false,
  152. auth: false
  153. }
  154. })
  155. }
  156. // 获取职位列表
  157. export const getPositionData = (params) => {
  158. return request({
  159. url: '/app-api/menduner/system/position/list',
  160. method: 'GET',
  161. params,
  162. custom: {
  163. showLoading: false,
  164. auth: false
  165. }
  166. })
  167. }
  168. // 获取区域树形
  169. export const getAreaTreeData = () => {
  170. return request({
  171. url: '/app-api/menduner/system/area/get/tree',
  172. method: 'GET',
  173. custom: {
  174. showLoading: false,
  175. auth: false
  176. }
  177. })
  178. }
  179. // 同步最近会话
  180. export const getConversationSync = async (data) => {
  181. return request({
  182. url: '/app-api/im/conversation/sync',
  183. method: 'POST',
  184. data,
  185. custom: {
  186. showLoading: false,
  187. auth: true
  188. }
  189. })
  190. }
  191. // 获取聊天秘钥信息
  192. export const getChatKey = async (data) => {
  193. return request({
  194. url: '/app-api/im/user/get',
  195. method: 'POST',
  196. data,
  197. custom: {
  198. showLoading: false,
  199. auth: true
  200. }
  201. })
  202. }
  203. // 同步最近会话
  204. export const getMessageSync = async (data) => {
  205. return request({
  206. url: '/app-api/im/im/channel/messagesync',
  207. method: 'POST',
  208. data,
  209. custom: {
  210. showLoading: false,
  211. auth: true
  212. }
  213. })
  214. }
  215. // 设置最近会话未读数量
  216. export const setUnread = async (data) => {
  217. return request({
  218. url: '/app-api/im/conversations/setUnread',
  219. method: 'POST',
  220. data,
  221. custom: {
  222. showLoading: false,
  223. auth: true
  224. }
  225. })
  226. }
  227. // 设置最近会话未读数量
  228. export const deleteConversation = async (data) => {
  229. return request({
  230. url: '/app-api/im/conversation/delete',
  231. method: 'POST',
  232. data,
  233. custom: {
  234. showLoading: false,
  235. auth: true
  236. }
  237. })
  238. }
  239. // 获取type类型聊天记录
  240. export const getMessageType = async (data) => {
  241. return request({
  242. url: '/app-api/im/im/history/messages',
  243. method: 'POST',
  244. data,
  245. custom: {
  246. showLoading: false,
  247. auth: true
  248. }
  249. })
  250. }
  251. // 求职端-根据邀请人id获取面试邀约列表
  252. export const getInterviewInviteListByInviteUserId = async (inviteUserId) => {
  253. return request({
  254. url: `/app-api/menduner/system/interview-invite/get/list/by/${inviteUserId}`,
  255. method: 'GET',
  256. custom: {
  257. showLoading: false,
  258. auth: true
  259. }
  260. })
  261. }