Merge pull request #61 from Undertone0809/preference-patch
fix: the preference button does not render correctly in time.
This commit is contained in:
commit
20173b669e
@ -158,16 +158,14 @@ export default {
|
||||
articlePerfect: '1'
|
||||
}).then(function (res) {
|
||||
if (res) {
|
||||
if (res.success) {
|
||||
_ts.$store.commit('admin/updateArticlePreference', {
|
||||
index: index,
|
||||
idArticle: idArticle,
|
||||
articlePerfect: '1'
|
||||
})
|
||||
_ts.$message.success("设置成功!");
|
||||
} else {
|
||||
_ts.$message.error(_ts.message);
|
||||
}
|
||||
_ts.$store.commit('admin/updateArticlePreference', {
|
||||
index: index,
|
||||
idArticle: idArticle,
|
||||
articlePerfect: '1'
|
||||
})
|
||||
_ts.$message.success("设置成功!");
|
||||
} else {
|
||||
_ts.$message.error("设置失败!");
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -178,16 +176,14 @@ export default {
|
||||
articlePerfect: '0'
|
||||
}).then(function (res) {
|
||||
if (res) {
|
||||
if (res.success) {
|
||||
_ts.$store.commit('admin/updateArticlePreference', {
|
||||
index: index,
|
||||
idArticle: idArticle,
|
||||
articlePerfect: '0'
|
||||
})
|
||||
_ts.$message.success("取消成功!");
|
||||
} else {
|
||||
_ts.$message.error(_ts.message);
|
||||
}
|
||||
_ts.$store.commit('admin/updateArticlePreference', {
|
||||
index: index,
|
||||
idArticle: idArticle,
|
||||
articlePerfect: '0'
|
||||
})
|
||||
_ts.$message.success("取消成功!");
|
||||
} else {
|
||||
_ts.$message.error("取消失败!");
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -504,16 +504,14 @@ export default {
|
||||
articlePerfect: '1'
|
||||
}).then(function (res) {
|
||||
if (res) {
|
||||
if (res.success) {
|
||||
_ts.$store.commit('admin/updateArticlePreference', {
|
||||
index: index,
|
||||
idArticle: idArticle,
|
||||
articlePerfect: '1'
|
||||
})
|
||||
_ts.$message.success("设置成功!");
|
||||
} else {
|
||||
_ts.$message.error(_ts.message);
|
||||
}
|
||||
_ts.$store.commit('admin/updateArticlePreference', {
|
||||
index: index,
|
||||
idArticle: idArticle,
|
||||
articlePerfect: '1'
|
||||
})
|
||||
_ts.$message.success("设置成功!");
|
||||
} else {
|
||||
_ts.$message.error("设置失败!");
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -524,16 +522,14 @@ export default {
|
||||
articlePerfect: '0'
|
||||
}).then(function (res) {
|
||||
if (res) {
|
||||
if (res.success) {
|
||||
_ts.$store.commit('admin/updateArticlePreference', {
|
||||
index: index,
|
||||
idArticle: idArticle,
|
||||
articlePerfect: '0'
|
||||
})
|
||||
_ts.$message.success("取消成功!");
|
||||
} else {
|
||||
_ts.$message.error(_ts.message);
|
||||
}
|
||||
_ts.$store.commit('admin/updateArticlePreference', {
|
||||
index: index,
|
||||
idArticle: idArticle,
|
||||
articlePerfect: '0'
|
||||
})
|
||||
_ts.$message.success("取消成功!");
|
||||
} else {
|
||||
_ts.$message.error("取消失败!");
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -335,19 +335,17 @@ export default {
|
||||
_ts.gotoLogin();
|
||||
}
|
||||
},
|
||||
setPreference() {
|
||||
setPreference() {
|
||||
let _ts = this;
|
||||
_ts.$axios.$patch("/api/admin/article/update-perfect", {
|
||||
idArticle: _ts.article.idArticle,
|
||||
articlePerfect: '1',
|
||||
}).then(function (res) {
|
||||
if (res) {
|
||||
if (res.success) {
|
||||
_ts.$set(_ts, 'isPerfect', false);
|
||||
_ts.$message.success("设置成功!");
|
||||
} else {
|
||||
_ts.$message.error(_ts.message);
|
||||
}
|
||||
_ts.$set(_ts, 'isPerfect', true);
|
||||
_ts.$message.success("设置成功!");
|
||||
} else {
|
||||
_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.$message.success("取消成功!");
|
||||
} else {
|
||||
_ts.$message.error(_ts.message);
|
||||
}
|
||||
_ts.$set(_ts, 'isPerfect', false);
|
||||
_ts.$message.success("取消成功!");
|
||||
} else {
|
||||
_ts.$message.error("设置失败!");
|
||||
}
|
||||
})
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user