Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dexfilter-web-nuxt3
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
dexfilter-web-nuxt3
Commits
efd0c2c9
Commit
efd0c2c9
authored
Apr 15, 2023
by
haojie[
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预请求超时时间设置为3秒
parent
1ce3f9eb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
38 deletions
+15
-38
nuxt.config.ts
+1
-0
pages/detail.vue
+3
-2
public/Execute.js
+0
-28
views/token/CustomTokenList.vue
+11
-8
No files found.
nuxt.config.ts
View file @
efd0c2c9
...
...
@@ -55,6 +55,7 @@ export default defineNuxtConfig({
},
},
experimental
:
{
// 加载慢的问题
writeEarlyHints
:
false
,
},
vite
:
{
...
...
pages/detail.vue
View file @
efd0c2c9
<
template
>
<div
class=
""
>
1
</div>
<div
class=
""
></div>
</
template
>
<
script
lang=
"ts"
setup
></
script
>
<
script
lang=
"ts"
setup
>
</
script
>
<
style
lang=
"less"
></
style
>
public/Execute.js
deleted
100644 → 0
View file @
1ce3f9eb
(
function
()
{
var
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
if
(
!
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i
.
test
(
navigator
.
userAgent
)
)
{
return
;
}
else
if
(
ua
.
indexOf
(
'iphone'
)
>
0
||
ua
.
indexOf
(
'android'
)
>
0
)
{
try
{
let
url
=
window
.
location
.
href
;
let
curpath
=
url
.
indexOf
(
'//'
);
if
(
curpath
!==
-
1
&&
url
.
indexOf
(
'm.'
)
===
-
1
)
{
let
pathValue
=
curpath
+
1
;
if
(
url
.
indexOf
(
'https'
)
!==
-
1
)
{
url
=
url
.
replace
(
'https'
,
'http'
);
window
.
location
.
href
=
url
.
slice
(
0
,
pathValue
)
+
'm.'
+
url
.
slice
(
pathValue
);
}
else
{
window
.
location
.
href
=
url
.
slice
(
0
,
pathValue
+
1
)
+
'm.'
+
url
.
slice
(
pathValue
+
1
);
}
}
}
catch
(
e
)
{
window
.
location
.
href
=
'http://m.dexfilter.com'
;
}
}
})();
views/token/CustomTokenList.vue
View file @
efd0c2c9
...
...
@@ -178,12 +178,12 @@
</table>
</div>
<div
class=
"page-footer"
>
<
CustP
agination
<
cust-p
agination
:pageNum=
"pageNum"
:total=
"resultData.total"
:continues=
"8"
@
pageChange=
"onCurrentChange"
></
CustP
agination>
></
cust-p
agination>
</div>
</div>
</template>
...
...
@@ -493,17 +493,18 @@ const getBaseUrl = () => {
return
"/v1"
;
}
};
//创建AbortController对象
const
abortController
=
new
AbortController
();
let
controller
=
new
AbortController
();
let
signal
=
controller
.
signal
;
const
clear_fetch
=
setTimeout
(()
=>
{
controller
.
abort
();
console
.
log
(
"请求已断开"
);
},
3
);
// 预取数据
const
{
data
}:
any
=
await
useFetch
(()
=>
`/v1
${
chain
.
value
}
/indexV1`
,
{
params
:
getParams
(),
lazy
:
true
,
// method: "GET",
// mode: "cors",
// credentials: "include",
signal
:
signal
,
baseURL
:
getBaseUrl
(),
signal
:
abortController
.
signal
,
onRequest
(
context
:
any
)
{},
onResponse
({
request
,
response
,
options
})
{
try
{
...
...
@@ -524,6 +525,8 @@ const { data }: any = await useFetch(() => `/v1${chain.value}/indexV1`, {
console
.
log
(
error
,
"返回的error"
);
},
});
// 超时断开请求
clearTimeout
(
clear_fetch
);
// 获取默认数据
const
getDefaultList
=
()
=>
{
if
(
process
.
client
&&
data
.
value
)
{
...
...
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