优化 新触屏版补充退出登录

This commit is contained in:
Comsenz 2017-10-23 15:35:50 +08:00
parent d4a5caf79e
commit a76a2b77ba
5 changed files with 24 additions and 28 deletions

View File

@ -9,7 +9,7 @@
define('APPTYPEID', 127); define('APPTYPEID', 127);
define('CURSCRIPT', 'plugin'); define('CURSCRIPT', 'plugin');
define('NOT_IN_MOBILE_API', 1);
require './source/class/class_core.php'; require './source/class/class_core.php';

View File

@ -459,6 +459,7 @@ $lang = array (
'm_my_r' => '我的回复', 'm_my_r' => '我的回复',
'm_stickt' => '置顶帖', 'm_stickt' => '置顶帖',
'm_share' => '如果喜欢这个话题,请点击右上角图标分享', 'm_share' => '如果喜欢这个话题,请点击右上角图标分享',
'm_logout' => '退出登录',
); );
?> ?>

View File

@ -18,6 +18,12 @@ include_once 'member.php';
class mobile_api { class mobile_api {
function common() { function common() {
if(!empty($_GET['mlogout'])) {
if($_GET['hash'] == formhash()) {
clearcookies();
}
mobile_core::result(array());
}
} }
function output() { function output() {

View File

@ -76,27 +76,17 @@ var dataLoaded = function (data) {
infoHtml += template.render('infoTpl', {'name': infoDatas[key][0], 'value': value + ' ' + unit}); infoHtml += template.render('infoTpl', {'name': infoDatas[key][0], 'value': value + ' ' + unit});
} }
$('#infonav').html(infoHtml); $('#infonav').html(infoHtml);
if (window.location.hash == '#logout') {
TOOLS.dget(DOMAIN + 'plugin.php?id=wechat&ac=logout&hash=' + data.Variables.formhash, null, null, null, 'text/plain', false, false);
}
}; };
var bindEvent = function (data) { var bindEvent = function (data) {
$("#forumlist").append('版块'); $("#forumlist").append('版块');
if (data.Variables.member_uid == data.Variables.space.uid) { if (data.Variables.member_uid == data.Variables.space.uid) {
if (F == 'wx') { $('#switchMember').on('click', function () {
if (!TOOLS.isWX()) { TOOLS.dget(API_URL + "module=login&mlogout=yes&version=4&hash=" + data.Variables.formhash, null, function() {
$('#switchMember').on('click', function () { TOOLS.openNewPage('?a=index');
TOOLS.openNewPage(window.location.search + '&login=yes'); }, null, 'text/plain', false, false);
}); });
$('#switchText').html('帐号切换'); $('#switchNav').show();
} else {
$('#switchMember').on('click', function () {
TOOLS.openNewPage('?a=account&referer=none');
});
}
$('#switchNav').show();
}
} else { } else {
$('#profileNav').show(); $('#profileNav').show();
} }
@ -116,17 +106,6 @@ var bindEvent = function (data) {
$('#mypost').on('click', function () { $('#mypost').on('click', function () {
TOOLS.openNewPage('?a=mythread&ac=reply'); TOOLS.openNewPage('?a=mythread&ac=reply');
}); });
if (TOOLS.isWX()) {
$('#myfavorite').on('click', function () {
TOOLS.openNewPage('?a=myfavorite&ac=list');
});
$('#myviewedsite').on('click', function () {
TOOLS.openNewPage('?a=myviewedsite');
});
} else {
$('#myfavorite').parent().hide();
$('#myviewedsite').parent().hide();
}
$(".backBtn").click(function () { $(".backBtn").click(function () {
TOOLS.pageBack('?a=index'); TOOLS.pageBack('?a=index');
}); });

View File

@ -3,6 +3,16 @@
<div class="warp"> <div class="warp">
<div id="header"></div> <div id="header"></div>
<div class="container conM"> <div class="container conM">
<div class="topicBox profilenav" id="switchNav" style="display:none">
<ul>
<li class="topicRank pShow">
<a id="switchMember">
<span id="switchText">{lang m_logout}</span>
<span class="incoAnswer db rkArrow"></span>
</a>
</li>
</ul>
</div>
<div class="topicBox profilenav" id="profileNav" style="display:none"> <div class="topicBox profilenav" id="profileNav" style="display:none">
<ul> <ul>
<li class="topicRank pShow"> <li class="topicRank pShow">