common.js 5.4 KB

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