common.js 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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 = (token) => {
  86. return request({
  87. url: `/app-api/menduner/system/recruit/enterprise/auth/logout-token?token=${token}`,
  88. method: 'POST',
  89. custom: {
  90. showLoading: false,
  91. auth: true
  92. }
  93. })
  94. }
  95. // 个人端-退出登录
  96. export const userLogout = () => {
  97. return request({
  98. url: `/app-api/menduner/system/auth/logout`,
  99. method: 'POST',
  100. custom: {
  101. showLoading: false,
  102. auth: true
  103. }
  104. })
  105. }
  106. // 字典
  107. export const getDictData = (params) => {
  108. return request({
  109. url: '/app-api/system/dict-data/type',
  110. method: 'GET',
  111. params,
  112. custom: {
  113. showLoading: false,
  114. auth: false
  115. }
  116. })
  117. }
  118. // 获取行业列表
  119. export const getIndustryListData = (params) => {
  120. return request({
  121. url: '/app-api/menduner/system/industry/list',
  122. method: 'GET',
  123. params,
  124. custom: {
  125. showLoading: false,
  126. auth: false
  127. }
  128. })
  129. }
  130. // 获取技能列表
  131. export const getSkillList = () => {
  132. return request({
  133. url: '/app-api/menduner/system/skill/list',
  134. method: 'GET',
  135. custom: {
  136. showLoading: false,
  137. auth: false
  138. }
  139. })
  140. }
  141. // 获取行业树形
  142. export const getIndustryTreeData = (params) => {
  143. return request({
  144. url: '/app-api/menduner/system/industry/get/tree',
  145. method: 'GET',
  146. params,
  147. custom: {
  148. showLoading: false,
  149. auth: false
  150. }
  151. })
  152. }
  153. // 获取地区列表
  154. export const getAreaListData = (params) => {
  155. return request({
  156. url: '/app-api/menduner/system/area/list',
  157. method: 'GET',
  158. params,
  159. custom: {
  160. showLoading: false,
  161. auth: false
  162. }
  163. })
  164. }
  165. // 获取地区获取地区map
  166. export const getAreaMapData = (params) => {
  167. return request({
  168. url: '/app-api/menduner/system/area/map',
  169. method: 'GET',
  170. params,
  171. custom: {
  172. showLoading: false,
  173. auth: false
  174. }
  175. })
  176. }
  177. // 获得职位类型
  178. export const getPositionTreeData = (params) => {
  179. return request({
  180. url: '/app-api/menduner/system/position/get/tree',
  181. method: 'GET',
  182. params,
  183. custom: {
  184. showLoading: false,
  185. auth: false
  186. }
  187. })
  188. }
  189. // 获取职位列表
  190. export const getPositionData = (params) => {
  191. return request({
  192. url: '/app-api/menduner/system/position/list',
  193. method: 'GET',
  194. params,
  195. custom: {
  196. showLoading: false,
  197. auth: false
  198. }
  199. })
  200. }
  201. // 获取区域树形
  202. export const getAreaTreeData = () => {
  203. return request({
  204. url: '/app-api/menduner/system/area/get/tree',
  205. method: 'GET',
  206. custom: {
  207. showLoading: false,
  208. auth: false
  209. }
  210. })
  211. }
  212. // 同步最近会话
  213. export const getConversationSync = async (data) => {
  214. return request({
  215. url: '/app-api/im/conversation/sync',
  216. method: 'POST',
  217. data,
  218. custom: {
  219. openEncryption: true,
  220. showLoading: false,
  221. auth: true
  222. }
  223. })
  224. }
  225. // 获取聊天秘钥信息
  226. export const getChatKey = async (data) => {
  227. return request({
  228. url: '/app-api/im/user/get',
  229. method: 'POST',
  230. data,
  231. custom: {
  232. showLoading: false,
  233. auth: true
  234. }
  235. })
  236. }
  237. // 同步最近会话
  238. export const getMessageSync = async (data) => {
  239. return request({
  240. url: '/app-api/im/im/channel/messagesync',
  241. method: 'POST',
  242. data,
  243. custom: {
  244. showLoading: false,
  245. auth: true
  246. }
  247. })
  248. }
  249. // 设置最近会话未读数量
  250. export const setUnread = async (data) => {
  251. return request({
  252. url: '/app-api/im/conversations/setUnread',
  253. method: 'POST',
  254. data,
  255. custom: {
  256. showLoading: false,
  257. auth: true
  258. }
  259. })
  260. }
  261. // 设置最近会话未读数量
  262. export const deleteConversation = async (data) => {
  263. return request({
  264. url: '/app-api/im/conversation/delete',
  265. method: 'POST',
  266. data,
  267. custom: {
  268. showLoading: false,
  269. auth: true
  270. }
  271. })
  272. }
  273. // 获取type类型聊天记录
  274. export const getMessageType = async (data) => {
  275. return request({
  276. url: '/app-api/im/im/history/messages',
  277. method: 'POST',
  278. data,
  279. custom: {
  280. showLoading: false,
  281. auth: true
  282. }
  283. })
  284. }
  285. // 求职端-根据邀请人id获取面试邀约列表
  286. export const getInterviewInviteListByInviteUserId = async (inviteUserId) => {
  287. return request({
  288. url: `/app-api/menduner/system/interview-invite/get/list/by/${inviteUserId}`,
  289. method: 'GET',
  290. custom: {
  291. showLoading: false,
  292. auth: true
  293. }
  294. })
  295. }
  296. // 内容管理-广告
  297. export const getWebContent = async () => {
  298. return request({
  299. url: `/app-api/menduner/system/web-content/get?id=1`,
  300. method: 'GET',
  301. custom: {
  302. showLoading: false,
  303. auth: false
  304. }
  305. })
  306. }
  307. // 联系我们
  308. // 提交猎寻服务
  309. export const huntSubmit = async (data) => {
  310. return request({
  311. url: '/admin-api/menduner/system/hunt/submit',
  312. method: 'POST',
  313. data,
  314. custom: {
  315. showLoading: false,
  316. auth: false
  317. }
  318. })
  319. }
  320. // 获得微信小程订阅模板列表
  321. // export const getSubscribeTemplateList = async () => {
  322. // return request({
  323. // url: `/app-api/menduner/system/social-user/get-subscribe-template-list`,
  324. // method: 'GET',
  325. // custom: {
  326. // showLoading: false,
  327. // auth: false
  328. // }
  329. // })
  330. // }
  331. // 求职端交易订单 创建
  332. export const orderCreated = async (data) => {
  333. return request({
  334. // url: '/app-api/menduner/system/trade/order/create',
  335. url: '/app-api/menduner/system/trade/order/wx-program/create',
  336. method: 'POST',
  337. data,
  338. custom: {
  339. openEncryption: true,
  340. showLoading: false,
  341. auth: true
  342. }
  343. })
  344. }
  345. // 求职端交易订单 创建
  346. export const getOrder = async (params) => {
  347. return request({
  348. url: '/app-api/menduner/system/trade/order/get/unpaid',
  349. method: 'GET',
  350. params,
  351. custom: {
  352. showLoading: false,
  353. auth: true
  354. }
  355. })
  356. }
  357. // 获得社交用户
  358. export const getSocialUser = async (type) => {
  359. return request({
  360. url: `/app-api/menduner/system/social-user/get?type=${type}`,
  361. method: 'GET',
  362. // params,
  363. custom: {
  364. showLoading: false,
  365. auth: true
  366. }
  367. })
  368. }
  369. // 获得支付订单 (轮巡支付状态)
  370. export const getOrderPayStatus = async (params) => {
  371. return request({
  372. url: '/app-api/pay/order/get',
  373. method: 'GET',
  374. params,
  375. custom: {
  376. showLoading: false,
  377. auth: true
  378. }
  379. })
  380. }
  381. // 获得指定应用的开启的支付渠道编码列表
  382. export const getEnableCodeList = async (params) => {
  383. return request({
  384. url: '/app-api/pay/channel/get-enable-code-list',
  385. method: 'GET',
  386. params,
  387. custom: {
  388. showLoading: false,
  389. auth: true
  390. }
  391. })
  392. }
  393. // 提交支付订单
  394. export const payOrderSubmit = async (data) => {
  395. return request({
  396. url: '/app-api/pay/order/submit',
  397. method: 'POST',
  398. data,
  399. custom: {
  400. showLoading: false,
  401. auth: true
  402. }
  403. })
  404. }
  405. // 社交绑定,使用 code 授权码
  406. export const socialUserBind = async (data) => {
  407. return request({
  408. url: '/app-api/menduner/system/social-user/bind',
  409. method: 'POST',
  410. data,
  411. custom: {
  412. showLoading: false,
  413. auth: true
  414. }
  415. })
  416. }
  417. // 企业营业执照图片识别文字
  418. export const getBusinessLicenseOCR = async (url) => {
  419. return request({
  420. url: '/app-api/menduner/system/recruit/enterprise/business/ocr?url=' + url,
  421. method: 'POST',
  422. custom: {
  423. showLoading: false,
  424. auth: true
  425. }
  426. })
  427. }