ProfileLogin.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div class="divClass">认证中...</div>
  3. </template>
  4. <script>
  5. import AuthSettingResource from '../api/commom/AuthSettingResource.js';
  6. import LoginService from './LoginService.js';
  7. export default {
  8. components: {
  9. },
  10. data: function () {
  11. return {
  12. isUniqueLoginModel: false, //唯一认证方式
  13. }
  14. },
  15. mounted: function () {
  16. this.getIsUniqueLoginModel();
  17. this.initData();
  18. },
  19. methods: {
  20. /**
  21. * 外部单点登录
  22. * @param {Object} accountNumber
  23. * @author GuoZhiBo 20211026
  24. */
  25. profileLogin: function (code, redirect_uri, jaccountClientId, id) {
  26. redirect_uri = decodeURIComponent(redirect_uri);
  27. var loginData = {
  28. code: code,
  29. accountDateTime: this.accountDateTime,
  30. languageId: this.languageSelected,
  31. redirect_uri: redirect_uri,
  32. client_id: jaccountClientId,
  33. id: id,
  34. };
  35. var _self = this;
  36. $.ajax({
  37. url: Common.getApiUrl2('authApi/LoginResource/profileLogin'),
  38. async: true,
  39. type: 'post',
  40. data: loginData,
  41. success: function (loginInfo) {
  42. loginInfo.accountName = _self.accountItem.accountName;
  43. LoginService.setLoginInfo(loginInfo);
  44. LoginService.saveLocalStorage(_self);
  45. },
  46. error: function (XMLHttpRequest, textStatus, errorThrown) {
  47. Common.processException(XMLHttpRequest, textStatus, errorThrown);
  48. },
  49. });
  50. },
  51. }
  52. }
  53. </script>
  54. <style scoped>
  55. .divClass {
  56. text-align: center;
  57. font-size: 30px;
  58. color: red;
  59. }
  60. </style>