nginx配置pathinfo

location ~ \.php {    #去掉$
     root          H:/PHPServer/WWW;
     fastcgi_pass   127.0.0.1:9000;
     fastcgi_index  index.php;
     fastcgi_split_path_info ^(.+\.php)(.*)$;     #增加这一句
     fastcgi_param PATH_INFO $fastcgi_path_info;    #增加这一句
     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
     include        fastcgi_params;
}

相关资料

简单配置nginx使之支持pathinfo
TP5-URL重写
dolphinphp常见问题

API设计资料整理

 

接口认证

OAuth 2.0 [oauth-php]

自定服务与客户端相同算法认证

        // 签名认证 
            $signature = $this->request ( "signature" ); // app端生成的签名
            $token = $this->request ( "token" ); // app端生成的随机字符串
            
            if (! $signature || ! $token) {
                $this->wrong ( '缺少参数' );
            }
            
            $signature1 = md5 ( sha1 ( $token ) . C ( "SIGN_KEY" ) );
            
            if ($signature != $signature1) {
                $this->wrong ( '非法调用' );
            }

Continue reading “API设计资料整理”