socialUser.ts 642 B

12345678910111213141516171819202122232425262728293031
  1. import request from '@/config/axios'
  2. // 社交绑定,使用 code 授权码
  3. export const socialBind = (type, code, state) => {
  4. return request.post({
  5. url: '/system/social-user/bind',
  6. data: {
  7. type,
  8. code,
  9. state
  10. }
  11. })
  12. }
  13. // 取消社交绑定
  14. export const socialUnbind = (type, openid) => {
  15. return request.delete({
  16. url: '/system/social-user/unbind',
  17. data: {
  18. type,
  19. openid
  20. }
  21. })
  22. }
  23. // 社交授权的跳转
  24. export const socialAuthRedirect = (type, redirectUri) => {
  25. return request.get({
  26. url: '/system/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri
  27. })
  28. }