Giter Club home page Giter Club logo

wechat_shop's Introduction

wechatshop 微信小程序商城完整版

小程序服务端 server_api 部署方法

  • PS: 注意,你的服务器一定要支持url rewrite模式,且PHP版本最好是 PHP5.6 , 支持PHP7.0;

部署步骤

  1. 上传 server_api 目录下的所有代码到你的服务器并运行 yourname.com/adminer.php 使用你的mysql账号登录后 导入数据 docs\wechat_shop.sql.gz 【会自动创建数据库和导入演示数据】

  2. 修改App/Common/Conf/db.php 里面的数据库连接参数为你自己的;

  • 只需要修改你的数据库用户名和密码即可
'DB_USER'               =>  'root',      // 用户名
'DB_PWD'                =>  '123456',      //数据库用户密码
  1. App/Api/Conf/config.php 微信小程序的appid、secret、mchid、key、notify_url,SELF_ROOT的参数修改;

  2. ThinkPHP\Library\Vendor\wxpay\lib\WxPay.Config.php 微信小程序的appid、appsecret、mchid、key参数修改;

  3. ThinkPHP\Library\Vendor\WeiXinpay\lib\WxPay.Config.php 微信小程序的appid、appsecret、mchid、key、notify_url参数修改;

  4. App/Api/Controller/WxPayController.class.php 50行修改链接

  5. 必须开启 URL Rewrite才能使用本系统

  • 后台登录地址: youname.com/Admin/Login/index.html 用户名是admin,密码是123456

PHP开启pathinfo模式支持方法

打开你的php.ini配置文件,找到 cgi.fix_pathinfo 将前面的 ; 注释去掉, 后面的值改为0

cgi.fix_pathinfo=0

Tengine/nginx配置文件示例

server {
    listen    80;
    #你的域名,根据实际情况修改
    server_name  wxshop.yunnan.ws;
    #你的server_api文件夹位置,,根据实际情况修改
    root    /home/wechat_shop/server_api;
    #模式页面配置
    index index.html index.php index.htm;
  #这个是你的php的执行配置,根据实际情况修改
  location ~ [^/]\.php(/|$) {
    #fastcgi_pass remote_php_ip:9000;
    fastcgi_pass unix:/dev/shm/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
    }
  #rewrite配置,很重要,如果你不知道你在做什么,请勿修改!!!
  if (!-e $request_filename) {
    rewrite "^/(.*)"  /index.php?s=/$1 last;
    break;
  }
  #禁止访问.ht文件配置
  location ~ /\.ht {
    deny all;
  }
  #禁止上传/静态目录的脚本权限
  location ~* .*\/(Data|public|static|uploads|images)\/.*\.(php|php5|phps|asp|aspx|jsp)$ {
     deny all;
  }
  # access_log
  access_log  /home/wwwlogs/wxshop.dd_access.log  combined;
}

Apache URL Rewrite配置示例

.htaccess 文件

<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$  /index.php?s=$1 [QSA,PT,L]
</IfModule>

小程序源码目录 wxss_src

  • 小程序配置方法:

wxss_src/app.js 配置 hostUrl、 ceshiUrl 为你安装的服务端的URL地址

  • 腾讯云解决方案分配的域名 wxss_src/config.js

小程序源码:https://github.com/tekintian/wechat_shop/tree/master/wxss_src

PS:

本项目为学习项目,基础代码来源网络,在此之上做了功能模块的增强和安全方面的修复,欢迎for.......... 欢迎 star!

wechat_shop's People

Contributors

tekintian avatar tekinvip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wechat_shop's Issues

Setup Airbrake for your PHP application

Installation

Install Airbrake using Composer by running the following command from your project's directory:

composer require airbrake/phpbrake

Example Usage

Copy the following configuration snippet into your PHP app. It shows how to initialize Airbrake and register the instance as an error handler:

(You can find your project ID and API KEY with your project's settings):

$notifier = new Airbrake\Notifier(array(
    'projectId' => <Your project ID>,
    'projectKey' => '<Your project API KEY>'
));

Airbrake\Instance::set($notifier);

$handler = new Airbrake\ErrorHandler($notifier);
$handler->register();

To send a test error, you can call Airbrake directly like in this try/catch example:

try {
    throw new Exception('hello from phpbrake');
} catch(Exception $e) {
    Airbrake\Instance::notify($e);
}

Framework integrations

Going further

Check out our official GitHub repo for info on additional features like:

立即购买bug

将商品添加到购物车,点急立即购买出现如下情况。
image

规格问题

商品规格,前后台被删减代码。。。

有关 PATH_INFO 问题, 请求帮助

环境:

  • centOS
  • Nginx 1.14
  • PHP 7.0
  • 宝塔搭建的环境

问题:
访问域名/Admin/Login 出现 404 错误

描述:
在我的 MacOS 系统上, 本地跑没有问题成功了, 使用了 mamp 配置环境, 向 Nginx 中添加以下规则

#rewrite配置,很重要,如果你不知道你在做什么,请勿修改!!!
  if (!-e $request_filename) {
    rewrite "^/(.*)"  /index.php?s=/$1 last;
    break;
  }

本地成功了, 就放到服务器上, 向对应域名内添加如上规则, 并不能成功
image
image
我的 php7.0 配置中明明有引入 pathinfo

数据导入失败

查询出错 (1044): Access denied for user 'xxxxxx'@'localhost' to database 'wechat_shop'

123

部署文档清楚,部署简单易懂,前后端齐全,适合初学者。缺点就是功能不丰富。期盼作者持续更新…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.