sso.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. export let SKIP_SSO_URL_QUERY = { key: 'skipsso', val: '1' };
  2. // export let locationUrl = 'http://' + window.location.host + '/';
  3. export let openSso='true';
  4. /**
  5. */
  6. export function locationUrl() {
  7. console.log("----------------locationUrl-----host---------------------------");
  8. console.log(window.location.host);
  9. return 'http://' + window.location.host + '/';
  10. }
  11. /**
  12. * 获取url地址参数
  13. * @param paraName
  14. */
  15. export function getUrlParam(paraName) {
  16. if (process.env.VUE_APP_PLATFORM != 'h5'){
  17. // 获取当前页面的实例
  18. const pages = getCurrentPages();
  19. // 获取当前页面的实例
  20. const currentPage = pages[pages.length - 1];
  21. // 获取页面的完整地址
  22. const url = currentPage.options;
  23. console.log("----------------currentPage.options--------"+JSON.stringify(currentPage.options));
  24. }
  25. else{
  26. const url = window.location.toString();
  27. console.log("----------------url--------");
  28. console.log(url);
  29. const arrObj = url.split('?');
  30. if (arrObj.length > 1) {
  31. const arrPara = arrObj[1].split('&');
  32. let arr;
  33. for (let i = 0; i < arrPara.length; i++) {
  34. arr = arrPara[i].split('=');
  35. if (arr != null && arr[0] == paraName) {
  36. return arr[1];
  37. }
  38. }
  39. return '';
  40. } else {
  41. return '';
  42. }
  43. }
  44. }