Issues with cross-domain requests

Source: Internet
Author: User

My front-end code is like this,
The backstage is written in PHP,


  , ' returndesc ' = ' success ');        Returns the underlying data function __construct () {$this->return[' servertime ') =time ();        Log::record (' Incoming parameters: '. Var_export ($_request, True), Log::D ebug);        $this->params = @json_decode (Base64_decode ("I (' Post.params '), true), true);            if (! $this->params) {$this->return[' returncode ') = 100;            $this->return[' returndesc '] = ' sign failed! ';        $this->responsejson ();            }else if (C (' key ')! = $this->params[' key ') {$this->return[' returncode '] = 100;            $this->return[' returndesc '] = ' sign failed! ';            $this->return[' returnalert '] = ' key is incorrect! ';        $this->responsejson ();        }/* * Check how the interface is passed in */Public function Checkpublicparams ($interfaces) {$pass = false;        $this->return[' returncode '] = 100; if (! I (' post. '))        {$this->return[' returndesc ') = ' request method error '; } else if (! I (' Post.method ') | | ! I (' Post.parAMs ') {$this->return[' returndesc ') = ' interface parameter error ';        } else if (!array_key_exists (I (' Post.method '), $interfaces)) {$this->return[' returndesc '] = ' interface name error ';            } else {$this->return[' returncode ') = 200;        $pass = true;    } return $pass;    } protected function Responsejson () {exit (Json_encode ($this->return)); }}

The unchanged state is the return authentication failure
"{" ReturnCode ":" Returndesc ":" Sign failed! "," Servertime ": 1476799012}"
I found a way to change it on the Internet.

But I don't know how to modify it.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.