Browse Source

初始化

master
jianglong 3 years ago
parent
commit
4201510e60
  1. 2
      application/admin/controller/Index.php
  2. 5
      application/admin/controller/qingdong/customer/Customer.php
  3. 1
      application/admin/library/Auth.php
  4. 3
      application/common/controller/Backend.php
  5. 4
      application/config.php

2
application/admin/controller/Index.php

@ -170,6 +170,7 @@ class Index extends Backend
$html = "<form id='logout_submit' name='logout_submit' action='' method='post'>" . token() . "<input type='submit' value='ok' style='display:none;'></form>";
$html .= "<script>document.forms['logout_submit'].submit();</script>";
return $html;
}
/**
@ -177,6 +178,7 @@ class Index extends Backend
*/
public function sendSms()
{
$mobile = $this->request->get('mobile', '');
if(!$mobile){

5
application/admin/controller/qingdong/customer/Customer.php

@ -1532,7 +1532,9 @@ class Customer extends Base
return json($result);
}
$token = cache("baidu_api_token");
$token = "";
if(!$token){
$resStr = $this->get_token();
$res = json_decode($resStr,true);
@ -1609,7 +1611,8 @@ class Customer extends Base
public function get_token(){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://aip.baidubce.com/oauth/2.0/token?client_id=VBgaZy6xOiHsWVRMTuOqRynw&client_secret=fe6OOmXCZzt2B7BDGo6ctyR3TPEZkmws&grant_type=client_credentials",
// CURLOPT_URL => "https://aip.baidubce.com/oauth/2.0/token?client_id=VBgaZy6xOiHsWVRMTuOqRynw&client_secret=fe6OOmXCZzt2B7BDGo6ctyR3TPEZkmws&grant_type=client_credentials",
CURLOPT_URL => "https://aip.baidubce.com/oauth/2.0/token?client_id=PzVHnlfCX0GEX2YMYST4fCHU&client_secret=kquRpqe7EVZrDecRWdR9fMzUGfS3Lz2C&grant_type=client_credentials",
CURLOPT_TIMEOUT => 30,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',

1
application/admin/library/Auth.php

@ -156,6 +156,7 @@ class Auth extends \fast\Auth
{
$admin = Admin::get(intval($this->id));
if ($admin) {
var_dump(111122222);
$admin->token = '';
$admin->save();
}

3
application/common/controller/Backend.php

@ -123,6 +123,7 @@ class Backend extends Controller
$actionname = strtolower($this->request->action());
$admin = Session::get('admin')?Session::get('admin'):Session::get('member');
$checkcid = $this->request->request('changecid');
if($checkcid && $admin['id']!=$checkcid){
$update = [
@ -153,9 +154,11 @@ class Backend extends Controller
// 设置当前请求的URI
$this->auth->setRequestUri($path);
// 检测是否需要验证登录
if (!$this->auth->match($this->noNeedLogin)) {
//检测是否登录
var_dump($admin);
if (!$this->auth->isLogin() && !$this->auth->isMemberLogin()) {
Hook::listen('admin_nologin', $this);
$url = Session::get('referer');

4
application/config.php

@ -269,11 +269,11 @@ return [
//登录验证码
'login_captcha' => true,
//登录失败超过10次则1天后重试
'login_failure_retry' => true,
'login_failure_retry' => false,
//是否同一账号同一时间只能在一个地方登录
'login_unique' => false,
//是否开启IP变动检测
'loginip_check' => true,
'loginip_check' => false,
//登录页默认背景图
'login_background' => "",
//是否启用多级菜单导航

Loading…
Cancel
Save