Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IPC-footer
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Allen Bai
IPC-footer
Commits
d9003905
Commit
d9003905
authored
Mar 10, 2021
by
Allen Bai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改接口
parent
eb24e074
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
index.ts
src/index.ts
+4
-10
No files found.
src/index.ts
View file @
d9003905
...
...
@@ -59,8 +59,7 @@ function getIPCByDomain(domain: string, env: string) {
url
:
`
${
getRequestUrl
(
env
)}
&domainUrl=
${
encodeURIComponent
(
domain
)}
`
,
method
:
'GET'
,
success
(
res
)
{
console
.
log
(
'当前域名的IPC备案为'
,
res
)
resolve
(
res
||
res
.
domainBeianInfo
)
resolve
(
JSON
.
parse
(
res
||
'{}'
))
},
error
(
err
)
{
reject
(
err
)
...
...
@@ -135,19 +134,14 @@ async function mountIPCFooter(opts: IPCFooterOptions = {}) {
let
IPCNumberString
=
''
try
{
IPCNumberString
=
(
await
getIPCByDomain
(
opts
.
domain
||
location
.
host
,
opts
.
env
||
getEnv
()))
as
string
let
res
=
await
getIPCByDomain
(
opts
.
domain
||
location
.
host
,
opts
.
env
||
getEnv
())
IPCNumberString
=
(
res
as
any
).
domainBeianInfo
as
string
}
catch
(
err
)
{
console
.
log
(
'备案号获取失败'
)
}
// 预发环境的接口取不到ipc备案信息
// 所以,预发的备案信息写死
if
((
opts
.
env
||
getEnv
())
==
'pre'
&&
!
IPCNumberString
)
{
IPCNumberString
=
'预发IPC备案号-写死'
}
let
hostName
=
window
.
location
.
hostname
if
(
hostName
===
'127.0.0.1'
||
hostName
===
'localhost'
)
{
if
(
(
hostName
===
'127.0.0.1'
||
hostName
===
'localhost'
)
&&
!
IPCNumberString
)
{
IPCNumberString
=
'本地开发IPC备案号-写死'
}
...
...
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