@indfnd/common 1.0.77 → 1.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.0.80](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.79...v1.0.80) (2025-01-03)
6
+
7
+
8
+ ### Features
9
+
10
+ * 修复山东单点登录异常 ([e802ab1](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/e802ab10fe2c5f0eb0d21b086b8fbc2b50981e8a))
11
+
12
+ ### [1.0.79](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.78...v1.0.79) (2025-01-02)
13
+
14
+ ### [1.0.78](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.77...v1.0.78) (2024-12-31)
15
+
5
16
  ### [1.0.77](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.76...v1.0.77) (2024-12-23)
6
17
 
7
18
 
@@ -5460,7 +5460,7 @@ var lodash = { exports: {} };
5460
5460
  })(lodash, lodash.exports);
5461
5461
  var _ = lodash.exports;
5462
5462
  const name$1 = "@indfnd/common";
5463
- const version = "1.0.76";
5463
+ const version = "1.0.79";
5464
5464
  const author = "huxuetong";
5465
5465
  const publishConfig = {
5466
5466
  registry: "https://registry.npmjs.org/"
@@ -67703,43 +67703,44 @@ function addRouterGuards({ router, store: store2, microType, allowPermissionList
67703
67703
  window.apiErrorHandler = function(msg) {
67704
67704
  Message.error({ content: msg, duration: 10, closable: true });
67705
67705
  };
67706
+ window.getQueryVariable = function getQueryVariable2(variable) {
67707
+ var query = window.location.search.substring(1);
67708
+ var vars = query.split("&");
67709
+ for (let i = 0; i < vars.length; i++) {
67710
+ let pair = vars[i].split("=");
67711
+ if (pair[0] == variable) {
67712
+ return pair.slice(1).join("=");
67713
+ }
67714
+ }
67715
+ let routeHash = window.location.hash.substring(2);
67716
+ if (routeHash.includes("?")) {
67717
+ query = routeHash.split("?")[1];
67718
+ }
67719
+ vars = query.split("&");
67720
+ for (let i = 0; i < vars.length; i++) {
67721
+ let pair = vars[i].split("=");
67722
+ if (pair[0] == variable) {
67723
+ return pair.slice(1).join("=");
67724
+ }
67725
+ }
67726
+ return false;
67727
+ };
67706
67728
  router.beforeEach(async (to, from, next) => {
67707
67729
  LoadingBar.start();
67708
67730
  let token = getToken();
67709
67731
  let search = location.search;
67710
67732
  if (search) {
67711
- let rlt = /token=(.*)/.exec(search);
67712
- if (rlt && rlt.length > 1) {
67713
- if (token !== rlt[1]) {
67714
- token = rlt[1];
67733
+ let rlt = getQueryVariable("token");
67734
+ if (rlt) {
67735
+ if (token !== rlt) {
67736
+ token = rlt;
67715
67737
  store2.dispatch("loginSuccess", token);
67716
67738
  }
67717
67739
  }
67718
- }
67719
- if (!token) {
67720
- fetch(
67721
- `${window.location.protocol}//${window.location.host}/ind-uc-ext-server/sso/ssoTokenLogin`,
67722
- {
67723
- headers: {
67724
- accept: "application/json, text/plain, */*",
67725
- "accept-language": "zh-CN,zh;q=0.9",
67726
- "cache-control": "no-cache",
67727
- pragma: "no-cache"
67728
- },
67729
- referrer: `${window.location.protocol}//${window.location.host}/`,
67730
- referrerPolicy: "origin",
67731
- body: null,
67732
- method: "GET",
67733
- mode: "cors",
67734
- credentials: "include"
67735
- }
67736
- ).then((response) => response.json()).then((jsonData) => {
67737
- if (jsonData.token) {
67738
- token = jsonData.token;
67739
- sessionStorage.setItem("lambo-token", token);
67740
- store2.dispatch("loginSuccess", token);
67741
- }
67742
- });
67740
+ let ssoToken = getQueryVariable("sso_token");
67741
+ if (ssoToken) {
67742
+ sessionStorage.setItem("sso_token", ssoToken);
67743
+ }
67743
67744
  }
67744
67745
  if (!token && to.name !== LOGIN_PAGE_NAME) {
67745
67746
  next({ name: LOGIN_PAGE_NAME });