|
|
@@ -1,27 +1,28 @@
|
|
|
<script setup lang="ts">
|
|
|
import { onMounted, ref } from "vue";
|
|
|
-import useRotateCanvas from "./scripts/rotateCanvas";
|
|
|
-import usePreloadImg from "./scripts/preloadImg";
|
|
|
-import useModuleItem from "./scripts/moduleItem";
|
|
|
-
|
|
|
-// video 元素的模板引用
|
|
|
-const loginVideoRef = ref<HTMLVideoElement>();
|
|
|
-
|
|
|
-// 设置视频播放速度
|
|
|
-const setVideoRate = (rate = 1) => {
|
|
|
- if (loginVideoRef.value) loginVideoRef.value.playbackRate = rate;
|
|
|
-};
|
|
|
-
|
|
|
-onMounted(() => {
|
|
|
- // 设置视频播放速度
|
|
|
- // setVideoRate();
|
|
|
- // 预加载 模块item hover图片
|
|
|
- usePreloadImg();
|
|
|
-});
|
|
|
+import useRotateCanvas from "./scripts/useRotateCanvas";
|
|
|
+import usePreloadImg from "./scripts/usePreloadImg";
|
|
|
+import useModuleItem from "./scripts/useModuleItem";
|
|
|
+import { login } from "@/apis/controller/user";
|
|
|
|
|
|
+// 预加载 模块item hover图片
|
|
|
+onMounted(() => usePreloadImg());
|
|
|
// 底部旋转 canvas
|
|
|
const { canvasRef } = useRotateCanvas();
|
|
|
const { moduleRef } = useModuleItem();
|
|
|
+
|
|
|
+const username = ref("");
|
|
|
+const password = ref("");
|
|
|
+
|
|
|
+const handleSubmit = async () => {
|
|
|
+ console.log("你好");
|
|
|
+ try {
|
|
|
+ const userID = await login(username.value, password.value);
|
|
|
+ console.log("用户 ID", userID);
|
|
|
+ } catch (err: any) {
|
|
|
+ console.log("次哦判断是否", err.errno);
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -52,20 +53,30 @@ const { moduleRef } = useModuleItem();
|
|
|
<div class="panel">
|
|
|
<!-- 用户名 -->
|
|
|
<div class="input-wrap username">
|
|
|
- <input class="input" type="text" placeholder="用户名" />
|
|
|
+ <input
|
|
|
+ class="input"
|
|
|
+ type="text"
|
|
|
+ placeholder="用户名"
|
|
|
+ v-model="username"
|
|
|
+ />
|
|
|
<i class="line" />
|
|
|
</div>
|
|
|
<!-- 密码 -->
|
|
|
<div class="input-wrap password">
|
|
|
- <input class="input" type="password" placeholder="密码" />
|
|
|
+ <input
|
|
|
+ class="input"
|
|
|
+ type="password"
|
|
|
+ placeholder="密码"
|
|
|
+ v-model="password"
|
|
|
+ />
|
|
|
<i class="line" />
|
|
|
</div>
|
|
|
<!-- 登录按钮 -->
|
|
|
<div class="login-btn">
|
|
|
- <button class="button">登录</button>
|
|
|
- <div class="flash-wrap">
|
|
|
- <div class="flash"></div>
|
|
|
- </div>
|
|
|
+ <button class="button" @click="handleSubmit">登录</button>
|
|
|
+ <!-- <div class="flash-wrap">-->
|
|
|
+ <!-- <div class="flash"></div>-->
|
|
|
+ <!-- </div>-->
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 旋转光圈 -->
|