123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php namespace Place_interface\Lib;
- use Dever;
- use Place;
- use Dever\Helper\Secure;
- class Core
- {
- protected $login = false;
- protected $entry = false;
- public function __construct()
- {
- Place::init();
- $t = Dever::input('t');
- if ($this->login && !$t) {
- $this->showLogin();
- }
- if ($t) {
- if ($t = Secure::checkLogin($t)) {
- if ($t['uid'] && $t['uid'] > 0) {
- Place::user($t['uid']);
- }
- if ($this->login && !Place::$uid) {
- $this->showLogin();
- }
- } elseif ($this->login) {
- $this->showLogin();
- }
- }
- if ($this->entry) {
- if (Place::$info['type'] >= 2 && !Place::$uid) {
- Dever::error('您没有权限', -2);
- }
- /*
- if (Place::$member && Place::$user['entry_type'] <= 2) {
- Dever::error('您没有权限');
- }*/
- }
- }
- protected function showLogin()
- {
- Dever::error('请先登录', -4);
- }
- protected function showBindMobile()
- {
- if (Place::$user['type'] == 2) {
- Dever::error('您需要绑定手机号才能继续操作', -5);
- }
- }
- protected function showBindEmail()
- {
- if (Place::$user['type'] == 2) {
- Dever::error('您需要绑定邮箱才能继续操作', -6);
- }
- }
- # 获取要更新的数据版本号
- public function getUpdate()
- {
- return Place::$info['update'];
- }
- # 获取要更新的系统版本号
- public function getVersion()
- {
- return 100;
- }
- }
|