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

【harmony-hybrid】switchTab、navigateTo等路由函数可以被hook;支持requriePlugin方法 #15518

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading