@next-core/brick-kit 2.178.14 → 2.178.15

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.
@@ -4044,6 +4044,20 @@
4044
4044
  return error instanceof brickHttp.HttpAbortError;
4045
4045
  }
4046
4046
 
4047
+ function setLoginStateCookie(location) {
4048
+ // 独立打包应用 登录时间超时后还是由前端控制跳转,后台无法处理设置登录前的 path 和 query 的 cookie 值
4049
+ // 此这场景下前端做下处理
4050
+
4051
+ var {
4052
+ search,
4053
+ pathname
4054
+ } = location;
4055
+ var pathValue = pathname ? window.btoa(encodeURIComponent(pathname)) : "";
4056
+ var searchValue = search ? window.btoa(encodeURIComponent(search)) : "";
4057
+ document.cookie = "SALOGINPATH=".concat(pathValue, "; path=/");
4058
+ document.cookie = "SALOGINQUERY=".concat(searchValue, "; path=/");
4059
+ }
4060
+
4047
4061
  /**
4048
4062
  * 将 http 请求错误转换为可读的字符串。
4049
4063
  *
@@ -4099,6 +4113,7 @@
4099
4113
  onOk: () => {
4100
4114
  var ssoEnabled = getRuntime().getFeatureFlags()["sso-enabled"];
4101
4115
  var history = getHistory();
4116
+ setLoginStateCookie(history.location);
4102
4117
  history.push(ssoEnabled ? "/sso-auth/login" : "/auth/login", {
4103
4118
  from: _objectSpread__default["default"](_objectSpread__default["default"]({}, history.location), {}, {
4104
4119
  state: undefined
@@ -11724,6 +11739,7 @@
11724
11739
  devtoolsHookEmit("rendering");
11725
11740
  unmountTree(mountPoints.bg);
11726
11741
  var redirectToLogin = () => {
11742
+ setLoginStateCookie(location);
11727
11743
  history.replace(_this3.kernel.getFeatureFlags()["sso-enabled"] ? "/sso-auth/login" : "/auth/login", {
11728
11744
  from: location
11729
11745
  });