fix: 更新API和基础URL至h.hifastapp.com
All checks were successful
site-dist-deploy / build-and-deploy (push) Successful in 59s

修复登录表单的HTML结构和类型定义
将API目标服务器和基础URL从h.hifastvpn.com更新为h.hifastapp.com
优化登录表单的HTML结构,添加表单提交处理和自动完成属性
This commit is contained in:
shanshanzhong 2026-01-04 22:22:00 -08:00
parent 3fddc11b17
commit 1cae216052
3 changed files with 15 additions and 10 deletions

View File

@ -12,7 +12,7 @@ on:
env: env:
VITE_APP_BASE_URL: https://h.hifastvpn.com VITE_APP_BASE_URL: https://h.hifastapp.com
SSH_HOST: ${{ vars.PRO_SSH_HOST }} SSH_HOST: ${{ vars.PRO_SSH_HOST }}
SSH_PORT: ${{ vars.PRO_SSH_PORT }} SSH_PORT: ${{ vars.PRO_SSH_PORT }}
SSH_USER: ${{ vars.PRO_SSH_USER }} SSH_USER: ${{ vars.PRO_SSH_USER }}
@ -42,7 +42,7 @@ jobs:
- name: Build dist with Unified Script - name: Build dist with Unified Script
env: env:
VITE_APP_BASE_URL: "https://h.hifastvpn.com" VITE_APP_BASE_URL: "https://h.hifastapp.com"
run: | run: |
chmod +x scripts/ci-build.sh chmod +x scripts/ci-build.sh
./scripts/ci-build.sh ./scripts/ci-build.sh

View File

@ -1,10 +1,12 @@
<template> <template>
<div class="flex flex-col gap-6 text-base text-black md:text-2xl"> <form @submit.prevent="handleLogin" class="flex flex-col gap-6 text-base text-black md:text-2xl">
<div class="overflow-hidden rounded-[20px] bg-[#78788029] px-4"> <div class="overflow-hidden rounded-[20px] bg-[#78788029] px-4">
<div class="relative"> <div class="relative">
<Input <Input
v-model="email" v-model="email"
type="email" type="email"
name="email"
autocomplete="email"
placeholder="Email" placeholder="Email"
class="h-[50px] border-none bg-transparent text-base focus-visible:ring-0 md:text-2xl" class="h-[50px] border-none bg-transparent text-base focus-visible:ring-0 md:text-2xl"
/> />
@ -16,6 +18,8 @@
<Input <Input
v-model="code" v-model="code"
type="text" type="text"
name="code"
autocomplete="one-time-code"
placeholder="验证码" placeholder="验证码"
class="h-[50px] border-none bg-transparent text-base focus-visible:ring-0 md:text-2xl" class="h-[50px] border-none bg-transparent text-base focus-visible:ring-0 md:text-2xl"
/> />
@ -33,6 +37,7 @@
<div class="flex gap-4 pt-2"> <div class="flex gap-4 pt-2">
<Button <Button
type="button"
variant="secondary" variant="secondary"
@click="emit('close')" @click="emit('close')"
class="h-[48px] flex-1 cursor-pointer rounded-[25px] bg-[#D1D1D1] text-lg font-medium text-[#757575] hover:bg-[#C1C1C1]" class="h-[48px] flex-1 cursor-pointer rounded-[25px] bg-[#D1D1D1] text-lg font-medium text-[#757575] hover:bg-[#C1C1C1]"
@ -40,14 +45,14 @@
取消 取消
</Button> </Button>
<Button <Button
@click="handleLogin" type="submit"
class="h-[48px] flex-1 cursor-pointer rounded-[25px] bg-[#A8FF53] text-lg font-medium text-black hover:bg-[#96E64A]" class="h-[48px] flex-1 cursor-pointer rounded-[25px] bg-[#A8FF53] text-lg font-medium text-black hover:bg-[#96E64A]"
> >
登录/注册 登录/注册
</Button> </Button>
</div> </div>
<CodeSentTip ref="CodeSentTipRef" /> <CodeSentTip ref="CodeSentTipRef" />
</div> </form>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -59,7 +64,7 @@ import CodeSentTip from '@/pages/Home/components/CodeSentTip.vue'
import request from '@/utils/request' import request from '@/utils/request'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
const CodeSentTipRef = ref(null) const CodeSentTipRef = ref<InstanceType<typeof CodeSentTip> | null>(null)
const email = ref('') const email = ref('')
const code = ref('') const code = ref('')
const countdown = ref(0) const countdown = ref(0)
@ -70,10 +75,10 @@ const handleGetCode = () => {
toast('请输入邮箱') toast('请输入邮箱')
return return
} }
CodeSentTipRef.value.show() CodeSentTipRef.value?.show()
request request
.get('/api/v1/auth/check', { .get<{ exist: boolean }>('/api/v1/auth/check', {
email: email.value, email: email.value,
}) })
.then(({ exist }) => { .then(({ exist }) => {
@ -96,7 +101,7 @@ const handleGetCode = () => {
const router = useRouter() const router = useRouter()
const handleLogin = () => { const handleLogin = () => {
request request
.post('/api/v1/auth/login/email', { .post<any, { token: string }>('/api/v1/auth/login/email', {
email: email.value, email: email.value,
code: code.value, code: code.value,
}) })

View File

@ -19,7 +19,7 @@ export default defineConfig({
// 将所有以 /api 开头的请求转发到目标服务器 // 将所有以 /api 开头的请求转发到目标服务器
// 1. 匹配所有以 /public 开头的请求 // 1. 匹配所有以 /public 开头的请求
'/api/v1': { '/api/v1': {
target: 'https://h.hifastvpn.com', target: 'https://h.hifastapp.com',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(/^\/api/, ''),
autoRewrite: true, autoRewrite: true,