import React from "react"; import $ from "jquery/src/ajax"; import "react-quill/dist/quill.bubble.css"; import moment from "moment"; import "../authentication/techDemand.less"; import { Form, Button, message, } from "antd"; import { beforeUploadFile, } from "@/tools.js"; import Editors from "@/richTextEditors"; //主体 const Setting = Form.create()( React.createClass({ getInitialState() { return { content: "", }; }, // 初始化数据 loadData() { //发送请求 $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/getSysConfig", data: { id: 100 }, success: function (data) { if (data.error.length == 0) { this.setState({ content: data.data.content }); } else { message.warning(data.error[0].message) } }.bind(this), }).always( function () { this.setState({ loading: false, }); }.bind(this) ); }, // 编辑声明 edit() { this.setState({ loading: true, }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/updateSysConfig", data: { id: 100, content: this.state.content, }, success: function (data) { this.setState({ loading: false, }); if (data.error && data.error.length) { message.warning(data.error[0].message); }else{ message.success("修改成功!") } }.bind(this), }).always( function () { this.setState({ loading: false, }); }.bind(this) ); }, componentWillMount() { this.loadData(); }, render() { return (
本站声明设置
{ this.setState({ content: value }); }} />
提示:本站声明,显示在新闻底部,一旦修改,将整站全部修改!!!
); }, }) ); export default Setting;