GithubHelp home page GithubHelp logo

garyvv / wechat-auth Goto Github PK

View Code? Open in Web Editor NEW
21.0 1.0 8.0 271 KB

laravel框架开发的前后端分离的微信登录,根据访问链接回调,,配置化自动回复,demo需先关注测试公众号

Home Page: http://wxauth.garylv.com/wechat

License: MIT License

PHP 90.41% JavaScript 1.52% HTML 7.03% Vue 0.52% CSS 0.52%
laravel easywechat wechat-auth wechat-login wechat php

wechat-auth's Introduction

wechat-auth

2018-11-13,升级到 laravel5.7 & easyWeChat 的4.0版本


基于 EasyWeChat进行微信登录的封装

laravel-5.7

前后端分离的微信登录,demo是同域的前端工程,token存Cookie

个人开发者,只能用测试公众号,访问demo链接,请先关注测试号

How To Install

  • composer install
  • cp .env.example .env , 配置你的数据库信息
  • cp config/wechat.example.php config/wechat.php , 配置你的微信信息

使用说明

config/wechat.php

  • 微信配置文件
  • 自定义key说明:
    'default_reply' => '默认回复文本',
    
    'auto_reply' => [
            [
                'request' => ['用户输入的关键词', '关键词'],
                'response' => '回复的文本',
                'rule' => 'match',  // match:关键词必须精准匹配,fuzzy:关键词模糊匹配(尽量不要用单个字)
            ],
            ....
        ],
    
    'subscribe_reply' => '关注回复的文本',

存储访客信息表结构

  CREATE TABLE `wes_users` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `openid` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '',
    `nickname` varchar(255) CHARACTER SET utf8 DEFAULT '',
    `avatar` varchar(255) CHARACTER SET utf8 DEFAULT '',
    `gender` tinyint(4) DEFAULT '0',
    `ip` varchar(40) CHARACTER SET utf8 DEFAULT '',
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `wes_users_openid_unique` (`openid`)
  ) ENGINE=InnoDB CHARSET=utf8mb4 ROW_FORMAT=COMPACT;

wechat-auth's People

Contributors

garyvv avatar

Stargazers

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

Watchers

 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.