common.js 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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 passwordLogin = (data) => {
  42. return request({
  43. url: '/app-api/menduner/system/auth/login',
  44. method: 'POST',
  45. data,
  46. custom: {
  47. showLoading: false
  48. }
  49. })
  50. }
  51. // 招聘端-退出登录
  52. export const logout = (token) => {
  53. return request({
  54. url: `/app-api/menduner/system/recruit/enterprise/auth/logout-token?token=${token}`,
  55. method: 'POST',
  56. custom: {
  57. showLoading: false,
  58. auth: true
  59. }
  60. })
  61. }
  62. // 个人端-退出登录
  63. export const userLogout = () => {
  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. openEncryption: true,
  187. showLoading: false,
  188. auth: true
  189. }
  190. })
  191. }
  192. // 获取聊天秘钥信息
  193. export const getChatKey = async (data) => {
  194. return request({
  195. url: '/app-api/im/user/get',
  196. method: 'POST',
  197. data,
  198. custom: {
  199. showLoading: false,
  200. auth: true
  201. }
  202. })
  203. }
  204. // 同步最近会话
  205. export const getMessageSync = async (data) => {
  206. return request({
  207. url: '/app-api/im/im/channel/messagesync',
  208. method: 'POST',
  209. data,
  210. custom: {
  211. showLoading: false,
  212. auth: true
  213. }
  214. })
  215. }
  216. // 设置最近会话未读数量
  217. export const setUnread = async (data) => {
  218. return request({
  219. url: '/app-api/im/conversations/setUnread',
  220. method: 'POST',
  221. data,
  222. custom: {
  223. showLoading: false,
  224. auth: true
  225. }
  226. })
  227. }
  228. // 设置最近会话未读数量
  229. export const deleteConversation = async (data) => {
  230. return request({
  231. url: '/app-api/im/conversation/delete',
  232. method: 'POST',
  233. data,
  234. custom: {
  235. showLoading: false,
  236. auth: true
  237. }
  238. })
  239. }
  240. // 内容管理-广告
  241. export const getWebContent = async () => {
  242. return request({
  243. url: `/app-api/menduner/system/web-content/get?id=1`,
  244. method: 'GET',
  245. custom: {
  246. showLoading: false,
  247. auth: false
  248. }
  249. })
  250. }
  251. // 获得社交用户
  252. export const getSocialUser = async (type) => {
  253. return request({
  254. url: `/app-api/menduner/system/social-user/get?type=${type}`,
  255. method: 'GET',
  256. // params,
  257. custom: {
  258. showLoading: false,
  259. auth: true
  260. }
  261. })
  262. }
  263. // 获得支付订单 (轮巡支付状态)
  264. export const getOrderPayStatus = async (params) => {
  265. return request({
  266. url: '/app-api/pay/order/get',
  267. method: 'GET',
  268. params,
  269. custom: {
  270. showLoading: false,
  271. auth: true
  272. }
  273. })
  274. }
  275. // 获得指定应用的开启的支付渠道编码列表
  276. export const getEnableCodeList = async (params) => {
  277. return request({
  278. url: '/app-api/pay/channel/get-enable-code-list',
  279. method: 'GET',
  280. params,
  281. custom: {
  282. showLoading: false,
  283. auth: true
  284. }
  285. })
  286. }
  287. // 提交支付订单
  288. export const payOrderSubmit = async (data) => {
  289. return request({
  290. url: '/app-api/pay/order/submit',
  291. method: 'POST',
  292. data,
  293. custom: {
  294. showLoading: false,
  295. auth: true
  296. }
  297. })
  298. }
  299. // 社交绑定,使用 code 授权码
  300. export const socialUserBind = async (data) => {
  301. return request({
  302. url: '/app-api/menduner/system/social-user/bind',
  303. method: 'POST',
  304. data: {...data, application: 'recruit_application'}, // 增加一个application参数,招聘端的值如上,不填默认null后台自动认为是求职端小程序
  305. custom: {
  306. showLoading: false,
  307. auth: true
  308. }
  309. })
  310. }
  311. // 企业营业执照图片识别文字
  312. export const getBusinessLicenseOCR = async (url) => {
  313. return request({
  314. url: '/app-api/menduner/system/recruit/enterprise/business/ocr?url=' + url,
  315. method: 'POST',
  316. custom: {
  317. showLoading: false,
  318. auth: true
  319. }
  320. })
  321. }
  322. // 根据专业名称模糊搜索
  323. export const schoolMajorByName = async (params) => {
  324. return request({
  325. url: '/app-api/menduner/system/major/search/by/name',
  326. params,
  327. method: 'GET',
  328. custom: {
  329. showLoading: false,
  330. auth: true
  331. }
  332. })
  333. }
  334. // 根据专业id搜索
  335. export const schoolMajorById = async (params) => {
  336. return request({
  337. url: '/app-api/menduner/system/major/get',
  338. params,
  339. method: 'GET',
  340. custom: {
  341. showLoading: false,
  342. auth: true
  343. }
  344. })
  345. }