Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
standalone-anyremote
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
qlintonger xeno
standalone-anyremote
Commits
6706c728
Commit
6706c728
authored
Jul 04, 2024
by
qlintonger xeno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报错信息添加
parent
fd370773
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
1 deletions
+50
-1
src/App.vue
+1
-1
src/router/index.ts
+6
-0
src/views/login/index.vue
+6
-0
src/views/test/index.vue
+37
-0
No files found.
src/App.vue
View file @
6706c728
...
@@ -105,7 +105,7 @@ router.beforeEach(async (to, from, next) => {
...
@@ -105,7 +105,7 @@ router.beforeEach(async (to, from, next) => {
}
}
}
else
{
}
else
{
//未登录
//未登录
if
(
to
.
name
==
'Login'
)
{
if
(
to
.
name
==
'Login'
||
to
.
name
===
'test'
)
{
next
()
next
()
}
else
{
}
else
{
next
({
name
:
'Login'
})
next
({
name
:
'Login'
})
...
...
src/router/index.ts
View file @
6706c728
...
@@ -17,6 +17,12 @@ const routes: Array<RouteRecordRaw> = [
...
@@ -17,6 +17,12 @@ const routes: Array<RouteRecordRaw> = [
children
:
[]
children
:
[]
},
},
{
{
path
:
'/test'
,
name
:
'test'
,
meta
:
{
title
:
'测试眼镜URL'
},
component
:
()
=>
import
(
'@/views/test/index.vue'
)
},
{
path
:
'/404'
,
path
:
'/404'
,
name
:
'Error404'
,
name
:
'Error404'
,
component
:
()
=>
import
(
/* webpackChunkName: "Error404" */
'@/views/error/index.vue'
),
component
:
()
=>
import
(
/* webpackChunkName: "Error404" */
'@/views/error/index.vue'
),
...
...
src/views/login/index.vue
View file @
6706c728
...
@@ -9,6 +9,11 @@
...
@@ -9,6 +9,11 @@
</div>
</div>
<div
v-show=
"!showScanCode"
>
<div
v-show=
"!showScanCode"
>
<h3
class=
"font-bold text-xl"
>
{{
getLoginMethod
.
name
}}
</h3>
<h3
class=
"font-bold text-xl"
>
{{
getLoginMethod
.
name
}}
</h3>
<div
class=
"flex justify-between items-center"
>
<div>
测试API
</div>
<qrcode-vue
v-if=
"loginMethodType === 'scan'"
:value=
"urlCodeTest"
:size=
"101"
render-as=
"svg"
/>
</div>
<a-form
ref=
"loginFormRef"
:rules=
"rules"
:model=
"loginForm"
layout=
"vertical"
>
<a-form
ref=
"loginFormRef"
:rules=
"rules"
:model=
"loginForm"
layout=
"vertical"
>
<a-form-item
field=
"username"
label=
"用户名:"
validate-trigger=
"change"
hide-asterisk
>
<a-form-item
field=
"username"
label=
"用户名:"
validate-trigger=
"change"
hide-asterisk
>
<a-input
v-model=
"loginForm.username"
placeholder=
"请输入你的用户名"
size=
"large"
allow-clear
/>
<a-input
v-model=
"loginForm.username"
placeholder=
"请输入你的用户名"
size=
"large"
allow-clear
/>
...
@@ -80,6 +85,7 @@ const loginMethodType = ref<MethodType>('account')
...
@@ -80,6 +85,7 @@ const loginMethodType = ref<MethodType>('account')
const
getLoginMethod
=
computed
(()
=>
{
const
getLoginMethod
=
computed
(()
=>
{
return
loginMethod
[
loginMethodType
.
value
]
return
loginMethod
[
loginMethodType
.
value
]
})
})
const
urlCodeTest
=
`
${
location
.
origin
}
/#/test`
//切换登录模式
//切换登录模式
const
handleLoginMethod
=
()
=>
{
const
handleLoginMethod
=
()
=>
{
if
(
loginMethodType
.
value
==
'account'
)
{
if
(
loginMethodType
.
value
==
'account'
)
{
...
...
src/views/test/index.vue
0 → 100644
View file @
6706c728
<
template
>
<div
ref=
"sec"
>
正在测试调用眼镜端URL....
</div>
<div></div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
onMounted
}
from
'vue'
import
{
API_URL
}
from
'../../../project.app.config.ts'
const
sec
=
ref
()
const
demoURL
=
`
${
API_URL
}
/admin/getCaptcha`
onMounted
(
function
()
{
window
.
onerror
=
function
()
{
console
.
log
(
'errors!!!!'
,
arguments
)
}
fetch
(
demoURL
,
{
'headers'
:
{
'content-type'
:
'application/x-www-form-urlencoded'
},
'body'
:
'username=devzj3'
,
'method'
:
'POST'
,
}).
then
(
res
=>
res
.
blob
())
.
then
((
b
:
Blob
)
=>
{
const
url
=
window
.
URL
.
createObjectURL
(
b
)
const
img
=
document
.
createElement
(
'img'
)
img
.
src
=
url
sec
.
value
.
innerHTML
=
'api调用成功!'
sec
.
value
.
nextElementSibling
.
append
(
img
)
})
.
catch
((
reason
:
any
)
=>
{
console
.
log
(
'出现错误!'
,
reason
)
sec
.
value
.
innerHTML
=
'请求出错!'
sec
.
value
.
nextElementSibling
.
innerHTML
=
reason
})
})
</
script
>
\ No newline at end of file
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