index.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. import request from '@/config/axios'
  2. // 获取人才信息
  3. export const getBaseInfo = async (params) => {
  4. return await request.get({
  5. url: '/app-api/menduner/system/person/get',
  6. openEncryption: true,
  7. params
  8. })
  9. }
  10. // 发送验证码
  11. export const sendSmsCode = async (data) => {
  12. return await request.post({
  13. url: '/app-api/menduner/system/auth/send-sms-code',
  14. data
  15. })
  16. }
  17. // 个人注册并登录
  18. export const userRegister = async (data) => {
  19. return await request.post({
  20. url: '/app-api/menduner/system/auth/register',
  21. data
  22. })
  23. }
  24. // 验证码登录
  25. export const smsLogin = async (data) => {
  26. return await request.post({
  27. url: '/app-api/menduner/system/auth/sms-login',
  28. data
  29. })
  30. }
  31. // 切换登录
  32. export const switchLoginOfEnterprise = async (data) => {
  33. return await request.post({
  34. tokenIndex: 2, // 使用求职token
  35. url: '/app-api/menduner/system/recruit/enterprise/auth/switch-login',
  36. data
  37. })
  38. }
  39. // 企业-验证码登录
  40. export const smsLoginOfEnterprise = async (data) => {
  41. return await request.post({
  42. url: '/app-api/menduner/system/recruit/enterprise/auth/sms-login',
  43. data
  44. })
  45. }
  46. // 企业-密码登录
  47. export const passwordLoginOfEnterprise = async (data) => {
  48. return await request.post({
  49. url: '/app-api/menduner/system/recruit/enterprise/auth/login',
  50. data
  51. })
  52. }
  53. // 密码登录
  54. export const passwordLogin = async (data) => {
  55. return await request.post({
  56. url: '/app-api/menduner/system/auth/login',
  57. data
  58. })
  59. }
  60. // 根据邮箱获取企业注册申请
  61. export const getEnterpriseRegisterApply = async (email) => {
  62. return await request.get({
  63. url: '/app-api/menduner/system/enterprise-register/by/email?email=' + email,
  64. openEncryption: true
  65. })
  66. }
  67. // 退出登录
  68. export const logout = async () => {
  69. return await request.post({
  70. tokenIndex: 2, // 使用求职token
  71. url: '/app-api/menduner/system/auth/logout'
  72. })
  73. }
  74. // 根据令牌退出登录
  75. export const logoutToken = async (token) => {
  76. return await request.post({
  77. tokenIndex: 1, // 使用招聘token
  78. url: `/app-api/menduner/system/recruit/enterprise/auth/logout-token?token=${token}`
  79. })
  80. }
  81. // 修改密码
  82. export const updatePassword = async (data) => {
  83. return await request.put({
  84. url: '/app-api/menduner/system/mde-user/update-password',
  85. data
  86. })
  87. }
  88. // 重置密码
  89. export const resetPassword = async (data) => {
  90. return await request.put({
  91. url: '/app-api/menduner/system/auth/reset-password',
  92. data
  93. })
  94. }
  95. // 企业重置密码
  96. export const entResetPassword = async (data) => {
  97. return await request.put({
  98. url: '/app-api/menduner/system/recruit/enterprise/auth/reset-password',
  99. data
  100. })
  101. }
  102. // 发送邮箱验证码
  103. export const getEmailCode = async (email) => {
  104. return await request.post({
  105. url: `/app-api/menduner/system/recruit/enterprise/auth/send-email-code?email=${email}`
  106. })
  107. }
  108. // 字典
  109. export const getDictData = async (params) => {
  110. return await request.get({
  111. url: '/app-api/system/dict-data/type',
  112. params
  113. })
  114. }
  115. // 点击访问职位埋点
  116. export const getPositionTreeClick = async (data) => {
  117. return await request.post({
  118. url: '/app-api/menduner/system/position/click',
  119. data
  120. })
  121. }
  122. // 获取职位列表
  123. export const getPositionData = async (params) => {
  124. return request.get({
  125. url: '/app-api/menduner/system/position/list',
  126. params
  127. })
  128. }
  129. // 获取热门职位
  130. export const getHotPositionList = async (params) => {
  131. return await request.get({
  132. url: '/app-api/menduner/system/position/hot',
  133. params
  134. })
  135. }
  136. // 获得职位信息
  137. export const getPositionTreeData = async (params) => {
  138. return await request.get({
  139. url: '/app-api/menduner/system/position/get/tree',
  140. params
  141. })
  142. }
  143. // 获取区域树形
  144. export const getAreaTreeData = async () => {
  145. return await request.get({
  146. url: '/app-api/menduner/system/area/get/tree'
  147. })
  148. }
  149. // 获取行业树形
  150. export const getIndustryTreeData = async (params) => {
  151. return await request.get({
  152. url: '/app-api/menduner/system/industry/get/tree',
  153. params
  154. })
  155. }
  156. // 获取行业列表
  157. export const getIndustryListData = async (params) => {
  158. return await request.get({
  159. url: '/app-api/menduner/system/industry/list',
  160. params
  161. })
  162. }
  163. // 获取地区列表
  164. export const getAreaListData = async (params) => {
  165. return await request.get({
  166. url: '/app-api/menduner/system/area/list',
  167. params
  168. })
  169. }
  170. // 获取-技能列表
  171. export const getSkillList = async () => {
  172. return await request.get({
  173. url: '/app-api/menduner/system/skill/list'
  174. })
  175. }
  176. // 获取地区获取地区map
  177. export const getAreaMapData = async (params) => {
  178. return await request.get({
  179. url: '/app-api/menduner/system/area/map',
  180. params
  181. })
  182. }
  183. // 公司检索-获取热门地区
  184. export const getHotArea = async () => {
  185. return await request.get({
  186. url: '/app-api/menduner/system/area/get/hot'
  187. })
  188. }
  189. // 上传文件
  190. export const uploadFile = async (data) => {
  191. return await request.upload({ url: '/app-api/menduner/system/file/upload', data })
  192. }
  193. // 图片上传
  194. // export const uploadImage = async (data) => {
  195. // return await request.upload({ url: '/app-api/infra/file/upload', data })
  196. // }
  197. // 获取当前登录的企业用户信息
  198. export const getEnterprisingUserInfo = async (params) => {
  199. return await request.get({
  200. tokenIndex: 1, // 使用招聘token
  201. url: '/app-api/menduner/system/recruit/user/get',
  202. params
  203. })
  204. }
  205. // 招聘端-刷新令牌token
  206. export const enterpriseRefreshToken = async (refreshToken) => {
  207. return await request.post({
  208. tokenIndex: 1, // 使用招聘token
  209. url: `/app-api/menduner/system/recruit/enterprise/auth/refresh-token?refreshToken=${refreshToken}`
  210. })
  211. }
  212. // 求职端-刷新令牌token
  213. export const userRefreshToken = async (refreshToken) => {
  214. return await request.post({
  215. tokenIndex: 2, // 使用求职token
  216. url: `/app-api/menduner/system/auth/refresh-token?refreshToken=${refreshToken}`
  217. })
  218. }
  219. // 招聘端-企业账户信息(积分&余额)
  220. export const getEnterpriseUserAccount = async () => {
  221. return await request.get({
  222. // url: '/app-api/menduner/system/recruit/user/get/account'
  223. tokenIndex: 1, // 使用招聘token
  224. url: '/app-api/pay/currency/get' // 获取货币账户
  225. })
  226. }
  227. // 求职端-用户账户信息(积分&余额)
  228. export const getUserAccount = async () => {
  229. return await request.get({
  230. url: '/app-api/menduner/system/mde-user/get/account'
  231. })
  232. }
  233. // 获取聊天秘钥信息
  234. export const getChatKey = async (data) => {
  235. return await request.post({
  236. url: '/app-api/im/user/get',
  237. data
  238. })
  239. }
  240. // 同步最近会话
  241. export const getConversationSync = async (data) => {
  242. return await request.post({
  243. url: '/app-api/im/conversation/sync',
  244. openEncryption: true,
  245. data
  246. })
  247. }
  248. // 同步最近会话
  249. export const getMessageSync = async (data) => {
  250. return await request.post({
  251. url: '/app-api/im/im/channel/messagesync',
  252. data
  253. })
  254. }
  255. // 设置最近会话未读数量
  256. export const setUnread = async (data) => {
  257. return await request.post({
  258. url: '/app-api/im/conversations/setUnread',
  259. data
  260. })
  261. }
  262. // 设置最近会话未读数量
  263. export const deleteConversation = async (data) => {
  264. return await request.post({
  265. url: '/app-api/im/conversation/delete',
  266. data
  267. })
  268. }
  269. // 获取type类型聊天记录
  270. export const getMessageType = async (data) => {
  271. return await request.post({
  272. url: '/app-api/im/im/history/messages',
  273. data
  274. })
  275. }
  276. // 聊天记录撤回
  277. export const messageBack = async (data) => {
  278. return await request.post({
  279. url: '/app-api/im/im/messages/back',
  280. data
  281. })
  282. }
  283. // 求职端-根据邀请人id获取面试邀约列表
  284. export const getInterviewInviteListByInviteUserId = async (inviteUserId) => {
  285. return await request.get({
  286. url: `/app-api/menduner/system/interview-invite/get/list/by/${inviteUserId}`
  287. })
  288. }
  289. // 获得指定应用的开启的支付渠道编码列表
  290. export const getEnableCodeList = async (params) => {
  291. return await request.get({
  292. url: '/app-api/pay/channel/get-enable-code-list',
  293. params
  294. })
  295. }
  296. // 获得指定应用的开启的支付渠道编码列表
  297. export const getEnableCodeList2 = async (code) => {
  298. return await request.get({
  299. url: '/app-api/pay/channel/get-enable-code-list2',
  300. params: { code }
  301. })
  302. }
  303. // 获取待支付的订单
  304. export const getUnpaidOrder = async (params) => {
  305. return await request.get({
  306. url: '/app-api/menduner/system/recruit/trade/order/get/unpaid',
  307. params
  308. })
  309. }
  310. // 提交支付订单
  311. export const payOrderSubmit = async (data) => {
  312. return await request.post({
  313. // url: '/app-api/menduner/system/recruit/pay/order/submit',
  314. url: '/app-api/pay/order/submit',
  315. data
  316. })
  317. }
  318. // 获得支付订单 (轮巡支付状态)
  319. export const getOrderPayStatus = async (params) => {
  320. return await request.get({
  321. url: '/app-api/pay/order/get',
  322. params
  323. })
  324. }
  325. // 获取账户余额
  326. export const getAccountBalance = async () => {
  327. return await request.get({
  328. url: '/app-api/pay/wallet/get'
  329. })
  330. }
  331. // 企业营业执照图片识别文字
  332. export const getBusinessLicenseOCR = async (url) => {
  333. return await request.post({
  334. url: '/app-api/menduner/system/recruit/enterprise/business/ocr?url=' + url
  335. })
  336. }
  337. // 社交授权的跳转
  338. export const socialAuthRedirect = async (params) => {
  339. return await request.get({
  340. url: '/app-api/menduner/system/auth/social-auth-redirect',
  341. params
  342. })
  343. }
  344. // 求职端交易订单 创建
  345. export const orderCreated = async (data) => {
  346. return await request.post({
  347. url: '/app-api/menduner/system/trade/order/create',
  348. openEncryption: true,
  349. data
  350. })
  351. }
  352. // 求职端交易订单 创建
  353. export const getOrder = async (params) => {
  354. return await request.get({
  355. url: '/app-api/menduner/system/trade/order/get/unpaid',
  356. params
  357. })
  358. }
  359. // 内容管理
  360. export const getWebContent = async () => {
  361. return await request.get({
  362. url: '/app-api/menduner/system/web-content/get?id=1'
  363. })
  364. }