common.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. openEncryption: true,
  209. showLoading: false,
  210. auth: true
  211. }
  212. })
  213. }
  214. // 获取聊天秘钥信息
  215. export const getChatKey = async (data) => {
  216. return request({
  217. url: '/app-api/im/user/get',
  218. method: 'POST',
  219. data,
  220. custom: {
  221. showLoading: false,
  222. auth: true
  223. }
  224. })
  225. }
  226. // 同步最近会话
  227. export const getMessageSync = async (data) => {
  228. return request({
  229. url: '/app-api/im/im/channel/messagesync',
  230. method: 'POST',
  231. data,
  232. custom: {
  233. showLoading: false,
  234. auth: true
  235. }
  236. })
  237. }
  238. // 设置最近会话未读数量
  239. export const setUnread = async (data) => {
  240. return request({
  241. url: '/app-api/im/conversations/setUnread',
  242. method: 'POST',
  243. data,
  244. custom: {
  245. showLoading: false,
  246. auth: true
  247. }
  248. })
  249. }
  250. // 设置最近会话未读数量
  251. export const deleteConversation = async (data) => {
  252. return request({
  253. url: '/app-api/im/conversation/delete',
  254. method: 'POST',
  255. data,
  256. custom: {
  257. showLoading: false,
  258. auth: true
  259. }
  260. })
  261. }
  262. // 获取type类型聊天记录
  263. export const getMessageType = async (data) => {
  264. return request({
  265. url: '/app-api/im/im/history/messages',
  266. method: 'POST',
  267. data,
  268. custom: {
  269. showLoading: false,
  270. auth: true
  271. }
  272. })
  273. }
  274. // 求职端-根据邀请人id获取面试邀约列表
  275. export const getInterviewInviteListByInviteUserId = async (inviteUserId) => {
  276. return request({
  277. url: `/app-api/menduner/system/interview-invite/get/list/by/${inviteUserId}`,
  278. method: 'GET',
  279. custom: {
  280. showLoading: false,
  281. auth: true
  282. }
  283. })
  284. }