微信浏览器的页面在PC端访问:php
普通的在微信浏览器看的页面若是不在php代码中解析一下,而后复制连接在PC打开就出现没法访问,由于它复制的地址是:html
public function _before_index() { $this->getWeChat(); if (is_null($_GET['openid']) && !is_null($_GET['code'])) { $info_array = get_user_info($this->appid , $this->secret , $_GET['code']); $this->redirect('index' , array('openid' => $info_array['openid'])); } }
就是通常写一个前置方法,而后调用getWeChat()进行解析。若是解析失败须要本身根据控制器名,方法名进行拼装:api
http://xxxxx.com/index.php?s=/wechat/Zwfw/index/openid/orMoot8M3THY3mXOQ_6B31zRiaAg浏览器
后面的openid能够随便填写微信