登陆 #4

Merged
pengda merged 1 commits from wpd_login into master 2 months ago
  1. 4
      config/define.php
  2. 4
      control/weibo.php
  3. 6
      index.php
  4. 4
      view/templates/weibo/home.html

4
config/define.php

@ -21,8 +21,8 @@
define('CALLBACK_KNOWLEDGE_LOGIN', 'knowledge_login');
define('WEIXIN_OPEN_APPID','wxd31fa56cbcd5c650');
define('WEIXIN_OPEN_APPSCRET','5e6d75001fca1b13788ece389b2bd40d');
define('WEIXIN_OPEN_APPID','wx68a1060c4ec4722f');
define('WEIXIN_OPEN_APPSCRET','9f8a1dd8352e1150a40ebf3262429f69');
define('WEIXIN_OPEN_GET_ACCESS_TOKEN','https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code');
define('WEIXIN_OPEN_GET_PERSONAL_INFORMATION','https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s');

4
control/weibo.php

@ -7,7 +7,9 @@ include_once(dirname(dirname(__FILE__)) . "/library/publicBase.php");
class weibo extends publicBase {
public function home() {}
public function home() {
$this->view['nickname'] = $_SESSION['nickname'];
}
public function ajax_weibo_list() {
$status = $this->post('status') + 0;

6
index.php

@ -31,7 +31,7 @@ error_reporting(E_ERROR); // 记录所有级别的错误
$this->control_name = $array[0];
$this->control_func = !isset($array[1]) || $array[1]=='' ? 'home' : $array[1];
if(preg_match('/^(login|login_submit).*/', $this->control_name)){
if(preg_match('/^(login|loginout).*/', $this->control_name)){
$this->control_name = 'index';
$this->control_func = $array[0];
}
@ -66,9 +66,9 @@ error_reporting(E_ERROR); // 记录所有级别的错误
session_write_close();
//登陆检查
$needlogin = false;
$needlogin = true;
if ($this->control_name == 'index') {
if (preg_match('/^(login|login_submit).*/', $this->control_func)) {
if (preg_match('/^(login).*/', $this->control_func)) {
$needlogin = false;
}
}elseif($this->control_name == 'callback'){

4
view/templates/weibo/home.html

@ -18,11 +18,11 @@
<img src="{$smarty.const.CSS_URL}/images/home-more.png" alt="">
<div class="dropdown">
<button class="dropdown-toggle">
学术论文出版
{$nickname}
<img class="icon" src="{$smarty.const.CSS_URL}/images/drop-icon.svg" alt="">
</button>
<div class="dropdown-panel">
<a href="#">退出</a>
<a href="/loginout">退出</a>
</div>
</div>
</div>

Loading…
Cancel
Save