From cc4b544b2e8f9c69935a7264b37d1dcf90d4e69f Mon Sep 17 00:00:00 2001 From: wang_yp <357754663@qq.com> Date: Thu, 19 Sep 2024 23:30:29 +0800 Subject: [PATCH] fix(api):update store --- src/App.tsx | 7 +- src/components/errorComp.tsx | 4 +- src/components/form/interface.ts | 1 + src/components/form/select.tsx | 2 +- src/components/form/simple_form.tsx | 4 +- src/pages/archives/archives_conf.ts | 40 ++++++++ src/pages/archives/index.tsx | 94 ++++++++++--------- src/pages/dep/index.tsx | 3 +- src/pages/tag/tag.tsx | 3 +- src/pages/user/user.tsx | 3 +- src/service/apiConfig/active.ts | 8 -- src/service/apiConfig/activity_config.ts | 8 -- src/service/apiConfig/activity_type_config.ts | 7 -- src/service/apiConfig/app_config.ts | 16 ---- src/service/apiConfig/card_config.ts | 25 ----- src/service/apiConfig/componsition_config.ts | 8 -- src/service/apiConfig/dynamic_config.ts | 8 -- src/service/apiConfig/merchants_config.ts | 8 -- src/service/apiConfig/product_unit_config.ts | 8 -- src/service/apiConfig/project_config.ts | 8 -- src/service/apiConfig/project_type_config.ts | 8 -- src/service/apiConfig/system_config.ts | 7 -- src/service/apiConfig/user_config.ts | 9 -- src/store/archives.ts | 8 +- src/store/archives_category.ts | 20 ++++ src/store/baseStore.ts | 71 ++++++++------ src/store/folder.ts | 20 ++++ src/store/index.ts | 6 +- src/store/{user/index.ts => user.ts} | 16 ++-- 29 files changed, 205 insertions(+), 225 deletions(-) create mode 100644 src/pages/archives/archives_conf.ts delete mode 100644 src/service/apiConfig/active.ts delete mode 100644 src/service/apiConfig/activity_config.ts delete mode 100644 src/service/apiConfig/activity_type_config.ts delete mode 100644 src/service/apiConfig/app_config.ts delete mode 100644 src/service/apiConfig/card_config.ts delete mode 100644 src/service/apiConfig/componsition_config.ts delete mode 100644 src/service/apiConfig/dynamic_config.ts delete mode 100644 src/service/apiConfig/merchants_config.ts delete mode 100644 src/service/apiConfig/product_unit_config.ts delete mode 100644 src/service/apiConfig/project_config.ts delete mode 100644 src/service/apiConfig/project_type_config.ts delete mode 100644 src/service/apiConfig/system_config.ts delete mode 100644 src/service/apiConfig/user_config.ts create mode 100644 src/store/archives_category.ts create mode 100644 src/store/folder.ts rename src/store/{user/index.ts => user.ts} (82%) diff --git a/src/App.tsx b/src/App.tsx index a52eaff..d0da5d0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,11 +1,11 @@ import { inject, observer } from "mobx-react"; -// import Home from "./pages/home/home"; import { Modal } from "antd"; import { Store } from "antd/lib/form/interface"; import { Outlet } from "react-router"; import SimpleForm from "./components/form/simple_form"; import { FormInstance } from "antd/lib/form"; import React from "react"; +import MyComponent from "./components/errorComp"; const App = (props: Store) => { const { usrStore } = props; const formRef = React.useRef(null); @@ -34,7 +34,10 @@ const App = (props: Store) => { const onFinishFailed = () => {}; return ( <> - + + + + {this.state.hasError ? 'Error' : this.props.chi}; + return
{this.state.hasError ? 'Error' : this.props.children}
; } } diff --git a/src/components/form/interface.ts b/src/components/form/interface.ts index 896c6d1..c3d7116 100644 --- a/src/components/form/interface.ts +++ b/src/components/form/interface.ts @@ -13,6 +13,7 @@ export interface SimpleFormData { subBtnName?: string, formName: string, colProps: number, + span?: number, initialValues?: Object | null | undefined, onFinish: Function, formRef?: React.RefObject>, diff --git a/src/components/form/select.tsx b/src/components/form/select.tsx index e82124a..7fa49de 100644 --- a/src/components/form/select.tsx +++ b/src/components/form/select.tsx @@ -7,7 +7,7 @@ export const FormSelect = (v: FormDatas) => { const [list, setList] = useState([]); useEffect(() => { baseHttp - .get(`${v.selectUrl}/?pageSize=100&pageNum=1` ?? "", "") + .get(`${v.selectUrl}/?size=100&offset=1` ?? "", "") .then((res) => { setList(res.data.record ?? []); }); diff --git a/src/components/form/simple_form.tsx b/src/components/form/simple_form.tsx index 7b6abe5..4d890e7 100644 --- a/src/components/form/simple_form.tsx +++ b/src/components/form/simple_form.tsx @@ -20,8 +20,8 @@ const SimpleForm = (props: SimpleFormData) => { name={props.formName} ref={props.formRef} form={form} - labelCol={{ span: 4 }} - wrapperCol={{ span: 8 }} + labelCol={{ span: props.span??4 }} + wrapperCol={{ span: props.colProps }} layout="horizontal" initialValues={{ menubar: true }} onFinish={onFinish} diff --git a/src/pages/archives/archives_conf.ts b/src/pages/archives/archives_conf.ts new file mode 100644 index 0000000..34b7013 --- /dev/null +++ b/src/pages/archives/archives_conf.ts @@ -0,0 +1,40 @@ +export const folderConfig = [ + { + type: "input", + label: "所属档案分类", + name: "ac_identity", + value: "", + }, + { + type: "input", + label: "文件夹名称", + name: "folder_name", + value: "", + }, + { + type: "input", + label: "文件夹描述", + name: "folder_desc", + value: "", + }, +]; + +// 档案配置 +export const catConfig = [ + { + type: "input", + label: "所属档案分类名称", + name: "ac_identity", + value: "", + }, +]; + +// 档案配置 +export const archiveConfig = [ + { + type: "input", + label: "所属档案分类", + name: "ac_identity", + value: "", + }, +]; \ No newline at end of file diff --git a/src/pages/archives/index.tsx b/src/pages/archives/index.tsx index 97be7b5..5b43c78 100644 --- a/src/pages/archives/index.tsx +++ b/src/pages/archives/index.tsx @@ -5,9 +5,9 @@ import { Store } from "antd/lib/form/interface"; import SimpleForm from "@/components/form/simple_form"; import React from "react"; import FolderTwoTone from "@ant-design/icons/FolderOpenTwoTone"; - +import { folderConfig, catConfig, archiveConfig } from "./archives_conf"; const Archives = (props: Store) => { - const { archivesStore } = props; + const { folderStore, acStore } = props; const [isModalOpen, setIsModalOpen] = useState(false); const [projectConfig, setProjectConfig] = useState([]); const formRef = React.useRef(null); @@ -17,76 +17,78 @@ const Archives = (props: Store) => { let data = values; data.head_img = values.head_img[0].url; if (!tagId) { - archivesStore.add(data); + folderStore.add(data); } else { - archivesStore.putItem(tagId, data); + folderStore.putItem(tagId, data); } setIsModalOpen(false); }; useEffect(() => { - archivesStore.getlist("folder/list"); - }, [archivesStore]); - const defaultConfig = [ - { - type: "input", - label: "所属档案分类", - name: "ac_identity", - value: "", - }, - { - type: "input", - label: "文件夹名称", - name: "folder_name", - value: "", - }, - { - type: "input", - label: "文件夹描述", - name: "folder_desc", - value: "", - }, - ]; + folderStore.getlist(); + acStore.getlist(); + }, [folderStore, acStore]); + + // 添加事件 + const addHandler = () => { + setProjectConfig(folderConfig); + setIsModalOpen(true); + }; + + // 取消 + const cancelHandler = () => { + setId(null); + setIsModalOpen(false); + }; + + // 文件夹点击 + const folderHandle = () => {}; + const addCatHandler = () => { + setProjectConfig(catConfig); + setIsModalOpen(true); + }; + + const addArchivesHandler = () => { + setProjectConfig(archiveConfig); + setIsModalOpen(true); + }; const onFinishFailed = () => {}; return (
- + + - {Array.from({ length: archivesStore.list?.length??0 }, (_, i) => ( -
+ {Array.from({ length: folderStore.list?.length ?? 0 }, (_, i) => ( +
-

{archivesStore.list[i].folder_name}

+

{folderStore.list[i].folder_name}

))} formRef.current?.resetFields()} onOk={() => formRef.current?.submit()} - onCancel={() => { - setId(null); - setIsModalOpen(false); - }} + onCancel={cancelHandler} > {}} formName="card_basic" - colProps={4} + colProps={12} + span={6} subBtnName="提交" formDatas={projectConfig} onFinish={onFinish} @@ -99,4 +101,6 @@ const Archives = (props: Store) => { ); }; -export default inject("archivesStore")(observer(Archives)); +export default inject(...["archivesStore", "folderStore", "acStore"])( + observer(Archives) +); diff --git a/src/pages/dep/index.tsx b/src/pages/dep/index.tsx index 8467d48..c84a018 100644 --- a/src/pages/dep/index.tsx +++ b/src/pages/dep/index.tsx @@ -3,7 +3,6 @@ import { inject, observer } from "mobx-react"; import type { ColumnsType } from "antd/es/table"; import BTable from "@/components/b_table"; import { useEffect, useState } from "react"; -import UserConfig from "@/service/apiConfig/user_config"; import { UserDataType } from "@/model/userModel"; import { Store } from "antd/lib/form/interface"; import SimpleForm from "@/components/form/simple_form"; @@ -73,7 +72,7 @@ const Dep = (props: Store) => { setIsModalOpen(false); }; useEffect(() => { - depStore.getlist(UserConfig.LIST); + depStore.getlist(); }, [depStore]); const defaultConfig = [ { diff --git a/src/pages/tag/tag.tsx b/src/pages/tag/tag.tsx index 9bc7c2f..1c29c57 100644 --- a/src/pages/tag/tag.tsx +++ b/src/pages/tag/tag.tsx @@ -3,7 +3,6 @@ import { inject, observer } from "mobx-react"; import type { ColumnsType } from "antd/es/table"; import BTable from "@/components/b_table"; import { useEffect, useState } from "react"; -import UserConfig from "@/service/apiConfig/user_config"; import { UserDataType } from "@/model/userModel"; import { Store } from "antd/lib/form/interface"; import SimpleForm from "@/components/form/simple_form"; @@ -63,7 +62,7 @@ const Tag = (props: Store) => { setIsModalOpen(false); }; useEffect(() => { - tagStore.getlist(UserConfig.LIST); + tagStore.getlist(); }, [tagStore]); const defaultConfig = [ { diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx index 4c504b0..f2ec4e9 100644 --- a/src/pages/user/user.tsx +++ b/src/pages/user/user.tsx @@ -3,7 +3,6 @@ import { inject, observer } from "mobx-react"; import type { ColumnsType } from "antd/es/table"; import BTable from "@/components/b_table"; import { useEffect, useState } from "react"; -import UserConfig from "@/service/apiConfig/user_config"; import { UserDataType } from "@/model/userModel"; import { Store } from "antd/lib/form/interface"; import "./user.less"; @@ -105,7 +104,7 @@ const User = (props: Store) => { setIsModalOpen(false); }; useEffect(() => { - usrStore.getlist(UserConfig.LIST); + usrStore.getlist(); }, [usrStore]); const defaultConfig = [ { diff --git a/src/service/apiConfig/active.ts b/src/service/apiConfig/active.ts deleted file mode 100644 index 4a2e19a..0000000 --- a/src/service/apiConfig/active.ts +++ /dev/null @@ -1,8 +0,0 @@ -class ActiveConfig { - static LIST = "active" - static LISTPo = "active" - static ADD = "active" - static DELETE = "active" - static EDIT = "active" -} -export default ActiveConfig; \ No newline at end of file diff --git a/src/service/apiConfig/activity_config.ts b/src/service/apiConfig/activity_config.ts deleted file mode 100644 index 5ff3ba0..0000000 --- a/src/service/apiConfig/activity_config.ts +++ /dev/null @@ -1,8 +0,0 @@ -class ActivityConfig { - static LIST = "activity/list" - static LISTPo = "activity" - static ADD = "activity" - static DELETE = "activity" - static EDIT = "activity" -} -export default ActivityConfig; \ No newline at end of file diff --git a/src/service/apiConfig/activity_type_config.ts b/src/service/apiConfig/activity_type_config.ts deleted file mode 100644 index 4ae6742..0000000 --- a/src/service/apiConfig/activity_type_config.ts +++ /dev/null @@ -1,7 +0,0 @@ -class ActivityTypeConfig { - static LIST = "activityType/list" - static ADD = "activityType" - static DELETE = "activityType" - static EDIT = "activityType" -} -export default ActivityTypeConfig; \ No newline at end of file diff --git a/src/service/apiConfig/app_config.ts b/src/service/apiConfig/app_config.ts deleted file mode 100644 index 789e282..0000000 --- a/src/service/apiConfig/app_config.ts +++ /dev/null @@ -1,16 +0,0 @@ -class AppConfig { - static LIST = "app/list" - static LISTPo = "app" - static ADD = "app" - static DELETE = "app" - static EDIT = "app" - static XIAOMIAPPPUSH = "app/push/xiaomi/" // 小米推送配置信息 - static VIVOAPPPUSH = "app/push/vivo/" // vivo推送配置信息 - static OPPOAPPPUSH = "app/push/oppo/" // oppo推送配置信息 - static HUAWEIAPPPUSH = "app/push/huawei/" // huawei推送配置信息 - static IOSAPPPUSH = "app/push/ios/" // ios推送配置信息 - static WechatConfig = "app/wechatConfig/" // 微信配置信息 - static ALCONFIG = "app/alConfig/" // 微信配置信息 - -} -export default AppConfig; \ No newline at end of file diff --git a/src/service/apiConfig/card_config.ts b/src/service/apiConfig/card_config.ts deleted file mode 100644 index 40583db..0000000 --- a/src/service/apiConfig/card_config.ts +++ /dev/null @@ -1,25 +0,0 @@ -class CardConfig { - static LIST = "card_admin" - static LISTPo = "composition_admin" - static ADD = "card" - static DELETE = "card" - static EDIT = "card" -} - -class characterConfig { - static LIST = "character" - static ADD = "character" - static DELETE = "character" - static EDIT = "character" -} - -class currentEvenConfig { - static LIST = "currentEvent" - static ADD = "currentEvent" - static DELETE = "currentEvent" - static EDIT = "currentEvent" -} - - -// eslint-disable-next-line import/no-anonymous-default-export -export default { CardConfig, characterConfig,currentEvenConfig }; \ No newline at end of file diff --git a/src/service/apiConfig/componsition_config.ts b/src/service/apiConfig/componsition_config.ts deleted file mode 100644 index fa9de5b..0000000 --- a/src/service/apiConfig/componsition_config.ts +++ /dev/null @@ -1,8 +0,0 @@ -class componsitionConfig { - static LIST = "apis/v1/composition_admin" - static ADD = "apis/v1/composition" - static DELETE = "apis/v1/composition" - static EDIT = "apis/v1/composition" -} - -export default componsitionConfig; \ No newline at end of file diff --git a/src/service/apiConfig/dynamic_config.ts b/src/service/apiConfig/dynamic_config.ts deleted file mode 100644 index bd2ef52..0000000 --- a/src/service/apiConfig/dynamic_config.ts +++ /dev/null @@ -1,8 +0,0 @@ -class DynamicConfig { - static LIST: string = "dynamic/list" - static ADD: string = "dynamic" - static DELETE: string = "dynamic" - static EDIT: string = "dynamic" -} - -export default DynamicConfig; \ No newline at end of file diff --git a/src/service/apiConfig/merchants_config.ts b/src/service/apiConfig/merchants_config.ts deleted file mode 100644 index 5a02982..0000000 --- a/src/service/apiConfig/merchants_config.ts +++ /dev/null @@ -1,8 +0,0 @@ -class MerchantsConfig { - static LIST: string = "merchants/list" - static ADD: string = "merchants" - static DELETE: string = "merchants" - static EDIT: string = "merchants" -} - -export default MerchantsConfig; \ No newline at end of file diff --git a/src/service/apiConfig/product_unit_config.ts b/src/service/apiConfig/product_unit_config.ts deleted file mode 100644 index 7f77b0c..0000000 --- a/src/service/apiConfig/product_unit_config.ts +++ /dev/null @@ -1,8 +0,0 @@ -class productUnit { - static LIST: string = "productUnit/list" - static ADD: string = "productUnit" - static DELETE: string = "productUnit" - static EDIT: string = "productUnit" -} - -export default productUnit; \ No newline at end of file diff --git a/src/service/apiConfig/project_config.ts b/src/service/apiConfig/project_config.ts deleted file mode 100644 index 28baaa4..0000000 --- a/src/service/apiConfig/project_config.ts +++ /dev/null @@ -1,8 +0,0 @@ -class ProjectConfig { - static LIST: string = "project/list" - static ADD: string = "project" - static DELETE: string = "project" - static EDIT: string = "project" -} - -export default ProjectConfig; \ No newline at end of file diff --git a/src/service/apiConfig/project_type_config.ts b/src/service/apiConfig/project_type_config.ts deleted file mode 100644 index 2f23144..0000000 --- a/src/service/apiConfig/project_type_config.ts +++ /dev/null @@ -1,8 +0,0 @@ -class ProjectType { - static LIST: string = "productType/list" - static ADD: string = "productType" - static DELETE: string = "productType" - static EDIT: string = "productType" -} - -export default ProjectType; \ No newline at end of file diff --git a/src/service/apiConfig/system_config.ts b/src/service/apiConfig/system_config.ts deleted file mode 100644 index b21f20f..0000000 --- a/src/service/apiConfig/system_config.ts +++ /dev/null @@ -1,7 +0,0 @@ -class SystemConfig { - static BannerList: string = "system/banner" - static AddImages: string = "system/image" - static AddBanner: string = "system/banner" -} - -export default SystemConfig; \ No newline at end of file diff --git a/src/service/apiConfig/user_config.ts b/src/service/apiConfig/user_config.ts deleted file mode 100644 index 0842c46..0000000 --- a/src/service/apiConfig/user_config.ts +++ /dev/null @@ -1,9 +0,0 @@ -class UserConfig { - static LOGINURI: string = "anth/login" - static LIST: string = "userMgmt/user/list" - static ADD: string = "user" - static DELETE: string = "user" - static EDIT: string = "user" -} - -export default UserConfig; \ No newline at end of file diff --git a/src/store/archives.ts b/src/store/archives.ts index 2ff3179..dedf065 100644 --- a/src/store/archives.ts +++ b/src/store/archives.ts @@ -4,7 +4,7 @@ import BaseStore from "./baseStore"; import { TagDataType } from "@/model/userModel"; class ArchivesConfig { - static LIST: string = "archives/folder/list" + static LIST: string = "archives/list" static ADD: string = "archives" static DELETE: string = "archives" static EDIT: string = "archives" @@ -15,7 +15,5 @@ class ArchivesStore extends BaseStore { makeObservable(this, {}) } } - -// eslint-disable-next-line import/no-anonymous-default-export -export default new ArchivesStore(); - \ No newline at end of file +const archivesStore = new ArchivesStore() +export default archivesStore; diff --git a/src/store/archives_category.ts b/src/store/archives_category.ts new file mode 100644 index 0000000..4faed96 --- /dev/null +++ b/src/store/archives_category.ts @@ -0,0 +1,20 @@ +import { makeObservable } from "mobx"; +// 用户信息 +import BaseStore from "./baseStore"; +import { TagDataType } from "@/model/userModel"; + + +class ArchivesCategoryConfig { + static LIST: string = "archives/category/list" + static ADD: string = "archives/category" + static DELETE: string = "archives/category" + static EDIT: string = "archives/category" +} +class ArchivesCategoryStore extends BaseStore { + constructor() { + super(ArchivesCategoryConfig) + makeObservable(this, {}) + } +} +const acStore = new ArchivesCategoryStore() +export default acStore; diff --git a/src/store/baseStore.ts b/src/store/baseStore.ts index 426db1a..5028c58 100644 --- a/src/store/baseStore.ts +++ b/src/store/baseStore.ts @@ -11,7 +11,7 @@ interface BaseStoreInterface { total: number page: Pages setPages(pages: Pages): any - listStatus:boolean | null | undefined + listStatus: boolean | null | undefined } class BaseStore implements BaseStoreInterface { @@ -27,15 +27,19 @@ class BaseStore implements BaseStoreInterface { total: observable, page: observable, add: action, - listStatus:observable, + listStatus: observable, }) this.urlConfig = urlConfig; } - + // 删除 async deleteItem(id: number) { - await baseHttp.delete(this.urlConfig.DELETE + "/" + id, {}) - this.getlist() + try { + await baseHttp.delete(this.urlConfig.DELETE + "/" + id, {}) + this.getlist() + } catch (error) { + + } } // 分页 setPages(page: Pages) { @@ -44,42 +48,55 @@ class BaseStore implements BaseStoreInterface { } // 添加 async add(param: any) { - await baseHttp.post(this.urlConfig.ADD, param) - this.getlist(); + try { + await baseHttp.post(this.urlConfig.ADD, param) + this.getlist() + } catch (error) { + + } } // 更新 async putItem(id: string, param: any) { - await baseHttp.put(this.urlConfig.EDIT + "/" + id, param) - this.getlist() + try { + await baseHttp.put(this.urlConfig.EDIT + "/" + id, param) + this.getlist() + } catch (error) { + + } } // 获取列表 async getlist() { this.listStatus = true; - let res = await baseHttp.get(this.urlConfig.LIST, { - size: this.page?.Size | 20, - offset: this.page?.Offset | 1, - }); - let data: Array = [] - if (!res.data.record) { + try { + let res = await baseHttp.get(this.urlConfig.LIST, { + size: this.page?.Size | 20, + offset: this.page?.Offset | 1, + }); + let data: Array = [] + if (!res.data.record) { + runInAction(() => { + this.list = data; + }) + this.listStatus = false; + return; + } + for (let i = 0; i < res.data.record.length; i++) { + data.push({ + key: res.data.record[i].id, + ...res.data.record[i] + }) + } runInAction(() => { this.list = data; + this.total = res.data.count }) this.listStatus = false; - return; + } catch (error) { + this.listStatus = false; + console.log(error); } - for (let i = 0; i < res.data.record.length; i++) { - data.push({ - key: res.data.record[i].id, - ...res.data.record[i] - }) - } - runInAction(() => { - this.list = data; - this.total = res.data.count - }) - this.listStatus = false; } list!: Array; item!: B | null | string diff --git a/src/store/folder.ts b/src/store/folder.ts new file mode 100644 index 0000000..15cd4ff --- /dev/null +++ b/src/store/folder.ts @@ -0,0 +1,20 @@ +import { makeObservable } from "mobx"; +// 用户信息 +import BaseStore from "./baseStore"; +import { TagDataType } from "@/model/userModel"; + +class FolderConfig { + static LIST: string = "archives/folder/list" + static ADD: string = "archives/folder" + static DELETE: string = "archives/folder" + static EDIT: string = "archives/folder" +} +class FolderStore extends BaseStore { + constructor() { + super(FolderConfig) + makeObservable(this, {}) + } +} +const folderStore = new FolderStore() +export default folderStore; + diff --git a/src/store/index.ts b/src/store/index.ts index 740877d..bed25ee 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -2,12 +2,16 @@ import usrStore from '@/store/user' import tagStore from '@/store/tag' import depStore from '@/store/dep' import archivesStore from '@/store/archives' +import folderStore from '@/store/folder'; +import acStore from '@/store/archives_category'; const store = { usrStore, tagStore, depStore, - archivesStore + archivesStore, + folderStore, + acStore }; export default store; \ No newline at end of file diff --git a/src/store/user/index.ts b/src/store/user.ts similarity index 82% rename from src/store/user/index.ts rename to src/store/user.ts index 2184ce3..d79bb33 100644 --- a/src/store/user/index.ts +++ b/src/store/user.ts @@ -1,10 +1,15 @@ -import UserConfig from "@/service/apiConfig/user_config"; import { action, computed, makeObservable, observable } from "mobx"; // 用户信息 import baseHttp from "@/service/base"; -import BaseStore from "../baseStore"; +import BaseStore from "./baseStore"; import { UserDataType, UserInfos } from "@/model/userModel"; - +class UserConfig { + static LOGINURI: string = "anth/login" + static LIST: string = "userMgmt/user/list" + static ADD: string = "user" + static DELETE: string = "user" + static EDIT: string = "user" +} class UserStore extends BaseStore { _userinfo: UserInfos = {}; // 用户信息 isNeedLogin: boolean = false; // 是否需要登录 @@ -49,6 +54,5 @@ class UserStore extends BaseStore { this.isNeedLogin = false; } } - -// eslint-disable-next-line import/no-anonymous-default-export -export default new UserStore(); \ No newline at end of file +const userStore = new UserStore(); +export default userStore; \ No newline at end of file