HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/mm.paycheckc.com/app/weixin/controller/CdnwxController.php
<?php
namespace app\weixin\controller;
use cmf\controller\HomeBaseController;
use app\weixin\logic\CdnwxLogic;
use think\facade\Request;
use think\facade\Cache;
use think\cache\driver\Redis;

// 指定允许被访问的域名
header('Access-Control-Allow-Origin:*');
// 响应类型
header('Access-Control-Allow-Methods:*');
// 响应头设置
header('Access-Control-Allow-Headers:x-requested-with,content-type');

class CdnwxController extends HomeBaseController
{

    protected $CdnwxLogic;

    public function __construct()
    {

        parent::__construct();
        $this->CdnwxLogic = new CdnwxLogic();

    }

    /**
     *常规调用sql查询微信
     * http://127.0.1.0/weixin/cdnwx/cdnwx?uid=1&gid=20
     * @param $uid 用户id
     * @param $gid 组id
     * @return \think\response\Json
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function cdnwx(){
        return $this->CdnwxLogic->sqlwx(Request::param('uid'),Request::param('gid'));
    }

    public function rediswx(){
        return $this->CdnwxLogic->rediswx(Request::param('uid'),Request::param('gid'));
    }

    //127.0.1.0/weixin/cdnwx/retest
    public function retest(){

//        phpinfo();

//        Cache::store('redis')->inc('cs');
//        var_dump(Cache::store('redis')->get('cs'));
//        return 123;

//        $redis = new Redis();
//        $redis->inc('cs');
//        var_dump($redis->get('cs'));


      return  $this->CdnwxLogic->rediswx('1','20');
    }

    public function msg($code,$msg,$data=""){
        $arr['code'] =$code;
        $arr['msg'] =$msg;
        $arr['data'] =$data;
        return json($arr);

    }
}