Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GraceTemplate
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
front-end
GraceTemplate
Commits
4e7e409c
Commit
4e7e409c
authored
Oct 23, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new 模板
parent
dc30c192
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
browser.ts
src/built-in/duiba-utils/browser.ts
+6
-7
vite.config.ts
vite.config.ts
+3
-0
No files found.
src/built-in/duiba-utils/browser.ts
View file @
4e7e409c
...
...
@@ -2,16 +2,15 @@
* Created by rockyl on 2019-12-10.
*/
export
le
t
queryParams
:
any
=
{};
export
cons
t
queryParams
:
any
=
{};
let
search
=
window
.
location
.
search
;
try
{
search
=
top
.
location
.
search
;
//尝试获取顶层的链接
}
catch
(
e
)
{
}
}
catch
(
e
)
{
/* empty */
}
for
(
le
t
item
of
search
.
replace
(
'?'
,
''
).
split
(
'&'
))
{
le
t
arr
=
item
.
split
(
'='
);
for
(
cons
t
item
of
search
.
replace
(
'?'
,
''
).
split
(
'&'
))
{
cons
t
arr
=
item
.
split
(
'='
);
queryParams
[
arr
[
0
]]
=
arr
.
length
===
1
?
true
:
decodeURIComponent
(
arr
[
1
]);
}
...
...
@@ -26,7 +25,7 @@ export function appendScript(script, parent = document.body) {
}
if
(
script
.
indexOf
(
'<script'
)
===
0
)
{
le
t
temp
=
document
.
createElement
(
'div'
);
cons
t
temp
=
document
.
createElement
(
'div'
);
temp
.
innerHTML
=
script
;
for
(
let
i
=
0
,
li
=
temp
.
children
.
length
;
i
<
li
;
i
++
)
{
...
...
@@ -46,7 +45,7 @@ export function appendScript(script, parent = document.body) {
}
function
_appendScript
(
scriptContent
,
parent
)
{
le
t
scriptEl
=
document
.
createElement
(
'script'
);
cons
t
scriptEl
=
document
.
createElement
(
'script'
);
scriptEl
.
innerHTML
=
scriptContent
;
parent
.
appendChild
(
scriptEl
);
}
...
...
vite.config.ts
View file @
4e7e409c
...
...
@@ -41,6 +41,9 @@ export default defineConfig(({ mode }): UserConfig => {
}
},
assetsInclude
:
[
/
\.(
svga
)
$/
],
build
:{
cssTarget
:
'chrome61'
,
},
plugins
:
[
react
({
babel
:
{
...
...
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