# wxapi **Repository Path**: bobbys/wxapi ## Basic Information - **Project Name**: wxapi - **Description**: tp6 wxapi init - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-01-22 - **Last Updated**: 2024-05-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 部署环境 `thinkphp6` `php >= 7.2` `nginx 1.14.*` # nginx config ``` server { listen 8001; server_name _; root /data/wxapi/public; index index.html index.htm index.php; location / { add_header Access-Control-Allow-Origin '*'; #add_header Access-Control-Allow-Credentials 'true'; add_header Access-Control-Allow-Methods '*'; add_header Access-Control-Allow-Headers 'User-Agent,Origin,Content-Type,Accept,Authorization'; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; } } location ~ \.php(.*)$ { fastcgi_pass unix:/run/php-fpm/www.sock; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; } } ``` # 添加自定义配置文件 config\extra.php ``` '123456', //测试公号 'wx_app_id' => '****************', 'wx_app_secret' => '*********************', ]; ``` ``` cd . chmod 777 -R runtime ``` # 微信信息存储 ``` runtime/access_token.json runtime/jsticket_token.json ``` # 安装依赖管理包 composer install # 本地运行 php think run ``` # 分享接口 http://127.0.0.1:8000/index/getSignPackage