fix: 文章更新保存前判断修正

This commit is contained in:
lxy 2025-11-03 15:56:46 +08:00
parent f66fc76c01
commit d4ceb97260
4 changed files with 16 additions and 16 deletions

View File

@ -97,8 +97,8 @@ export default OakComponent({
async check() {
if (this.state.name &&
this.state.name.length > 0 &&
this.state.content &&
this.state.content.length > 0 &&
this.state.html &&
this.state.html.length > 0 &&
this.state.html !== '<p><br></p>') {
const id = this.getId();
await this.execute(undefined, {
@ -116,8 +116,8 @@ export default OakComponent({
type: 'warning',
});
}
else if (this.state.content &&
this.state.content.length > 0 &&
else if (this.state.html &&
this.state.html.length > 0 &&
this.state.html !== '<p><br></p>') {
this.setMessage({
content: this.t('check.no name'),

View File

@ -91,8 +91,8 @@ export default OakComponent({
async check() {
if (this.state.name &&
this.state.name.length > 0 &&
this.state.content &&
this.state.content.length > 0 &&
this.state.html &&
this.state.html.length > 0 &&
this.state.html !== '<p><br></p>') {
await this.execute();
if (this.props.changeIsEdit) {
@ -105,8 +105,8 @@ export default OakComponent({
type: 'warning',
});
}
else if (this.state.content &&
this.state.content.length > 0 &&
else if (this.state.html &&
this.state.html.length > 0 &&
this.state.html !== '<p><br></p>') {
this.setMessage({
content: '请填写文章标题!',

View File

@ -107,8 +107,8 @@ export default OakComponent({
if (
this.state.name &&
this.state.name.length > 0 &&
this.state.content &&
this.state.content.length > 0 &&
this.state.html &&
this.state.html.length > 0 &&
this.state.html !== '<p><br></p>'
) {
const id = this.getId()!;
@ -126,8 +126,8 @@ export default OakComponent({
type: 'warning',
});
} else if (
this.state.content &&
this.state.content.length > 0 &&
this.state.html &&
this.state.html.length > 0 &&
this.state.html !== '<p><br></p>'
) {
this.setMessage({

View File

@ -100,8 +100,8 @@ export default OakComponent({
if (
this.state.name &&
this.state.name.length > 0 &&
this.state.content &&
this.state.content.length > 0 &&
this.state.html &&
this.state.html.length > 0 &&
this.state.html !== '<p><br></p>'
) {
await this.execute();
@ -114,8 +114,8 @@ export default OakComponent({
type: 'warning',
});
} else if (
this.state.content &&
this.state.content.length > 0 &&
this.state.html &&
this.state.html.length > 0 &&
this.state.html !== '<p><br></p>'
) {
this.setMessage({