Giter Site home page Giter Site logo

qqyule / web_weixinshare Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joekeikun/web_weixinshare

0.0 1.0 0.0 14 KB

网页从多端(包括微信)分享到微信内时,加入图片、标题和描述特征

PHP 49.80% HTML 15.53% JavaScript 34.67%

web_weixinshare's Introduction

微信分享模块 - 提取

@(微信分享)[微信|手百]

因为项目开发原因,经常需要将开发的页面从手百或微信内分享到微信的好友或朋友圈中,所以抽时间将该模块提炼出来,减少开发成本

  • 后端 - backend文件夹,使用php,通过发送请求带上?url=xxxx获取当下最新签名。
  • 前端 - fontend文件夹,主要在html头部设置配置,同时根据不同的环境调用share.js中的不同初始化方法。

[TOC]

使用教程

  1. 将backend文件夹放置到服务器上,修改成自己任意喜欢的接口名字(下文继续称backend)
  2. 在backend文件夹下建立一个 .env 文件,内容是:
{"appid":"微信公众号id","appsecret": "微信公众号secret码"}
  1. 接下来去微信公众号后台,进入配置>公众号设置>功能设置>JS接口安全域名页面,将服务器的域名配置上去(需要将一个文件存储到服务器访问根目录文件夹下,然后才能设置成功,如此才能确保微信js sdk文件可以在网站下正常运行)
  2. 将frontend文件夹内需要的内容拷贝到自己的项目中,将index.html中的几段js拷贝到项目的页面中,设置好 shareTitleshareDescshareImgUrl 三个参数(对应分享的标题、描述、缩略图)
  3. 剩下请开始验证分享是否ok

反馈

web_weixinshare's People

Watchers

qqyule 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.