900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > 饿了么 美团外卖红包小程序欢迎了解一下(0基础搭建自己的外卖分销cps小程序)

饿了么 美团外卖红包小程序欢迎了解一下(0基础搭建自己的外卖分销cps小程序)

时间:2021-05-29 06:48:24

相关推荐

饿了么 美团外卖红包小程序欢迎了解一下(0基础搭建自己的外卖分销cps小程序)

外卖cps带分销返利源码

怎么推广“外卖CPS项目”赚佣金?

饿了么美团外卖红包小程序搭建教程

源代码地址

搭建步骤

下载以上源代码到本地

成品展示

截图

步骤

下载以上源代码到本地

修改为你自己的微信小程序,打开 /dist/pages/ele/index.js

微信小程序->开发管理->开发设置 添加 request的域名: 地址:

https://mp./wxamp/devprofile/get_profile?token=271531762&lang=zh_CN

小程序管理后台配置你的链接

后台地址: 进去之后选择小程序管理->无裂变小程序管理->添加小程序->填入你自己的链接

微信开发者工具,导入项目,提交审核

/*!* type-is* Copyright(c) Jonathan Ong* Copyright(c) - Douglas Christopher Wilson* MIT Licensed*/'use strict'/*** Module dependencies.* @private*/var typer = require('media-typer')var mime = require('mime-types')/*** Module exports.* @public*/module.exports = typeofrequestmodule.exports.is = typeismodule.exports.hasBody = hasbodymodule.exports.normalize = normalizemodule.exports.match = mimeMatch/*** Compare a `value` content-type with `types`.* Each `type` can be an extension like `html`,* a special shortcut like `multipart` or `urlencoded`,* or a mime type.** If no types match, `false` is returned.* Otherwise, the first `type` that matches is returned.** @param {String} value* @param {Array} types* @public*/function typeis (value, types_) {var ivar types = types_// remove parameters and normalizevar val = tryNormalizeType(value)// no type or invalidif (!val) {return false}// support flattened argumentsif (types && !Array.isArray(types)) {types = new Array(arguments.length - 1)for (i = 0; i < types.length; i++) {types[i] = arguments[i + 1]}}// no types, return the content typeif (!types || !types.length) {return val}var typefor (i = 0; i < types.length; i++) {if (mimeMatch(normalize(type = types[i]), val)) {return type[0] === '+' || type.indexOf('*') !== -1? val: type}}// no matchesreturn false}/*** Check if a request has a request body.* A request with a body __must__ either have `transfer-encoding`* or `content-length` headers set.* /Protocols/rfc2616/rfc2616-sec4.html#sec4.3** @param {Object} request* @return {Boolean}* @public*/function hasbody (req) {return req.headers['transfer-encoding'] !== undefined ||!isNaN(req.headers['content-length'])}/*** Check if the incoming request contains the "Content-Type"* header field, and it contains any of the give mime `type`s.* If there is no request body, `null` is returned.* If there is no content type, `false` is returned.* Otherwise, it returns the first `type` that matches.** Examples:**// With Content-Type: text/html; charset=utf-8*this.is('html'); // => 'html'*this.is('text/html'); // => 'text/html'*this.is('text/*', 'application/json'); // => 'text/html'**// When Content-Type is application/json*this.is('json', 'urlencoded'); // => 'json'*this.is('application/json'); // => 'application/json'*this.is('html', 'application/*'); // => 'application/json'**this.is('html'); // => false** @param {String|Array} types...* @return {String|false|null}* @public*/function typeofrequest (req, types_) {var types = types_// no bodyif (!hasbody(req)) {return null}// support flattened argumentsif (arguments.length > 2) {types = new Array(arguments.length - 1)for (var i = 0; i < types.length; i++) {types[i] = arguments[i + 1]}}// request content typevar value = req.headers['content-type']return typeis(value, types)}/*** Normalize a mime type.* If it's a shorthand, expand it to a valid mime type.** In general, you probably want:** var type = is(req, ['urlencoded', 'json', 'multipart']);** Then use the appropriate body parsers.* These three are the most common request body types* and are thus ensured to work.** @param {String} type* @private*/function normalize (type) {if (typeof type !== 'string') {// invalid typereturn false}switch (type) {case 'urlencoded':return 'application/x-www-form-urlencoded'case 'multipart':return 'multipart/*'}if (type[0] === '+') {// "+json" -> "*/*+json" expandoreturn '*/*' + type}return type.indexOf('/') === -1? mime.lookup(type): type}/*** Check if `expected` mime type* matches `actual` mime type with* wildcard and +suffix support.** @param {String} expected* @param {String} actual* @return {Boolean}* @private*/function mimeMatch (expected, actual) {// invalid typeif (expected === false) {return false}// split typesvar actualParts = actual.split('/')var expectedParts = expected.split('/')// invalid formatif (actualParts.length !== 2 || expectedParts.length !== 2) {return false}// validate typeif (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) {return false}// validate suffix wildcardif (expectedParts[1].substr(0, 2) === '*+') {return expectedParts[1].length <= actualParts[1].length + 1 &&expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length)}// validate subtypeif (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) {return false}return true}/*** Normalize a type and remove parameters.** @param {string} value* @return {string}* @private*/function normalizeType (value) {// parse the typevar type = typer.parse(value)// remove the parameterstype.parameters = undefined// reformat itreturn typer.format(type)}/*** Try to normalize a type and remove parameters.** @param {string} value* @return {string}* @private*/function tryNormalizeType (value) {if (!value) {return null}try {return normalizeType(value)} catch (err) {return null}}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。