Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
2f25fafc
Commit
2f25fafc
authored
Nov 26, 2021
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[1006021]域名合并
parent
be516cae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
ServeLinkUtils.java
...src/main/java/com/pcloud/common/utils/ServeLinkUtils.java
+34
-7
No files found.
pcloud-common/src/main/java/com/pcloud/common/utils/ServeLinkUtils.java
View file @
2f25fafc
...
...
@@ -227,20 +227,47 @@ public class ServeLinkUtils {
protocol
=
"http://"
;
}
String
resultUrl
=
""
;
if
(
StringUtil
.
isEmpty
(
random
))
{
random
=
officialAccountsId
;
}
if
(!
StringUtil
.
isEmpty
(
serveLink
))
{
if
(
serveLink
.
startsWith
(
"http"
))
{
return
serveLink
;
}
if
(
serveLink
.
startsWith
(
"*"
))
{
String
endUrl
=
serveLink
.
substring
(
serveLink
.
indexOf
(
"/"
),
serveLink
.
length
());
if
(
random
==
null
)
{
resultUrl
=
protocol
+
"app."
+
firstDomain
+
"/"
+
serveLink
.
substring
(
1
,
serveLink
.
indexOf
(
"/"
))
+
"/W"
String
endUrl
=
serveLink
.
substring
(
serveLink
.
indexOf
(
"/"
));
resultUrl
=
protocol
+
"weixin"
+
random
+
"."
+
firstDomain
+
"/"
+
serveLink
.
substring
(
1
,
serveLink
.
indexOf
(
"/"
))
+
"/W"
+
officialAccountsId
+
endUrl
;
}
else
{
resultUrl
=
protocol
+
"app"
+
random
+
"."
+
firstDomain
+
"/"
+
serveLink
.
substring
(
1
,
serveLink
.
indexOf
(
"/"
))
+
"/W"
+
officialAccountsId
+
endUrl
;
}
}
else
{
resultUrl
=
protocol
+
domain
+
"/W"
+
officialAccountsId
+
serveLink
;
}
}
return
resultUrl
;
}
/**
* 获取作品/应用跳转链接(包含域名)
*/
public
static
String
splitUrl
(
String
url
,
Long
officialAccountsId
,
String
protocol
,
String
domain
,
String
firstDomain
,
Long
random
)
{
if
(
StringUtil
.
isEmpty
(
url
)
||
null
==
officialAccountsId
)
{
return
url
;
}
if
(
null
==
random
)
{
random
=
officialAccountsId
;
}
return
getCompleteLink
(
url
,
officialAccountsId
.
toString
(),
protocol
,
domain
,
firstDomain
,
random
.
toString
());
}
/**
* 获取作品/应用跳转链接的域名
*/
public
static
String
getAppDomain
(
Long
officialAccountsId
,
Long
random
,
String
firstDomain
)
{
if
(
null
==
officialAccountsId
||
StringUtil
.
isEmpty
(
firstDomain
)){
return
null
;
}
if
(
null
==
random
)
{
random
=
officialAccountsId
;
}
return
"weixin"
+
random
+
"."
+
firstDomain
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment