async submitMaintain() { const result = await SystemService.setSiteMaintainInfo(this.id, { enabled: this.state.enableMaintain, start_time: this.state.startValue ? this.state.startValue.format('YYYY-MM-DD HH:mm:ss') : null, end_time: this.state.endValue ? this.state.endValue.format('YYYY-MM-DD HH:mm:ss') : null, description: this.state.description }) if (result) { message.success('系统维护设置提交成功') } }
this.props.form.validateFields((err,values)=>{ if(!err){ message.success(`${userInfo.userName} 恭喜你,您通过本次表单组件学习,当前密码为:${userInfo.userPwd}`) } })
removeFromFavorites() { this.props.removeFromFavorites(this.props.match.params.tutorial); message.success('Tutorial removed from favorites'); this.props.getUserProfile(); setTimeout(() => this.props.clearMessage(), 3000); }
Axios.post('/api/create/banner', params) .then( res => { if (res.data.code == 200) { message.success("添加成功"); this.getBanners(); } else { message.error("添加失败") } })
const updateFileHash = async (filename, type, fileHash, secret) => { let { web3, healthRecord } = store.getState().global_vars; // let res = await healthRecord.addFile // .sendTransaction(filename, type, hash , secret, {"from":web3.eth.accounts[0]}); let res = await healthRecord.addFile .sendTransaction(filename, type, getBytes32FromIpfsHash(fileHash), secret, {"from":web3.eth.accounts[0]}); if(res) message.success("file upload successful"); else message.error("file upload unsuccessful"); }
removeUpvote() { this.props.removeUpvote(this.props.tutorial._id); message.success('Upvote Removed'); this.props.getUserProfile(); window.location.reload(); setTimeout(() => this.props.clearUpvoteMessage(), 3000); }
const RegistrationContainer = props => { const onFinish = params => { const hide = message.loading("Action in progress.."); props.register(params); hide(); message.success("Loading finished"); window.location.assign("/login"); }; const [form] = Form.useForm(); return <RegistrationForm {...{ form, onFinish }} />; }
async submitAnnounce() { const result = await SystemService.setAnnounce(this.id, this.state.enableAnnounce, this.state.title, this.state.content) if (result) { message.success('公告设置提交成功') } }
addToFavorites() { if (!this.props.auth.authenticated) { return message.info('You need to login to add to favorites'); } this.props.addToFavorites(this.props.match.params.tutorial); message.success('Tutorial added to favorites'); this.props.getUserProfile(); setTimeout(() => this.props.clearMessage(), 3000); }
Axios .delete(`/api/banner/${banner.id}`) .then( res => { message.success(res.data.message) if (res.data.code == 200) { this.getBanners(); } })
componentDidMount() { this.props.getTags(); if (this.props.auth.newSignUp) { message.success('Registration Successful, Sign In to continue'); setTimeout(() => { this.props.clearSignUp(); }, 2000); } }
addUpvote() { if (!this.props.auth.authenticated) { return message.info('You need to login to upvote'); } this.props.addUpvote(this.props.tutorial._id); message.success('Upvote Added'); this.props.getUserProfile(); window.location.reload(); setTimeout(() => this.props.clearUpvoteMessage(), 3000); }
this.props.form.validateFields((err, values) => { if (!err) { this.props.onAddCompany({ CompanyName: values.companyName, CompanyAddress: values.companyAddress, CompanyEmail: values.companyEmail, CompanyInfo: values.companyInfo, Selected: false, }) message.success('New company details successfully added!'); } });
removeUpvote() { this.props.removeUpvote(this.props.match.params.tutorial); message.success('Upvote Removed'); this.props.getUserProfile(); this.props.getTutorial(this.props.match.params.tutorial); setTimeout(() => this.props.clearUpvoteMessage(), 3000); }
Axios.post('/api/create/book', {img: imageUrl, desc, href, title, author }) .then( res => { if (res.data.code == 200) { message.success("添加成功"); this.getBooks(); } else { message.error("添加失败") } })