Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-08-09 15:27:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d54bc0d59c5215a7ad3f4493102d014627d51e56
d54bc0d5
1 parent
b7bb28f7
ref |> 统一uri配置。解决推送、H5换端等问题
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
34 deletions
sight_harmony/commons/wdRouter/src/main/ets/utils/AppInnerLink.ets
sight_harmony/products/phone/src/main/ets/startupmanager/StartupManager.ets
sight_harmony/products/phone/src/main/module.json5
sight_harmony/commons/wdRouter/src/main/ets/utils/AppInnerLink.ets
View file @
d54bc0d
import { url } from '@kit.ArkTS'
import { RetryHolderManager } from '@ohos/imageknife/src/main/ets/components/imageknife/holder/RetryHolderManager'
import App from '@system.app'
import { Action, Params } from 'wdBean/Index'
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
...
...
@@ -17,12 +18,12 @@ export class AppInnerLink {
// 内链跳转
// 内链地址例如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1
static jumpWithLink(innerLink: string) {
static jumpWithLink(innerLink: string)
: boolean
{
let params = AppInnerLink.parseParams(innerLink)
if (!params) {
Logger.info(TAG, "跳转无效的链接地址 " + innerLink)
return
return
false
}
switch (params.skipType) {
...
...
@@ -48,8 +49,10 @@ export class AppInnerLink {
}
default: {
Logger.info(TAG, "跳转无效的链接地址 " + innerLink)
return false
}
}
return true
}
private static jumpParams(params: InnerLinkParam) {
...
...
sight_harmony/products/phone/src/main/ets/startupmanager/StartupManager.ets
View file @
d54bc0d
...
...
@@ -252,16 +252,18 @@ export class StartupManager {
private dealWithDeepLink(want: Want): boolean {
if (!want.parameters) {
return false
// H5换端地址
let innerLink = want["uri"] as string
if (innerLink && innerLink.length) {
return AppInnerLink.jumpWithLink(innerLink)
}
if (want.parameters) {
// 桌面组件换端
let deepLink = want.parameters[NewspaperWidgetCommon.JumpParam.DeepLinkKey] as string
if (deepLink && deepLink.length) {
AppInnerLink.jumpWithLink(deepLink)
return true
return AppInnerLink.jumpWithLink(deepLink)
}
}
return false
}
...
...
sight_harmony/products/phone/src/main/module.json5
View file @
d54bc0d
...
...
@@ -29,7 +29,7 @@
"audioPlayback"
],
"skills"
:
[
{
{
//
App
Linking
跳转
"entities"
:
[
"entity.system.browsable"
],
...
...
@@ -37,11 +37,6 @@
"ohos.want.action.viewData"
],
"uris"
:
[
//
{
//
之前的
推送配置
//
"scheme"
:
'rmrbapp'
,
//
"host"
:
'rmrb.app'
,
//
'port'
:
'
8080
'
,
//
"path"
:
'openwith'
}
{
"scheme"
:
"https"
,
"host"
:
"pd-people-uat.pdnews.cn"
,
...
...
@@ -145,39 +140,39 @@
],
"domainVerify"
:
true
},
{
{
//
默认的
"entities"
:
[
"entity.system.home"
,
],
"actions"
:
[
"com.test.pushaction"
,
"action.system.home"
,
],
}
,
{
"uris"
:
[
{
//
推送配置
-
(播控中心共用)
{
//
H5换端
"actions"
:
[
"ohos.want.action.viewData"
],
"uris"
:
[
{
"scheme"
:
"rmrbapp"
,
"host"
:
"rmrb.app"
,
"path"
:
"openwith"
},
]},
{
//
推送
"actions"
:
[
"com.test.pushaction"
],
"uris"
:
[
{
"scheme"
:
'rmrbapp'
,
"host"
:
'rmrb.app'
,
'port'
:
'
8080
'
,
"path"
:
'openwith'
}
]
},
{
//
普通配置
-
暂时无法跳转
-
??
"scheme"
:
"rmrbapp"
,
"host"
:
"rmrb.app"
,
"path"
:
"openwith"
},
//
{
//
分享用
-
正式环境地址
//
"scheme"
:
"https"
,
//
"host"
:
"www.peopleapp.com"
,
//
"pathStartWith"
:
"column"
//
},
//
{
//
分享用
-
测试环境地址
//
"scheme"
:
"https"
,
//
"host"
:
"pd-people-uat.pdnews.cn"
,
////
"pathStartWith"
:
"column"
//
}
]}
]
}
],
...
...
Please
register
or
login
to post a comment