Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xtdev/bff-request-miniprogram

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xtdev/bff-request-miniprogram - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

7

dist/index.js

@@ -72,9 +72,8 @@ class BFFRequest {

url = this.baseURL + url;
const opt = Object.assign(Object.assign({ url, data: params, method, dataType: 'json', responseType: 'text' }, arg), { success: (res) => {
this.responseInterceptor && this.responseInterceptor(res);
resolve(res);
let opt = Object.assign(Object.assign({ url, data: params, method, dataType: 'json', responseType: 'text' }, arg), { success: (res) => {
this.responseInterceptor ? resolve(this.responseInterceptor(res)) : resolve(res);
}, fail: (err) => {
reject(err);
} });
this.requestInterceptor && this.requestInterceptor(opt);
opt = this.requestInterceptor ? this.requestInterceptor(opt) : opt;
wx.request(opt);

@@ -81,0 +80,0 @@ });

{
"name": "@xtdev/bff-request-miniprogram",
"version": "0.0.4",
"version": "0.0.5",
"description": "a http request for xiantan BFF",

@@ -5,0 +5,0 @@ "keywords": [

@@ -35,3 +35,3 @@ /// <reference path="node_modules/wechat-miniprogram/index.d.ts"

*/
requestInterceptor: null | ((res: WechatMiniprogram.RequestOption) => void) = null
requestInterceptor: null | ((res: WechatMiniprogram.RequestOption) => WechatMiniprogram.RequestOption) = null
/**

@@ -41,3 +41,3 @@ * 返回拦截器

*/
responseInterceptor: null | ((res: WechatMiniprogram.RequestSuccessCallbackResult) => void) = null
responseInterceptor: null | ((res: WechatMiniprogram.RequestSuccessCallbackResult) => any) = null
/**

@@ -84,3 +84,3 @@ * 网络请求Post

if(this.baseURL && !url.startsWith('http')) url = this.baseURL + url
const opt = {
let opt = {
url,

@@ -93,4 +93,3 @@ data: params,

success: (res: WechatMiniprogram.RequestSuccessCallbackResult): void => {
this.responseInterceptor && this.responseInterceptor(res);
resolve(res);
this.responseInterceptor ? resolve(this.responseInterceptor(res)) : resolve(res);
},

@@ -101,3 +100,3 @@ fail: (err: WechatMiniprogram.GeneralCallbackResult): void => {

};
this.requestInterceptor && this.requestInterceptor(opt);
opt = this.requestInterceptor ? this.requestInterceptor(opt) : opt;
wx.request(opt);

@@ -104,0 +103,0 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc