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

@mpxjs/api-proxy

Package Overview
Dependencies
Maintainers
12
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mpxjs/api-proxy - npm Package Compare versions

Comparing version 2.8.44 to 2.8.46

4

package.json
{
"name": "@mpxjs/api-proxy",
"version": "2.8.44",
"version": "2.8.46",
"description": "convert miniprogram API at each end",

@@ -42,3 +42,3 @@ "module": "src/index.js",

},
"gitHead": "cd1f38bc84aca8b2a2e5ec890aa1e2f2693f26e3"
"gitHead": "dcf6f000660d56207ff414cb776e8bc6d5ce651f"
}
import { webHandleSuccess, webHandleFail, isTabBarPage } from '../../../common/js'
import { EventChannel } from '../event-channel'
let routeCount = 0
function redirectTo (options = {}) {

@@ -12,7 +14,13 @@ const router = global.__mpxRouter

}
router.__mpxAction = { type: 'redirect' }
router.__mpxAction = {
type: 'redirect'
}
if (routeCount === 0 && router.currentRoute.query.routeCount) routeCount = router.currentRoute.query.routeCount
return new Promise((resolve, reject) => {
router.replace(
{
path: options.url
path: options.url,
query: {
routeCount: ++routeCount
}
},

@@ -50,6 +58,10 @@ () => {

}
if (routeCount === 0 && router.currentRoute.query.routeCount) routeCount = router.currentRoute.query.routeCount
return new Promise((resolve, reject) => {
router.push(
{
path: options.url
path: options.url,
query: {
routeCount: ++routeCount
}
},

@@ -86,15 +98,13 @@ () => {

let reLaunchCount = 0
function reLaunch (options = {}) {
const router = global.__mpxRouter
if (router) {
if (reLaunchCount === 0 && router.currentRoute.query.reLaunchCount) reLaunchCount = router.currentRoute.query.reLaunchCount
const delta = router.stack.length - 1
if (routeCount === 0 && router.currentRoute.query.routeCount) routeCount = router.currentRoute.query.routeCount
router.__mpxAction = {
type: 'reLaunch',
path: options.url,
reLaunchCount: ++reLaunchCount,
routeCount: ++routeCount,
replaced: false
}
const delta = router.stack.length - 1
// 在需要操作后退时,先操作后退,在beforeEach中基于当前action通过next()进行replace操作,避免部分浏览器的表现不一致

@@ -110,3 +120,3 @@ if (delta > 0) {

query: {
reLaunchCount
routeCount
}

@@ -144,3 +154,2 @@ },

}
const delta = router.stack.length - 1
router.__mpxAction = {

@@ -151,2 +160,3 @@ type: 'switch',

}
const delta = router.stack.length - 1
if (delta > 0) {

@@ -153,0 +163,0 @@ router.go(-delta)

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