ldap开关联动部门、学员的新建、编辑、删除、排序、导入

This commit is contained in:
unknown
2023-09-06 11:30:41 +08:00
parent 3d29dd8963
commit 4122a2ac39
7 changed files with 190 additions and 114 deletions

View File

@@ -12,13 +12,18 @@ import {
Slider,
Space,
} from "antd";
// import styles from "./index.module.less";
import { appConfig } from "../../../api/index";
import { appConfig, system } from "../../../api/index";
import { UploadImageButton } from "../../../compenents";
import { useDispatch } from "react-redux";
import type { TabsProps } from "antd";
import type { CheckboxChangeEvent } from "antd/es/checkbox";
import {
SystemConfigStoreInterface,
saveConfigAction,
} from "../../../store/system/systemConfigSlice";
const SystemConfigPage = () => {
const dispatch = useDispatch();
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const [logo, setLogo] = useState("");
@@ -239,6 +244,23 @@ const SystemConfigPage = () => {
message.success("保存成功!");
setLoading(false);
getDetail();
getSystemConfig();
});
};
const getSystemConfig = async () => {
system.getSystemConfig().then((res: any) => {
let data: SystemConfigStoreInterface = {
"ldap-enabled": res.data["ldap-enabled"],
systemName: res.data["system.name"],
systemLogo: res.data["system.logo"],
systemApiUrl: res.data["system.api_url"],
systemPcUrl: res.data["system.pc_url"],
systemH5Url: res.data["system.h5_url"],
memberDefaultAvatar: res.data["member.default_avatar"],
courseDefaultThumbs: res.data["default.course_thumbs"],
};
dispatch(saveConfigAction(data));
});
};