refactor(前端): `@haina/utils-request`

main
Lei OT 4 months ago
parent a88f861b13
commit 27d12a765d

@ -1,4 +1,4 @@
import { fetchJSON, postForm, } from '@/utils/request'; import { fetchJSON, postForm, } from '@haina/utils-request';
import { API_HOST } from '@/config'; import { API_HOST } from '@/config';
/** /**

@ -1,6 +1,6 @@
import { groupBy, isNotEmpty, pick, sortArrayByOrder, sortBy } from '@haina/utils-commons'; import { groupBy, isNotEmpty, pick, sortArrayByOrder, sortBy } from '@haina/utils-commons';
import { fetchJSON, postJSON, postForm } from '@/utils/request' import { fetchJSON, postJSON, postForm } from '@haina/utils-request'
import { parseRenderMessageList } from '@/channel/bubbleMsgUtils'; import { parseRenderMessageList } from '@/channel/bubbleMsgUtils';
import { API_HOST } from '@/config'; import { API_HOST } from '@/config';
import { isEmpty } from '@haina/utils-commons'; import { isEmpty } from '@haina/utils-commons';

@ -1,4 +1,4 @@
import { fetchJSON, postForm, postJSON } from '@/utils/request'; import { fetchJSON, postForm, postJSON } from '@haina/utils-request';
import { API_HOST, API_HOST_V3, DATE_FORMAT, DATEEND_FORMAT, DATETIME_FORMAT, EMAIL_HOST, EMAIL_HOST_v3 } from '@/config'; import { API_HOST, API_HOST_V3, DATE_FORMAT, DATEEND_FORMAT, DATETIME_FORMAT, EMAIL_HOST, EMAIL_HOST_v3 } from '@/config';
import { buildTree, groupBy, isEmpty, objectMapper, omitEmpty, uniqWith } from '@haina/utils-commons'; import { buildTree, groupBy, isEmpty, objectMapper, omitEmpty, uniqWith } from '@haina/utils-commons';
import { readIndexDB, writeIndexDB } from '@/utils/indexedDB'; import { readIndexDB, writeIndexDB } from '@/utils/indexedDB';

@ -1,4 +1,4 @@
import { fetchJSON, postForm, postJSON } from '@/utils/request' import { fetchJSON, postForm, postJSON } from '@haina/utils-request'
import { usingStorage } from '@/utils/usingStorage' import { usingStorage } from '@/utils/usingStorage'
const WAI_SERVER_KEY = 'G-STR:WAI_SERVER' const WAI_SERVER_KEY = 'G-STR:WAI_SERVER'

@ -36,7 +36,10 @@ import NewEmail from '@/views/NewEmail'
import EmailDetailWindow from '@/views/EmailDetailWindow' import EmailDetailWindow from '@/views/EmailDetailWindow'
import { executeDailyCleanupTask, setupDailyMidnightCleanupScheduler } from '@/utils/indexedDB' import { executeDailyCleanupTask, setupDailyMidnightCleanupScheduler } from '@/utils/indexedDB'
import { appendRequestHeader } from '@haina/utils-request';
import { BUILD_VERSION } from '@/config'
appendRequestHeader('X-Web-Version', BUILD_VERSION);
useAuthStore.getState().loadUserSession() useAuthStore.getState().loadUserSession()
const isMobileApp = const isMobileApp =

@ -1,6 +1,6 @@
import { create } from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import { fetchJSON } from '@/utils/request' import { fetchJSON } from '@haina/utils-request'
import { isEmpty, isNotEmpty } from '@haina/utils-commons' import { isEmpty, isNotEmpty } from '@haina/utils-commons'
import { API_HOST, BUILD_VERSION } from '@/config' import { API_HOST, BUILD_VERSION } from '@/config'
import { usingStorage } from '@/utils/usingStorage'; import { usingStorage } from '@/utils/usingStorage';

@ -1,6 +1,6 @@
import { create } from "zustand"; import { create } from "zustand";
import { VonageClient, ClientConfig, ConfigRegion, LoggingLevel } from '@vonage/client-sdk' import { VonageClient, ClientConfig, ConfigRegion, LoggingLevel } from '@vonage/client-sdk'
import { fetchJSON } from "@/utils/request"; import { fetchJSON } from "@haina/utils-request";
import { prepareUrl, isNotEmpty, } from "@haina/utils-commons"; import { prepareUrl, isNotEmpty, } from "@haina/utils-commons";
import { VONAGE_URL, DATETIME_FORMAT } from "@/config"; import { VONAGE_URL, DATETIME_FORMAT } from "@/config";
import dayjs from "dayjs"; import dayjs from "dayjs";

@ -1,6 +1,6 @@
import { create } from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import { fetchJSON, postForm } from '@/utils/request' import { fetchJSON, postForm } from '@haina/utils-request'
import { HT3, EMAIL_HOST } from '@/config' import { HT3, EMAIL_HOST } from '@/config'
import { isNotEmpty, prepareUrl } from '@haina/utils-commons' import { isNotEmpty, prepareUrl } from '@haina/utils-commons'

@ -1,6 +1,6 @@
import { create } from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import { fetchJSON, postForm, postJSON } from '@/utils/request' import { fetchJSON, postForm, postJSON } from '@haina/utils-request'
import { API_HOST, API_HOST_V3, EMAIL_HOST } from '@/config' import { API_HOST, API_HOST_V3, EMAIL_HOST } from '@/config'
import { isEmpty, isNotEmpty, prepareUrl, uniqWith } from '@haina/utils-commons' import { isEmpty, isNotEmpty, prepareUrl, uniqWith } from '@haina/utils-commons'

@ -1,6 +1,6 @@
import { create } from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import { fetchJSON, postForm } from '@/utils/request' import { fetchJSON, postForm } from '@haina/utils-request'
import { API_HOST } from '@/config' import { API_HOST } from '@/config'
import { copy } from '@haina/utils-commons' import { copy } from '@haina/utils-commons'

@ -1,5 +1,5 @@
import { loadScript } from '@haina/utils-commons' import { loadScript } from '@haina/utils-commons'
import { fetchJSON } from '@/utils/request' import { fetchJSON } from '@haina/utils-request'
import { readWebsocketLog } from '@/utils/indexedDB' import { readWebsocketLog } from '@/utils/indexedDB'
import { BUILD_VERSION, BUILD_DATE } from '@/config' import { BUILD_VERSION, BUILD_DATE } from '@/config'

@ -14,7 +14,7 @@ import zhLocale from 'antd/locale/zh_CN'
import 'dayjs/locale/zh-cn' import 'dayjs/locale/zh-cn'
import { useEffect } from 'react' import { useEffect } from 'react'
import { Outlet, useHref, useNavigate } from 'react-router-dom' import { Outlet, useHref, useNavigate } from 'react-router-dom'
import { appendRequestHeader } from '@/utils/request' import { appendRequestHeader } from '@haina/utils-request'
import { loadPageSpy } from '@haina/utils-pagespy' import { loadPageSpy } from '@haina/utils-pagespy'
import AppLogo from '@/assets/highlights_travel_300_300.png' import AppLogo from '@/assets/highlights_travel_300_300.png'

@ -2,7 +2,7 @@ import { useState } from 'react'
import { App, Modal, Button, Table, Form, Row, Col, Input, Checkbox } from 'antd' import { App, Modal, Button, Table, Form, Row, Col, Input, Checkbox } from 'antd'
import { ApiOutlined } from '@ant-design/icons' import { ApiOutlined } from '@ant-design/icons'
import { isEmpty, cloneDeep } from '@haina/utils-commons' import { isEmpty, cloneDeep } from '@haina/utils-commons'
import { fetchJSON } from '@/utils/request' import { fetchJSON } from '@haina/utils-request'
import AdvanceSearchForm from '../../../orders/AdvanceSearchForm' import AdvanceSearchForm from '../../../orders/AdvanceSearchForm'
import { API_HOST } from '@/config' import { API_HOST } from '@/config'
import dayjs from 'dayjs' import dayjs from 'dayjs'

@ -1,7 +1,7 @@
import { useState } from 'react'; import { useState } from 'react';
import { App, Modal, Button, Table } from 'antd'; import { App, Modal, Button, Table } from 'antd';
import { isEmpty, cloneDeep } from '@haina/utils-commons'; import { isEmpty, cloneDeep } from '@haina/utils-commons';
import { fetchJSON } from '@/utils/request'; import { fetchJSON } from '@haina/utils-request';
import AdvanceSearchForm from './../../orders/AdvanceSearchForm'; import AdvanceSearchForm from './../../orders/AdvanceSearchForm';
import { API_HOST } from '@/config'; import { API_HOST } from '@/config';
import dayjs from 'dayjs'; import dayjs from 'dayjs';

Loading…
Cancel
Save