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
181c3e52
Commit
181c3e52
authored
Mar 09, 2021
by
Allen Bai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 内置环境判断
parent
dbd2e16b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
index.ts
src/index.ts
+9
-2
No files found.
src/index.ts
View file @
181c3e52
...
@@ -115,6 +115,13 @@ const defaultBoardStyles: Optional<CSSStyleDeclaration> = {
...
@@ -115,6 +115,13 @@ const defaultBoardStyles: Optional<CSSStyleDeclaration> = {
let
currentTaskId
=
null
let
currentTaskId
=
null
function
getEnv
()
{
let
isTest
=
window
.
location
.
host
.
indexOf
(
'test.'
)
!=
-
1
let
isPre
=
window
.
location
.
host
.
indexOf
(
'pre.'
)
!=
-
1
let
env
=
isTest
?
'test'
:
isPre
?
'pre'
:
undefined
return
env
}
/**
/**
* 挂载
* 挂载
* @param {IPCFooterOptions} opts
* @param {IPCFooterOptions} opts
...
@@ -128,14 +135,14 @@ async function mountIPCFooter(opts: IPCFooterOptions = {}) {
...
@@ -128,14 +135,14 @@ async function mountIPCFooter(opts: IPCFooterOptions = {}) {
let
IPCNumberString
=
''
let
IPCNumberString
=
''
try
{
try
{
IPCNumberString
=
(
await
getIPCByDomain
(
opts
.
domain
||
location
.
host
,
opts
.
env
))
as
string
IPCNumberString
=
(
await
getIPCByDomain
(
opts
.
domain
||
location
.
host
,
opts
.
env
||
getEnv
()
))
as
string
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
'备案号获取失败'
)
console
.
log
(
'备案号获取失败'
)
}
}
// 预发环境的接口取不到ipc备案信息
// 预发环境的接口取不到ipc备案信息
// 所以,预发的备案信息写死
// 所以,预发的备案信息写死
if
(
opts
.
env
==
'pre'
)
{
if
(
(
opts
.
env
||
getEnv
())
==
'pre'
)
{
IPCNumberString
=
'预发IPC备案号-写死'
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