Giter Site home page Giter Site logo

Comments (4)

Finb avatar Finb commented on May 14, 2024

能否提供一个url给我测试呢?只需把url path后面的参数部分给我就行

from bark.

Tomorrowxxy avatar Tomorrowxxy commented on May 14, 2024

已发送到[email protected]邮箱

from bark.

Finb avatar Finb commented on May 14, 2024

@Tomorrowxxy 你好,已收到,原因是你要打开的URL是当做推送URL的参数,里面的特殊字符会破坏推送URL的结构

例如

let title  = "test&body=haha"
let pushUrl = "https://api.day.app/?title=" + title
//其实是想推 “test&body=haha” 这段文字到手机的 , 但是由于参数没有URL编码,导致最后的URL拼成了这样:
// https://api.day.app/?title=test&body=haha //很显然,客户端会收到 title 和 body 两个参数

//所以参数需要URL编码一下
let pushUrl = "https://api.day.app/?title=" + title.encodeURIComponent() 
//最后的URL是:
//https://api.day.app/?title=test%26body%3dhaha

你的问题也是如此。
只需要对参数的值(你传递的那个URL)进行编码即可,

我建议你可以 默认对所有传递参数进行URL编码

from bark.

Tomorrowxxy avatar Tomorrowxxy commented on May 14, 2024

@Finb 我刚尝试了一下还是没有成功 不知为何
wechat同名

from bark.

Related Issues (20)

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.