Merge pull request #61 from Undertone0809/preference-patch

fix: the preference button does not render correctly in time.
This commit is contained in:
ronger 2022-11-01 07:48:09 +08:00 committed by GitHub
commit 20173b669e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 53 deletions

View File

@ -158,7 +158,6 @@ export default {
articlePerfect: '1'
}).then(function (res) {
if (res) {
if (res.success) {
_ts.$store.commit('admin/updateArticlePreference', {
index: index,
idArticle: idArticle,
@ -166,8 +165,7 @@ export default {
})
_ts.$message.success("设置成功!");
} else {
_ts.$message.error(_ts.message);
}
_ts.$message.error("设置失败!");
}
})
},
@ -178,7 +176,6 @@ export default {
articlePerfect: '0'
}).then(function (res) {
if (res) {
if (res.success) {
_ts.$store.commit('admin/updateArticlePreference', {
index: index,
idArticle: idArticle,
@ -186,8 +183,7 @@ export default {
})
_ts.$message.success("取消成功!");
} else {
_ts.$message.error(_ts.message);
}
_ts.$message.error("取消失败!");
}
})
},

View File

@ -504,7 +504,6 @@ export default {
articlePerfect: '1'
}).then(function (res) {
if (res) {
if (res.success) {
_ts.$store.commit('admin/updateArticlePreference', {
index: index,
idArticle: idArticle,
@ -512,8 +511,7 @@ export default {
})
_ts.$message.success("设置成功!");
} else {
_ts.$message.error(_ts.message);
}
_ts.$message.error("设置失败!");
}
})
},
@ -524,7 +522,6 @@ export default {
articlePerfect: '0'
}).then(function (res) {
if (res) {
if (res.success) {
_ts.$store.commit('admin/updateArticlePreference', {
index: index,
idArticle: idArticle,
@ -532,8 +529,7 @@ export default {
})
_ts.$message.success("取消成功!");
} else {
_ts.$message.error(_ts.message);
}
_ts.$message.error("取消失败!");
}
})
},

View File

@ -342,12 +342,10 @@ export default {
articlePerfect: '1',
}).then(function (res) {
if (res) {
if (res.success) {
_ts.$set(_ts, 'isPerfect', false);
_ts.$set(_ts, 'isPerfect', true);
_ts.$message.success("设置成功!");
} else {
_ts.$message.error(_ts.message);
}
_ts.$message.error("设置失败!");
}
})
},
@ -358,12 +356,10 @@ export default {
articlePerfect: '0',
}).then(function (res) {
if (res) {
if (res.success) {
_ts.$set(_ts, 'isPerfect', true);
_ts.$set(_ts, 'isPerfect', false);
_ts.$message.success("取消成功!");
} else {
_ts.$message.error(_ts.message);
}
_ts.$message.error("设置失败!");
}
})
},