Commit b97d9fde authored by 蒋林's avatar 蒋林

接口登录问题

parent 91be8368
document.write("<li><a href=\"/changshang/2017-06-27/89.html\" title=\"测试\">测试</a></li><li><a href=\"/hangye/76.html\" title=\"家电回收条例有望年内出台 厂商只卖拒收罚10万\">家电回收条例有望年内出台 厂商只</a></li><li><a href=\"/pinlei/bingxiang/guzhangdaima/1.html\" title=\"科龙BCD-191W电冰箱故障代码表\">科龙BCD-191W电冰箱故障代码表</a></li><li><a href=\"/pinlei/xiyiji/jingyanjiqiao/2.html\" title=\"美的洗衣机MB55-3006G按启动键后就进入洗衣(干洗)状态维修全过程\">美的洗衣机MB55-3006G按启动键后就</a></li><li><a href=\"/pinlei/xiyiji/jingyanjiqiao/3.html\" title=\"自制拆装波轮洗衣机离合器中心螺帽配套工具\">自制拆装波轮洗衣机离合器中心螺帽</a></li><li><a href=\"/pinlei/xiyiji/jingyanjiqiao/4.html\" title=\"自制拆洗衣机排水阀(水堵)工具\">自制拆洗衣机排水阀(水堵)工具</a></li><li><a href=\"/shifu/5.html\" title=\"科龙BCD-242/HC电冰箱故障代码表\">科龙BCD-242/HC电冰箱故障代码表</a></li><li><a href=\"/shifu/6.html\" title=\"小天鹅全自动洗衣机故障可控硅之“元凶”\">小天鹅全自动洗衣机故障可控硅之“</a></li><li><a href=\"/pinlei/xiyiji/jingyanjiqiao/7.html\" title=\"洗衣机故障速修心得\">洗衣机故障速修心得</a></li><li><a href=\"/pinlei/dianshiji/jingyanjiqiao/8.html\" title=\"液晶屏逻辑板和屏坏简易判断及检修\">液晶屏逻辑板和屏坏简易判断及检修</a></li>"); document.write("<li><a href=\"/changshang/2017-06-27/89.html\" title=\"测试\">测试</a></li><li><a href=\"/shifu/24.html\" title=\"年轻时遇到了一些艳遇 回想起来依然记忆犹新\">年轻时遇到了一些艳遇 回想起来依</a></li><li><a href=\"/hangye/76.html\" title=\"家电回收条例有望年内出台 厂商只卖拒收罚10万\">家电回收条例有望年内出台 厂商只</a></li><li><a href=\"/hangye/83.html\" title=\"格力起诉美的“制冷王”空调侵权 索赔5000万元\">格力起诉美的“制冷王”空调侵权 </a></li><li><a href=\"/pinlei/bingxiang/guzhangdaima/1.html\" title=\"科龙BCD-191W电冰箱故障代码表\">科龙BCD-191W电冰箱故障代码表</a></li><li><a href=\"/pinlei/xiyiji/jingyanjiqiao/2.html\" title=\"美的洗衣机MB55-3006G按启动键后就进入洗衣(干洗)状态维修全过程\">美的洗衣机MB55-3006G按启动键后就</a></li><li><a href=\"/pinlei/xiyiji/jingyanjiqiao/3.html\" title=\"自制拆装波轮洗衣机离合器中心螺帽配套工具\">自制拆装波轮洗衣机离合器中心螺帽</a></li><li><a href=\"/pinlei/xiyiji/jingyanjiqiao/4.html\" title=\"自制拆洗衣机排水阀(水堵)工具\">自制拆洗衣机排水阀(水堵)工具</a></li><li><a href=\"/shifu/5.html\" title=\"科龙BCD-242/HC电冰箱故障代码表\">科龙BCD-242/HC电冰箱故障代码表</a></li><li><a href=\"/shifu/6.html\" title=\"小天鹅全自动洗衣机故障可控硅之“元凶”\">小天鹅全自动洗衣机故障可控硅之“</a></li>");
\ No newline at end of file \ No newline at end of file
document.write("<li><a href=\"/changshang/2017-06-27/89.html\" title=\"测试\">测试</a></li><li><a href=\"/hangye/83.html\" title=\"格力起诉美的“制冷王”空调侵权 索赔5000万元\">格力起诉美的“制冷王”空调侵权 </a></li><li><a href=\"/hangye/82.html\" title=\"公牛全线产品完成新国标升级:未来加大自动化投入\">公牛全线产品完成新国标升级:未来加</a></li><li><a href=\"/hangye/81.html\" title=\"姑娘别怕 我只是把钳子别在了腰上\">姑娘别怕 我只是把钳子别在了腰上</a></li><li><a href=\"/hangye/80.html\" title=\"插座国家标准又升级了 你还在用老的万能孔吗?\">插座国家标准又升级了 你还在用老</a></li><li><a href=\"/hangye/76.html\" title=\"家电回收条例有望年内出台 厂商只卖拒收罚10万\">家电回收条例有望年内出台 厂商只</a></li><li><a href=\"/hangye/75.html\" title=\"智能家电售后问题凸显 掘金未来需要新思路\">智能家电售后问题凸显 掘金未来需</a></li><li><a href=\"/hangye/74.html\" title=\"中国制造加速走向全球 GMCC向世界展示中国“芯”\">中国制造加速走向全球 GMCC向世界</a></li><li><a href=\"/hangye/73.html\" title=\"长虹制造云平台获国家“互联网+”重大工程支持项目\">长虹制造云平台获国家“互联网+”</a></li><li><a href=\"/hangye/71.html\" title=\"网约家电维修 不想却遇“山寨”维修\">网约家电维修 不想却遇“山寨”维</a></li>"); document.write("<li><a href=\"/shouyehuandeng/2017-07-05/90.html\" title=\"首页幻灯 - 快查\">首页幻灯 - 快查</a></li><li><a href=\"/changshang/2017-06-27/89.html\" title=\"测试\">测试</a></li><li><a href=\"/hangye/83.html\" title=\"格力起诉美的“制冷王”空调侵权 索赔5000万元\">格力起诉美的“制冷王”空调侵权 </a></li><li><a href=\"/hangye/82.html\" title=\"公牛全线产品完成新国标升级:未来加大自动化投入\">公牛全线产品完成新国标升级:未来加</a></li><li><a href=\"/hangye/81.html\" title=\"姑娘别怕 我只是把钳子别在了腰上\">姑娘别怕 我只是把钳子别在了腰上</a></li><li><a href=\"/hangye/80.html\" title=\"插座国家标准又升级了 你还在用老的万能孔吗?\">插座国家标准又升级了 你还在用老</a></li><li><a href=\"/hangye/76.html\" title=\"家电回收条例有望年内出台 厂商只卖拒收罚10万\">家电回收条例有望年内出台 厂商只</a></li><li><a href=\"/hangye/75.html\" title=\"智能家电售后问题凸显 掘金未来需要新思路\">智能家电售后问题凸显 掘金未来需</a></li><li><a href=\"/hangye/74.html\" title=\"中国制造加速走向全球 GMCC向世界展示中国“芯”\">中国制造加速走向全球 GMCC向世界</a></li><li><a href=\"/hangye/73.html\" title=\"长虹制造云平台获国家“互联网+”重大工程支持项目\">长虹制造云平台获国家“互联网+”</a></li>");
\ No newline at end of file \ No newline at end of file
...@@ -7,11 +7,7 @@ require(__DIR__ . "/../../class/q_functions.php"); ...@@ -7,11 +7,7 @@ require(__DIR__ . "/../../class/q_functions.php");
$link=db_connect(); $link=db_connect();
$empire=new mysqlquery(); $empire=new mysqlquery();
$user = islogin(); $iscas = getcvar('mlcas');
if (empty($user)) {
returnmsg(false, '请登录');
}
$mod = isset($_GET['mod']) ? $_GET['mod']: ''; $mod = isset($_GET['mod']) ? $_GET['mod']: '';
$newsid = isset($_POST['newsid']) ? intval($_POST['newsid']) : 0; $newsid = isset($_POST['newsid']) ? intval($_POST['newsid']) : 0;
$content = isset($_POST['content']) ? addslashes(trim($_POST['content'])) : ''; $content = isset($_POST['content']) ? addslashes(trim($_POST['content'])) : '';
...@@ -20,6 +16,9 @@ $page = isset($_POST['p']) ? intval($_POST['p']) : 0; ...@@ -20,6 +16,9 @@ $page = isset($_POST['p']) ? intval($_POST['p']) : 0;
$page = $page ? : 1; $page = $page ? : 1;
if ($mod == 'create') { if ($mod == 'create') {
if (!$iscas) {
returnmsg(false, '未登录', 'nologin');
}
if (!$newsid) { if (!$newsid) {
returnmsg(false, '内容ID参数错误'); returnmsg(false, '内容ID参数错误');
} }
...@@ -27,8 +26,11 @@ if ($mod == 'create') { ...@@ -27,8 +26,11 @@ if ($mod == 'create') {
returnmsg(false, '评论内容不能为空'); returnmsg(false, '评论内容不能为空');
} }
createComment($newsid, $content, $user); createComment($newsid, $content);
} elseif ($mod == 'reply') { } elseif ($mod == 'reply') {
if (!$iscas) {
returnmsg(false, '未登录', 'nologin');
}
if (!$plid) { if (!$plid) {
returnmsg(false, '评论ID参数错误'); returnmsg(false, '评论ID参数错误');
} }
...@@ -36,26 +38,31 @@ if ($mod == 'create') { ...@@ -36,26 +38,31 @@ if ($mod == 'create') {
returnmsg(false, '评论内容不能为空'); returnmsg(false, '评论内容不能为空');
} }
replyComment($plid, $content, $user); replyComment($plid, $content);
} elseif($mod == 'like') { } elseif($mod == 'like') {
if (!$iscas) {
returnmsg(false, '未登录', 'nologin');
}
if (!$plid) { if (!$plid) {
returnmsg(false, '评论ID参数错误'); returnmsg(false, '评论ID参数错误');
} }
likeComment($plid, $user); likeComment($plid);
}else { }else {
if (!$newsid) { if (!$newsid) {
returnmsg(false, '内容ID参数错误'); returnmsg(false, '内容ID参数错误');
} }
comments($newsid,10, $page, $user);
comments($newsid,10, $page);
} }
//创建评论 //创建评论
function createComment($newsid, $content, $user) { function createComment($newsid, $content) {
global $empire,$dbtbpre; global $empire,$dbtbpre;
$tablecomment = $dbtbpre.'ecms_comments'; $tablecomment = $dbtbpre.'ecms_comments';
$tablenews = $dbtbpre.'ecms_news'; $tablenews = $dbtbpre.'ecms_news';
$user = islogin();
$sql = "select id,classid from {$tablenews} where id={$newsid}"; $sql = "select id,classid from {$tablenews} where id={$newsid}";
$news = $empire->fetch1($sql); $news = $empire->fetch1($sql);
if (empty($news)) { if (empty($news)) {
...@@ -77,10 +84,11 @@ function createComment($newsid, $content, $user) { ...@@ -77,10 +84,11 @@ function createComment($newsid, $content, $user) {
} }
//回复评论 //回复评论
function replyComment($plid, $content, $user) { function replyComment($plid, $content) {
global $empire,$dbtbpre; global $empire,$dbtbpre;
$table = $dbtbpre.'ecms_comments'; $table = $dbtbpre.'ecms_comments';
$user = islogin();
$sql = "select * from $table where id={$plid}"; $sql = "select * from $table where id={$plid}";
$comment = $empire->fetch1($sql); $comment = $empire->fetch1($sql);
if (empty($comment)) { if (empty($comment)) {
...@@ -106,7 +114,7 @@ function replyComment($plid, $content, $user) { ...@@ -106,7 +114,7 @@ function replyComment($plid, $content, $user) {
} }
//评论列表 //评论列表
function comments($newsid, $num, $p=1, $user) { function comments($newsid, $num, $p=1) {
global $empire,$dbtbpre; global $empire,$dbtbpre;
$tablecomment = $dbtbpre.'ecms_comments'; $tablecomment = $dbtbpre.'ecms_comments';
$tablemember = $dbtbpre.'enewsmember'; $tablemember = $dbtbpre.'enewsmember';
...@@ -122,7 +130,8 @@ function comments($newsid, $num, $p=1, $user) { ...@@ -122,7 +130,8 @@ function comments($newsid, $num, $p=1, $user) {
$list[] = handelcomment($row); $list[] = handelcomment($row);
} }
if ($list) { if ($list && getcvar('mlcas')) {
$user = islogin();
$ids = array_unique(array_column($list, 'id')); $ids = array_unique(array_column($list, 'id'));
$ids = implode(',', $ids); $ids = implode(',', $ids);
$tablecommentlike = $dbtbpre.'ecms_comments_likenum'; $tablecommentlike = $dbtbpre.'ecms_comments_likenum';
...@@ -180,11 +189,12 @@ function comment($id) { ...@@ -180,11 +189,12 @@ function comment($id) {
} }
//点赞 //点赞
function likeComment($plid, $user) { function likeComment($plid) {
global $empire,$dbtbpre; global $empire,$dbtbpre;
$tablecomment = $dbtbpre.'ecms_comments'; $tablecomment = $dbtbpre.'ecms_comments';
$tablecommentlike = $dbtbpre.'ecms_comments_likenum'; $tablecommentlike = $dbtbpre.'ecms_comments_likenum';
$user = islogin();
$sql = "select * from {$tablecomment} where id={$plid}"; $sql = "select * from {$tablecomment} where id={$plid}";
$comment = $empire->fetchassoc1($sql); $comment = $empire->fetchassoc1($sql);
if ($comment['user_id'] == $user['userid']) { if ($comment['user_id'] == $user['userid']) {
......
...@@ -13,10 +13,11 @@ use internalApi\ucenter\BrowsingHistory; ...@@ -13,10 +13,11 @@ use internalApi\ucenter\BrowsingHistory;
$link=db_connect(); $link=db_connect();
$empire=new mysqlquery(); $empire=new mysqlquery();
$user = islogin(); $iscas = getcvar('mlcas');
if (empty($user)) { if (!$iscas) {
returnmsg(false, '请登录'); returnmsg(false, '未登录', 'nologin');
} }
$user = islogin();
$mod = isset($_GET['mod']) ? $_GET['mod']: ''; $mod = isset($_GET['mod']) ? $_GET['mod']: '';
$newsid = isset($_POST['newsid']) ? intval($_POST['newsid']) : 0; $newsid = isset($_POST['newsid']) ? intval($_POST['newsid']) : 0;
......
...@@ -16,18 +16,6 @@ ...@@ -16,18 +16,6 @@
<style>body{background-color: #f3f3f3}</style> <style>body{background-color: #f3f3f3}</style>
</head> </head>
<body> <body>
<!--
<div class="top">
<form name="searchform" method="post" action="/e/search/index.php">
<div class="search-box">
<input type="hidden" name="show" value="title,newstext">
<input type="search" class="input-control" name="keyboard" placeholder="请输入关键词">
<!--<div class="placeholder"><i class="iconfont icon-sousuo"></i>请输入关键词</div>-->
</div>
</form>
<a href="#" class="sign"><i class="iconfont icon-qiandao1111"></i></a>
</div>
-->
<div class="empty-block"></div> <div class="empty-block"></div>
<div class="common-top"> <div class="common-top">
...@@ -38,7 +26,7 @@ ...@@ -38,7 +26,7 @@
<a href="/hangye">行业</a> <a href="/hangye">行业</a>
<a href="/changshang">厂商</a> <a href="/changshang">厂商</a>
</div> </div>
<a href="#" class="search"><i class="iconfont icon-sousuo"></i></a> <a href="javascript:;" class="search"><i class="iconfont icon-sousuo"></i></a>
</div> </div>
<div class="swiper-container"> <div class="swiper-container">
...@@ -51,27 +39,27 @@ ...@@ -51,27 +39,27 @@
<div class="quick-link"> <div class="quick-link">
<ul class="link-item clearfix"> <ul class="link-item clearfix">
<li> <li>
<a href="#"> <a href="http://code.ibanshou.cn">
<i class="icon-kuaicha"></i> <i class="icon-kuaicha"></i>
<p>快查</p> <p>快查</p>
</a> </a>
</li> </li>
<li> <li>
<a href="#"> <a href="javascript:;">
<i class="icon-kuaiwen"></i> <i class="icon-kuaiwen"></i>
<p>快问</p> <p>接单</p>
</a> </a>
</li> </li>
<li> <li>
<a href="#"> <a href="http://xue.ibanshou.cn/home/category-detail?categoryId=3">
<i class="icon-huati"></i> <i class="icon-huati"></i>
<p>话题</p> <p>扳手SAAS</p>
</a> </a>
</li> </li>
<li> <li>
<a href="#"> <a href="http://bbs.ibanshou.cn/forum.php?mod=forumdisplay&fid=112">
<i class="icon-more-pro"></i> <i class="icon-more-pro"></i>
<p>更多</p> <p>反馈</p>
</a> </a>
</li> </li>
</ul> </ul>
...@@ -121,35 +109,6 @@ ...@@ -121,35 +109,6 @@
<img src="http://bbs.yunya.com/data/attachment/block/3f/3f0a9860abffca597be57ae748d68b99.jpg"> <img src="http://bbs.yunya.com/data/attachment/block/3f/3f0a9860abffca597be57ae748d68b99.jpg">
</a> </a>
</li></ul></div> </li></ul></div>
<div class="foot-nav">
<ul class="nav-list">
<li>
<a href="/">
<i class="iconfont icon-shouye"></i>
<p>首页</p>
</a>
</li>
<li>
<a href="http://xue.ibanshou.cn">
<i class="iconfont icon-icon_huabanfuben-copy"></i>
<p>学院</p>
</a>
</li>
<li>
<a href="http://bbs.ibanshou.cn">
<i class="iconfont icon-appluntan"></i>
<p>社区</p>
</a>
</li>
<li class="cur">
<a href="javascript:;">
<i class="iconfont icon-yonghu"></i>
<p>我的</p>
</a>
</li>
</ul>
</div>
<script type='text/javascript' src="/skin/default/js/jquery-1.11.3.min.js"></script> <script type='text/javascript' src="/skin/default/js/jquery-1.11.3.min.js"></script>
<script type='text/javascript' src="/skin/default/js/swiper.min.js"></script> <script type='text/javascript' src="/skin/default/js/swiper.min.js"></script>
<script type='text/javascript' src="http://u.yunya.com/common/nav.js"></script> <script type='text/javascript' src="http://u.yunya.com/common/nav.js"></script>
......
...@@ -29,7 +29,7 @@ $(".send-pl").click(function () { ...@@ -29,7 +29,7 @@ $(".send-pl").click(function () {
$(".comment-send-box").hide(); $(".comment-send-box").hide();
$('.mask').hide(); $('.mask').hide();
} else { } else {
pop(e.msg); pop(e.msg, e.data);
} }
}, 'json'); }, 'json');
}); });
...@@ -106,7 +106,7 @@ $(".reply-pl").click(function () { ...@@ -106,7 +106,7 @@ $(".reply-pl").click(function () {
$(".comment-reply").hide(); $(".comment-reply").hide();
$('.mask').hide(); $('.mask').hide();
} else { } else {
pop(e.msg); pop(e.msg, e.data);
} }
}, 'json'); }, 'json');
}); });
...@@ -142,12 +142,16 @@ function likeComment(plid, islike) { ...@@ -142,12 +142,16 @@ function likeComment(plid, islike) {
} }
}); });
} else { } else {
pop(e.msg); pop(e.msg, e.data);
} }
}, 'json'); }, 'json');
} }
function pop(msg) { function pop(msg, islogin) {
if (islogin === 'nologin') {
location.href = "/e/member/login";
return false;
}
layer.msg(msg); layer.msg(msg);
} }
...@@ -219,7 +223,7 @@ function diggtop() { ...@@ -219,7 +223,7 @@ function diggtop() {
$("#zan").find('i').removeClass('icon-zan').addClass('icon-zan-fill'); $("#zan").find('i').removeClass('icon-zan').addClass('icon-zan-fill');
$('.zan-tip').animate({opacity: "1", top: "-=30"},500).animate({opacity: "0", top: "-30"}, "slow"); $('.zan-tip').animate({opacity: "1", top: "-=30"},500).animate({opacity: "0", top: "-30"}, "slow");
} else { } else {
pop(e.msg); pop(e.msg, e.data);
} }
}, 'json'); }, 'json');
}); });
...@@ -237,7 +241,7 @@ $('#favor').click(function () { ...@@ -237,7 +241,7 @@ $('#favor').click(function () {
$(self).find('i').removeClass('icon-favor-fill').addClass('icon-favor'); $(self).find('i').removeClass('icon-favor-fill').addClass('icon-favor');
} }
} else { } else {
pop(e.msg); pop(e.msg, e.data);
} }
}, 'json'); }, 'json');
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment