Skip to content

Commit

Permalink
Merge pull request #15518 from handsomeliuyang/main
Browse files Browse the repository at this point in the history
【harmony-hybrid】switchTab、navigateTo等路由函数可以被hook;支持requriePlugin方法
  • Loading branch information
qican777 committed Apr 17, 2024
2 parents 134812f + 83aeca6 commit b3e4a35
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1296,18 +1296,9 @@
"phoneNumber": true
}
},
"navigateBack": {
"object": {
"delta": true
}
},
"navigateBack": false,
"navigateBackMiniProgram": false,
"navigateTo": {
"object": {
"url": true,
"events": true
}
},
"navigateTo": false,
"navigateToBookshelf": false,
"navigateToMiniProgram": {
"object": {
Expand Down Expand Up @@ -1603,19 +1594,15 @@
}
},
"queryBookshelf": false,
"reLaunch": {
"object": {
"url": true
}
},
"reLaunch": false,
"readBLECharacteristicValue": {
"object": {
"characteristicId": true,
"deviceId": true,
"serviceId": true
}
},
"redirectTo": true,
"redirectTo": false,
"removeSavedFile": {
"object": {
"filePath": true
Expand Down Expand Up @@ -1971,11 +1958,7 @@
"stopWifi": true,
"subscribeService": false,
"subscribeVoIPVideoMembers": false,
"switchTab": {
"object": {
"url": true
}
},
"switchTab": false,
"tradePay": false,
"unsubscribeMessage": false,
"updateBookshelfReadTime": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1036,12 +1036,6 @@
* @canNotUse onLocalServiceResolveFail
*/

/**
* 监听隐私接口需要用户授权事件。
*
* @canNotUse onNeedPrivacyAuthorization
*/

/**
* 在最近的八次网络请求中, 出现下列三个现象之一则判定弱网。
* - 出现三次以上连接超时
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export * from './network'
export * from './open-api'
export * from './payment'
export * from './qq'
export * from './route'
// export * from './route'
export * from './share'
export * from './storage'
export * from './swan'
Expand Down
34 changes: 0 additions & 34 deletions packages/taro-platform-harmony-hybrid/src/api/apis/route/index.ts

This file was deleted.

14 changes: 12 additions & 2 deletions packages/taro-platform-harmony-hybrid/src/api/apis/taro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
switchTab,
} from './index'
import native from './NativeApi'
import { permanentlyNotSupport } from './utils'
// import { permanentlyNotSupport } from './utils'

// @ts-ignore
window.base64ToArrayBuffer = (base64: string) => toByteArray(base64).buffer
Expand Down Expand Up @@ -105,7 +105,15 @@ const taro: typeof Taro = {
useUnload
}

export const requirePlugin = permanentlyNotSupport('requirePlugin')
// export const requirePlugin = permanentlyNotSupport('requirePlugin')
const requirePlugin = () => {
return {
world: '',
hello: function () {

}
}
}

function getConfig (): Record<string, any> {
if (this?.pxTransformConfig) return this.pxTransformConfig
Expand Down Expand Up @@ -348,6 +356,7 @@ function loadChooseLocationStyle () {

loadChooseLocationStyle()

taro.requirePlugin = requirePlugin
taro.getApp = getApp
taro.pxTransform = pxTransform
taro.initPxTransform = initPxTransform
Expand Down Expand Up @@ -377,6 +386,7 @@ export {
options,
preload,
pxTransform,
requirePlugin,
useAddToFavorites,
useDidHide,
useDidShow,
Expand Down

0 comments on commit b3e4a35

Please sign in to comment.