wlwy-package 3.2.2 → 3.2.3-httpOnlyCookie.0

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.
@@ -1,4 +1,4 @@
1
- import { E as Editor } from "../index-DbAXWdHe.js";
1
+ import { E as Editor } from "../index-BPPIVUm2.js";
2
2
  export {
3
3
  Editor as default
4
4
  };
@@ -2,8 +2,8 @@ import { defineComponent, createElementBlock, openBlock, ref, shallowRef, onMoun
2
2
  import "xe-utils";
3
3
  import { theme, message } from "ant-design-vue";
4
4
  import "vue-router";
5
- import { u as useI18n, b as useLocale, A as API } from "./index-D4mQXwMj.js";
6
- import { _ as _export_sfc$1 } from "./index-DbAXWdHe.js";
5
+ import { u as useI18n, b as useLocale, A as API } from "./index-DtK1XQdW.js";
6
+ import { _ as _export_sfc$1 } from "./index-BPPIVUm2.js";
7
7
  var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
8
8
  function t(e10) {
9
9
  return e10 && e10.__esModule && Object.prototype.hasOwnProperty.call(e10, "default") ? e10.default : e10;
@@ -22,7 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
22
  }),
23
23
  emits: /* @__PURE__ */ mergeModels(["change", "focus", "blur"], ["update:html", "update:text"]),
24
24
  setup(__props, { expose: __expose, emit: __emit }) {
25
- const EditorCore = defineAsyncComponent(() => import("./editor-core-D9MSA0yc.js"));
25
+ const EditorCore = defineAsyncComponent(() => import("./editor-core-C7ZO3umt.js"));
26
26
  const html = useModel(__props, "html");
27
27
  const text = useModel(__props, "text");
28
28
  const props = __props;
@@ -181,7 +181,7 @@ const useTabsNavStoreWithOut = () => {
181
181
  function getConfig() {
182
182
  return window._CONFIG ?? {};
183
183
  }
184
- function getCookie$1(key) {
184
+ function getCookie(key) {
185
185
  return cookie.get(key) || "";
186
186
  }
187
187
  function setCookie(key, value, options = {}) {
@@ -207,7 +207,7 @@ function getTopLevelDomain(url) {
207
207
  }
208
208
  function useCookie() {
209
209
  return {
210
- getCookie: getCookie$1,
210
+ getCookie,
211
211
  setCookie,
212
212
  removeCookie,
213
213
  getCookieAll
@@ -2705,7 +2705,6 @@ const {
2705
2705
  mergeConfig
2706
2706
  } = axios;
2707
2707
  const DEFAULT_LOADING = false;
2708
- const { getCookie } = useCookie();
2709
2708
  const { getLanguage: getLanguage$1 } = useLocale();
2710
2709
  class service {
2711
2710
  constructor(config2) {
@@ -2714,40 +2713,40 @@ class service {
2714
2713
  __publicField(this, "interceptors");
2715
2714
  __publicField(this, "showLoading");
2716
2715
  __publicField(this, "spinning");
2717
- __publicField(this, "tokenKey");
2718
- var _a, _b, _c, _d;
2716
+ __publicField(this, "systemType");
2717
+ var _a, _b, _c, _d, _e, _f;
2719
2718
  this.interceptors = config2.interceptors;
2720
2719
  this.showLoading = config2.showLoading || DEFAULT_LOADING;
2721
- this.tokenKey = config2.tokenKey || "ttoken";
2720
+ const headerSystemType = ((_a = config2.headers) == null ? void 0 : _a["System-Type"]) ?? ((_b = config2.headers) == null ? void 0 : _b["system-type"]);
2721
+ this.systemType = config2.systemType || (typeof headerSystemType === "string" ? headerSystemType : "T");
2722
2722
  delete config2.interceptors;
2723
2723
  delete config2.showLoading;
2724
2724
  delete config2.tokenKey;
2725
+ delete config2.systemType;
2726
+ config2.withCredentials = true;
2725
2727
  this.instance = axios.create(config2);
2726
- this.instance.interceptors.request.use((_a = this.interceptors) == null ? void 0 : _a.requestInterceptor, (_b = this.interceptors) == null ? void 0 : _b.requestInterceptorCatch);
2727
2728
  this.instance.interceptors.response.use((_c = this.interceptors) == null ? void 0 : _c.responseInterceptor, (_d = this.interceptors) == null ? void 0 : _d.responseInterceptorCatch);
2728
2729
  this.instance.interceptors.request.use(
2729
2730
  (config22) => {
2731
+ var _a2;
2730
2732
  if (this.spinning ?? this.showLoading) {
2731
2733
  const commonStore = useCommonStoreWithOut();
2732
2734
  commonStore.setLoading(true);
2733
2735
  }
2734
- Object.assign(config22.headers, {
2735
- // 添加TOKEN
2736
- Satoken: getCookie(this.tokenKey) ?? "",
2737
- // 添加语言
2738
- language: getLanguage$1(),
2739
- // 添加SystemType
2740
- "System-Type": "T",
2741
- // 添加时区
2742
- timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
2743
- ...config22.headers
2744
- });
2736
+ config22.headers.delete("satoken");
2737
+ config22.headers.set("language", getLanguage$1());
2738
+ config22.headers.set("System-Type", this.systemType);
2739
+ config22.headers.set("timezone", Intl.DateTimeFormat().resolvedOptions().timeZone);
2740
+ if (["POST", "PUT", "PATCH", "DELETE"].includes(((_a2 = config22.method) == null ? void 0 : _a2.toUpperCase()) || "")) {
2741
+ config22.headers.set("X-CSRF-Protection", "1");
2742
+ }
2745
2743
  return config22;
2746
2744
  },
2747
2745
  (error) => {
2748
2746
  return error;
2749
2747
  }
2750
2748
  );
2749
+ this.instance.interceptors.request.use((_e = this.interceptors) == null ? void 0 : _e.requestInterceptor, (_f = this.interceptors) == null ? void 0 : _f.requestInterceptorCatch);
2751
2750
  this.instance.interceptors.response.use(
2752
2751
  (response) => {
2753
2752
  const commonStore = useCommonStoreWithOut();