common.js 5.6 KB

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