diff --git a/upload/plugin.php b/upload/plugin.php index f50b5ca..806660f 100644 --- a/upload/plugin.php +++ b/upload/plugin.php @@ -9,7 +9,7 @@ define('APPTYPEID', 127); define('CURSCRIPT', 'plugin'); - +define('NOT_IN_MOBILE_API', 1); require './source/class/class_core.php'; diff --git a/upload/source/language/lang_template.php b/upload/source/language/lang_template.php index 5aba3fc..91c1875 100644 --- a/upload/source/language/lang_template.php +++ b/upload/source/language/lang_template.php @@ -459,6 +459,7 @@ $lang = array ( 'm_my_r' => '我的回复', 'm_stickt' => '置顶帖', 'm_share' => '如果喜欢这个话题,请点击右上角图标分享', + 'm_logout' => '退出登录', ); ?> \ No newline at end of file diff --git a/upload/source/plugin/mobile/api/4/login.php b/upload/source/plugin/mobile/api/4/login.php index 3d7af4c..ed7ea93 100644 --- a/upload/source/plugin/mobile/api/4/login.php +++ b/upload/source/plugin/mobile/api/4/login.php @@ -18,6 +18,12 @@ include_once 'member.php'; class mobile_api { function common() { + if(!empty($_GET['mlogout'])) { + if($_GET['hash'] == formhash()) { + clearcookies(); + } + mobile_core::result(array()); + } } function output() { diff --git a/upload/template/default/m/js/profile.js b/upload/template/default/m/js/profile.js index 5cf7df1..354dde0 100644 --- a/upload/template/default/m/js/profile.js +++ b/upload/template/default/m/js/profile.js @@ -76,27 +76,17 @@ var dataLoaded = function (data) { infoHtml += template.render('infoTpl', {'name': infoDatas[key][0], 'value': value + ' ' + unit}); } $('#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) { $("#forumlist").append('版块'); if (data.Variables.member_uid == data.Variables.space.uid) { - if (F == 'wx') { - if (!TOOLS.isWX()) { - $('#switchMember').on('click', function () { - TOOLS.openNewPage(window.location.search + '&login=yes'); - }); - $('#switchText').html('帐号切换'); - } else { - $('#switchMember').on('click', function () { - TOOLS.openNewPage('?a=account&referer=none'); - }); - } - $('#switchNav').show(); - } + $('#switchMember').on('click', function () { + TOOLS.dget(API_URL + "module=login&mlogout=yes&version=4&hash=" + data.Variables.formhash, null, function() { + TOOLS.openNewPage('?a=index'); + }, null, 'text/plain', false, false); + }); + $('#switchNav').show(); } else { $('#profileNav').show(); } @@ -116,17 +106,6 @@ var bindEvent = function (data) { $('#mypost').on('click', function () { 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 () { TOOLS.pageBack('?a=index'); }); diff --git a/upload/template/default/m/profile.htm b/upload/template/default/m/profile.htm index 742d411..431f3bc 100644 --- a/upload/template/default/m/profile.htm +++ b/upload/template/default/m/profile.htm @@ -3,6 +3,16 @@
+