@okiss/oms 0.0.18 → 0.0.21

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/dist/index.es.js CHANGED
@@ -22,11 +22,11 @@ import { ElConfigProvider, ElBreadcrumbItem, ElBreadcrumb, ElRow, ElMain, ElAsid
22
22
  import "element-plus/es/components/config-provider/style/css";
23
23
  import locale from "element-plus/lib/locale/lang/zh-cn";
24
24
  import { addNewStyle, addNewStyleTag, queryParams, logGroup, isString, compactObject, showEleByClassName, Cache, isExternal, getQueryParam, strVarReplace, createIFrame, obj2Param, isObject, effectDataTrans, isArray } from "@okiss/utils";
25
- import { useStore, createStore, mapGetters } from "vuex";
26
25
  import Mock from "mockjs";
27
26
  import _, { cloneDeep, merge, get, unset } from "lodash";
28
27
  import axios from "axios";
29
28
  import Cookies from "js-cookie";
29
+ import { createStore, useStore, mapGetters } from "vuex";
30
30
  import ElementPlus, { ElMessage, ElMessageBox } from "element-plus";
31
31
  import "element-plus/dist/index.css";
32
32
  import "dayjs/locale/zh-cn";
@@ -79,7 +79,6 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
79
79
  __name: "App",
80
80
  setup(__props) {
81
81
  var _a, _b, _c, _d;
82
- console.log(12, useStore());
83
82
  onBeforeMount(() => {
84
83
  const loading = document.getElementById("preloader");
85
84
  if (loading !== null) {
@@ -1190,10 +1189,10 @@ const baseRequestInterceptor = {
1190
1189
  };
1191
1190
  const baseResponseInterceptor = {
1192
1191
  onFulfilled(response) {
1193
- var _a, _b, _c, _d;
1194
- const notHoldApiErr = response.config.notHoldApiErr !== void 0 && response.config.notHoldApiErr === true;
1192
+ var _a, _b, _c, _d, _e, _f, _g;
1193
+ const notHoldApiErr = ((_a = response.config) == null ? void 0 : _a.notHoldApiErr) !== void 0 && ((_b = response.config) == null ? void 0 : _b.notHoldApiErr) === true;
1195
1194
  if (!notHoldApiErr && response.data.code !== 0) {
1196
- const message = response.data.message || `\u63A5\u53E3\u8BF7\u6C42\u9519\u8BEF ${response.config.method}::${response.config.url}`;
1195
+ const message = response.data.message || `\u63A5\u53E3\u8BF7\u6C42\u9519\u8BEF ${response.config.method}::${(_c = response.config.url) == null ? void 0 : _c.split("?")[0]}`;
1197
1196
  if (response.data.code === 401) {
1198
1197
  MessageBox.alert("\u767B\u5F55\u4FE1\u606F\u5DF2\u8FC7\u671F\u6216\u672A\u767B\u5F55, \u662F\u5426\u8DF3\u8F6C\u767B\u5F55", "\u64CD\u4F5C\u63D0\u9192", {
1199
1198
  showClose: false,
@@ -1218,11 +1217,11 @@ const baseResponseInterceptor = {
1218
1217
  }
1219
1218
  return Promise.reject(message);
1220
1219
  }
1221
- let _message_box = (_b = (_a = response.data) == null ? void 0 : _a.data) == null ? void 0 : _b._message_box;
1220
+ let _message_box = (_e = (_d = response.data) == null ? void 0 : _d.data) == null ? void 0 : _e._message_box;
1222
1221
  if (_message_box !== void 0) {
1223
1222
  if (isString(_message_box)) {
1224
1223
  _message_box = {
1225
- message: (_d = (_c = response.data) == null ? void 0 : _c.data) == null ? void 0 : _d._message_box
1224
+ message: (_g = (_f = response.data) == null ? void 0 : _f.data) == null ? void 0 : _g._message_box
1226
1225
  };
1227
1226
  }
1228
1227
  MessageBox(__spreadValues({
@@ -1233,11 +1232,12 @@ const baseResponseInterceptor = {
1233
1232
  return response.data;
1234
1233
  },
1235
1234
  onRejected(error) {
1235
+ var _a;
1236
1236
  if (axios.isCancel(error)) {
1237
1237
  return Promise.reject("");
1238
1238
  }
1239
1239
  Message({
1240
- message: `${error.message} ${error.config.method}::${error.config.url}`,
1240
+ message: `${error.message} ${error.config.method}::${(_a = error.config.url) == null ? void 0 : _a.split("?")[0]}`,
1241
1241
  type: "error",
1242
1242
  duration: 5 * 1e3
1243
1243
  });
@@ -4809,8 +4809,9 @@ const router = createRouter({
4809
4809
  });
4810
4810
  NProgress.configure({ showSpinner: false });
4811
4811
  function nprogress(router2) {
4812
- router2.beforeEach((to, form2, next) => {
4812
+ router2.beforeEach((to, from, next) => {
4813
4813
  NProgress.start();
4814
+ to.preHash = location.hash.replace("#", "");
4814
4815
  next();
4815
4816
  });
4816
4817
  router2.afterEach((to) => {
@@ -6014,7 +6015,6 @@ function createAdmin(omsOptions) {
6014
6015
  store.dispatch("settings/updateSettings", omsOptions == null ? void 0 : omsOptions.settings).then();
6015
6016
  app2.config.globalProperties.$http = http;
6016
6017
  app2.config.globalProperties.$router = router;
6017
- app2.provide("axios", app2.config.globalProperties.$http);
6018
6018
  window.App = app2;
6019
6019
  window.OmsOptions = options;
6020
6020
  setUploadHeaderHandle(() => {