国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Thinkphp5 uses redirect problem
芒果
芒果 2017-10-04 16:29:10
0
2
2794

Hello teacher, I encountered a very confusing problem when using redirect in thinkphp5, I hope you can help answer it.

<?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 '登錄成功跳轉(zhuǎn)';
    }
    public function ds()
    {
        return '登錄失敗跳轉(zhuǎn)';
    }
}

This code follows the method the teacher said. If successful, it will jump to the Baidu web page. There is no problem in executing this code. However, when I replace the redirected url with another one, ,A problem occurred.

Replace as follows:

<?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 '登錄成功跳轉(zhuǎn)';
    }
    public function ds()
    {
        return '登錄失敗跳轉(zhuǎn)';
    }
}

As shown in the code, I replaced the redirected address with an address of the mqqapi protocol (this is a protocol of QQ). When I replaced it with this When entering the address, the following error is reported:

QQ圖片20171004023810.png

Logically speaking, this show_pslcard is just part of the URL of the mqqapi protocol. I don’t know why such an error occurs. Is it conflicting with something in the thinkphp framework, or is it for some other reason.

I hope the teacher can help me answer it.

芒果
芒果

reply all(2)
直奔十維

Expired session temporary files will be automatically deleted only when the session temporary files are located in the temporary directory of the operating system

qzuser

thinkphp The parameter usage of the redirect method is consistent with the usage of the Url::build method. You will understand after checking the reference manual. Use it directly? It will be resolved first as accessing local methods. Unable to achieve expected results

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template