fix(api):update store
This commit is contained in:
parent
3e877a15b5
commit
cc4b544b2e
|
@ -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<FormInstance>(null);
|
||||
|
@ -34,7 +34,10 @@ const App = (props: Store) => {
|
|||
const onFinishFailed = () => {};
|
||||
return (
|
||||
<>
|
||||
<Outlet />
|
||||
<MyComponent>
|
||||
<Outlet />
|
||||
</MyComponent>
|
||||
|
||||
<Modal
|
||||
title="登录"
|
||||
className="owner_model"
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from "react";
|
|||
|
||||
interface MyComponentProps {
|
||||
hasError?: boolean;
|
||||
chi?: React.ReactNode;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
interface MyComponentState {
|
||||
|
@ -19,7 +19,7 @@ interface MyComponentProps {
|
|||
|
||||
render() {
|
||||
// 现在你可以安全地访问 this.state.hasError
|
||||
return <div>{this.state.hasError ? 'Error' : this.props.chi}</div>;
|
||||
return <div>{this.state.hasError ? 'Error' : this.props.children}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ export interface SimpleFormData {
|
|||
subBtnName?: string,
|
||||
formName: string,
|
||||
colProps: number,
|
||||
span?: number,
|
||||
initialValues?: Object | null | undefined,
|
||||
onFinish: Function,
|
||||
formRef?: React.RefObject<FormInstance<any>>,
|
||||
|
|
|
@ -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 ?? []);
|
||||
});
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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: "",
|
||||
},
|
||||
];
|
|
@ -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<boolean>(false);
|
||||
const [projectConfig, setProjectConfig] = useState<any>([]);
|
||||
const formRef = React.useRef<FormInstance>(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 (
|
||||
<div className="contentBox">
|
||||
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||
<Space direction="horizontal" size={"middle"}>
|
||||
<Button
|
||||
type="default"
|
||||
onClick={() => {
|
||||
setProjectConfig(defaultConfig);
|
||||
setId(null);
|
||||
setIsModalOpen(true);
|
||||
}}
|
||||
>
|
||||
添加
|
||||
<Button type="default" onClick={addHandler}>
|
||||
创建文件夹
|
||||
</Button>
|
||||
<Button type="default" onClick={addCatHandler}>
|
||||
添加档案类别
|
||||
</Button>
|
||||
<Button type="default" onClick={addArchivesHandler}>
|
||||
上传档案
|
||||
</Button>
|
||||
</Space>
|
||||
<Flex wrap gap="25px" justify="start">
|
||||
{Array.from({ length: archivesStore.list?.length??0 }, (_, i) => (
|
||||
<div key={i}>
|
||||
{Array.from({ length: folderStore.list?.length ?? 0 }, (_, i) => (
|
||||
<div key={i} onClick={folderHandle}>
|
||||
<FolderTwoTone rotate={-270} style={{ fontSize: "120px" }} />
|
||||
<p>{archivesStore.list[i].folder_name}</p>
|
||||
<p>{folderStore.list[i].folder_name}</p>
|
||||
</div>
|
||||
))}
|
||||
</Flex>
|
||||
|
||||
<Modal
|
||||
title={!tagId ? "添加文件夹" : "编辑文件夹"}
|
||||
width={800}
|
||||
width={600}
|
||||
open={isModalOpen}
|
||||
afterClose={() => formRef.current?.resetFields()}
|
||||
onOk={() => formRef.current?.submit()}
|
||||
onCancel={() => {
|
||||
setId(null);
|
||||
setIsModalOpen(false);
|
||||
}}
|
||||
onCancel={cancelHandler}
|
||||
>
|
||||
<SimpleForm
|
||||
formRef={formRef}
|
||||
createCallback={() => {}}
|
||||
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)
|
||||
);
|
||||
|
|
|
@ -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 = [
|
||||
{
|
||||
|
|
|
@ -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 = [
|
||||
{
|
||||
|
|
|
@ -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 = [
|
||||
{
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
class ActiveConfig {
|
||||
static LIST = "active"
|
||||
static LISTPo = "active"
|
||||
static ADD = "active"
|
||||
static DELETE = "active"
|
||||
static EDIT = "active"
|
||||
}
|
||||
export default ActiveConfig;
|
|
@ -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;
|
|
@ -1,7 +0,0 @@
|
|||
class ActivityTypeConfig {
|
||||
static LIST = "activityType/list"
|
||||
static ADD = "activityType"
|
||||
static DELETE = "activityType"
|
||||
static EDIT = "activityType"
|
||||
}
|
||||
export default ActivityTypeConfig;
|
|
@ -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;
|
|
@ -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 };
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -1,7 +0,0 @@
|
|||
class SystemConfig {
|
||||
static BannerList: string = "system/banner"
|
||||
static AddImages: string = "system/image"
|
||||
static AddBanner: string = "system/banner"
|
||||
}
|
||||
|
||||
export default SystemConfig;
|
|
@ -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;
|
|
@ -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<TagDataType> {
|
|||
makeObservable(this, {})
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line import/no-anonymous-default-export
|
||||
export default new ArchivesStore();
|
||||
|
||||
const archivesStore = new ArchivesStore()
|
||||
export default archivesStore;
|
||||
|
|
|
@ -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<TagDataType> {
|
||||
constructor() {
|
||||
super(ArchivesCategoryConfig)
|
||||
makeObservable(this, {})
|
||||
}
|
||||
}
|
||||
const acStore = new ArchivesCategoryStore()
|
||||
export default acStore;
|
|
@ -11,7 +11,7 @@ interface BaseStoreInterface<T> {
|
|||
total: number
|
||||
page: Pages
|
||||
setPages(pages: Pages): any
|
||||
listStatus:boolean | null | undefined
|
||||
listStatus: boolean | null | undefined
|
||||
}
|
||||
|
||||
class BaseStore<B> implements BaseStoreInterface<B> {
|
||||
|
@ -27,15 +27,19 @@ class BaseStore<B> implements BaseStoreInterface<B> {
|
|||
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<B> implements BaseStoreInterface<B> {
|
|||
}
|
||||
// 添加
|
||||
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<B> = []
|
||||
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<B> = []
|
||||
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<B>;
|
||||
item!: B | null | string
|
||||
|
|
|
@ -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<TagDataType> {
|
||||
constructor() {
|
||||
super(FolderConfig)
|
||||
makeObservable(this, {})
|
||||
}
|
||||
}
|
||||
const folderStore = new FolderStore()
|
||||
export default folderStore;
|
||||
|
|
@ -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;
|
|
@ -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<UserDataType> {
|
||||
_userinfo: UserInfos = {}; // 用户信息
|
||||
isNeedLogin: boolean = false; // 是否需要登录
|
||||
|
@ -49,6 +54,5 @@ class UserStore extends BaseStore<UserDataType> {
|
|||
this.isNeedLogin = false;
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line import/no-anonymous-default-export
|
||||
export default new UserStore();
|
||||
const userStore = new UserStore();
|
||||
export default userStore;
|
Loading…
Reference in New Issue