修改新闻中心detail.cshtml如下,一直显示"没有收藏成功" ps: 已授权用户收藏权限
@{
dynamic infoData = Html.InfoData();
CurrentUser user = (CurrentUser)ViewBag.CurrentUser;
if(user.UserName != "")
{
<div class="denglu">欢迎您
(user.UserName)。</div>
}
else
{
<script>alert("请登录");
window.location.href="http://www.phycai.net/member";
</script>
}
}
<script type="text/javascript">
$.post("/E/InfoData/AddClicks", { ColumnId
infoData.ColumnId,Id
infoData.Id}, function (data) { $lb_clicks.text(data)})
$.ajax({
url:"/E/Api/",
type:"POST",
dataType:"json",
data:{ method:"PACollectInfo.Add",Type:1,Name:"@infoData.Title",InfoId
infoData.Id,TableName:"@Html.CurrentInfoTable
()",PicPath:"@infoData.Thumbnail"},
success
unction (responseData)
{
if(responseData.State==1)
{
alert("收藏成功");
}
else
{
alert("没有收藏成功");
}
//业务逻辑自己写
}
});
</script>