This commit is contained in:
尹吉欢
2018-03-30 16:29:48 +08:00
parent 97fef9428c
commit 5b0e976881
2 changed files with 13 additions and 1 deletions
+1
View File
@@ -78,6 +78,7 @@ $("#login_btn").on("click", function () {
var token = resData.data;
localStorage.setItem("user_token", token);
$.toast(resData.message);
back();
} else {
$.toast(resData.message);
}
+12 -1
View File
@@ -472,10 +472,21 @@ $(".praise").on("click", function () {
//收藏
$(".collection").on("click", function () {
//doCollect();
collect();
});
function doCollect() {
if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") {
clicked('../user/codeSms.html',true,false,{},{},function(){
doCollect();
})
return;
} else {
collect();
}
}
function collect(){
axios.post("/rest/news/collect",{newsId : id}).then(function (response) {
var msg = response.data.message