Git Product home page Git Product 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

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.