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

View File

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

View File

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

View File

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