Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支付宝小程序的支持 #143

Open
yplxc opened this issue Jul 25, 2024 · 3 comments
Open

支付宝小程序的支持 #143

yplxc opened this issue Jul 25, 2024 · 3 comments

Comments

@yplxc
Copy link

yplxc commented Jul 25, 2024

作者您好,关于支付宝小程序已经支持put,delete等请求方法,作者能否支持一下呢

@lei-mu
Copy link
Owner

lei-mu commented Jul 25, 2024

uni 的文档 仍然显示没有支持。https://uniapp.dcloud.net.cn/api/request/request.html;
所有目前没有支持计划。

解决方案,因为 是基于class 类开发的,你可以很简单的扩展自己的类方法。如

import Request from 'luch-request'

Request.prototype.mPut = function(url, data, options = {}) {
    return this.middleware({
      url,
      data,
      method: 'PUT',
      ...options
    })
  }

Request.prototype.mDelete = function(url, data, options = {}) {
    return this.middleware({
      url,
      data,
      method: 'DELETE',
      ...options
    })
  }

@lei-mu
Copy link
Owner

lei-mu commented Jul 25, 2024

当然你也可以 覆盖 原本的 put delete 方法

@yplxc
Copy link
Author

yplxc commented Jul 25, 2024

好的,谢谢作者

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants