thinkphp使用redirect重定向的问题

浏览:17152 发布日期:2017/10/04 分类:ThinkPHP5专区 关键字: 302 redirect thinkphp
在thinkphp5中使用redirect遇到了一个让我非常困惑的问题,希望有人能帮助我<?php
namespace app\index\controller;
class At extends Common
{
    public function hi($name)
    {
        if ($name == 'thinkphp')
        {
            return $this->redirect('http://www.baidu.com',302);
        }else{
            return $this->error('登录失败','ds');
        }
    }
    public function cg()
    {
        return '登录成功跳转';
    }
    public function ds()
    {
        return '登录失败跳转';
    }

}
以上代码在302跳转的过程中没有任何问题,但是当我将url替换成另外一个的时候。问题出现了。<?php
namespace app\index\controller;
class At extends Common
{
    public function hi($name)
    {
        if ($name == 'thinkphp')
        {
            return $this->redirect('mqqapi://card/show_pslcard?src_type=internal&version=1&uin=1921779545&card_type=person&source=sharecard',302);
        }else{
            return $this->error('登录失败','ds');
        }
    }
    public function cg()
    {
        return '登录成功跳转';
    }
    public function ds()
    {
        return '登录失败跳转';
    }

}
当我将重定向的url替换成mqqapi协议的时候,报如下错误。

这个show_pslcard按道理来说只是这个mqqapi协议的url其中的一部分,不知道为什么会出现这样的错误。
最佳答案
评论( 相关
后面还有条评论,点击查看>>