diff --git a/components.d.ts b/components.d.ts
index 0450e6c..814fd38 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -20,5 +20,6 @@ declare module 'vue' {
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
TAvatar: typeof import('tdesign-mobile-vue')['Avatar']
+ TButton: typeof import('tdesign-mobile-vue')['Button']
}
}
diff --git a/package-lock.json b/package-lock.json
index 6d0643b..d7a1b17 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,6 +12,7 @@
"pinia": "^3.0.3",
"sass-loader": "^16.0.6",
"scss": "^0.2.4",
+ "tdesign-icons-vue-next": "^0.4.1",
"tdesign-mobile-vue": "^1.11.0",
"vue": "^3.5.22",
"vue-router": "^4.6.3"
diff --git a/package.json b/package.json
index 2731d3f..c60c5cb 100644
--- a/package.json
+++ b/package.json
@@ -19,6 +19,7 @@
"pinia": "^3.0.3",
"sass-loader": "^16.0.6",
"scss": "^0.2.4",
+ "tdesign-icons-vue-next": "^0.4.1",
"tdesign-mobile-vue": "^1.11.0",
"vue": "^3.5.22",
"vue-router": "^4.6.3"
diff --git a/src/App.vue b/src/App.vue
index df0ea8f..98e8239 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -5,22 +5,24 @@
你好,{{ name }}
-
-
+
+
+ 登录
+
+
-
+
-
+
@@ -33,16 +35,49 @@ import { RouterView } from 'vue-router'
import { ref, watch } from 'vue'
import avatar from '@/assets/logo.svg'
-const login = ref(true)
-const weCome = ref(true)
-const hideLoading = ref(true)
-const showTitle = ref(true)
+const login = ref(false)
+const weCome = ref(false)
+const hideLoading = ref(false)
+const showTitle = ref(false)
+
+const passkey = ref(true)
const name = ref('Amico')
-// mock login
-setTimeout(() => {
- login.value = true
-}, 1000)
-const routerView = ref()
+
+if (!navigator.credentials) {
+ passkey.value = false
+}
+
+function handleLogin(){
+ navigator.credentials.create({
+ publicKey: {
+ challenge: new Uint8Array(32),
+ timeout: 60000,
+ rp: {
+ id: window.location.host,
+ name: "Animo"
+ },
+ user: {
+ id: new Uint8Array(32),
+ name: "Amico",
+ displayName: "Amico",
+ },
+ pubKeyCredParams: [{
+ alg: -7, type: "public-key"
+ },{
+ alg: -257, type: "public-key"
+ }],
+ excludeCredentials: [],
+ authenticatorSelection: {
+ authenticatorAttachment: "platform",
+ requireResidentKey: true,
+ }
+ },
+ }).then(resp => {
+ login.value = true
+ })
+}
+
+// 登录动画流程
watch(login, (val) => {
if (val) {
setTimeout(() => {