Skip to content

Commit

Permalink
feat: ✨️代理转发,联调接口
Browse files Browse the repository at this point in the history
  • Loading branch information
ZRMYDYCG committed Mar 5, 2025
1 parent 59c94a2 commit e25de60
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to Remote Server
on:
push:
branches:
- master # 触发条件,可以根据需要修改
- master

jobs:
deploy:
Expand All @@ -19,6 +19,7 @@ jobs:
script: |
set -e # 如果任何命令失败,立即退出
cd ~/lightChat/web # 进入项目目录
git clone git@github.com:ZRMYDYCG/llm-go-chat-client.git # 克隆项目到服务器
git pull # 拉取最新代码
sudo docker compose down --rmi all # 停止并删除所有容器
sudo docker compose up -d # 构建并启动容器
2 changes: 1 addition & 1 deletion src/settings/config/http.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 请求地址
export const HTTP_HOST = 'http://localhost:3000'
export const HTTP_HOST = 'http://localhost:3030'

// 请求超时时长
export const HTTP_TIMEOUT = 5000
Expand Down
8 changes: 4 additions & 4 deletions src/view/register/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="regist">
<el-form
ref="registFormRef"
ref="registerFormRef"
:model="formMdl"
:rules="rules"
label-position="left"
Expand Down Expand Up @@ -69,7 +69,7 @@ const rules = {
const router = useRouter()
const userStore = useUserStore()
const registFormRef = ref<InstanceType<typeof ElForm>>()
const registerFormRef = ref<InstanceType<typeof ElForm>>()
const loading = ref(false)
const formMdl = reactive<any>({
account: '',
Expand All @@ -79,14 +79,14 @@ const formMdl = reactive<any>({
const handleRegister = async () => {
if (loading.value) return
const valid = await registFormRef.value?.validate().catch(() => false)
const valid = await registerFormRef.value?.validate().catch(() => false)
if (!valid) return
loading.value = true
try {
await userStore.accountRegister(formMdl)
ElMessage.success({ message: '注册成功', duration: 3000 })
router.push('/login')
await router.push('/login')
} catch (error: any) {
ElMessage.error({ message: error?.message || '注册失败', duration: 3000 })
} finally {
Expand Down
8 changes: 8 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import { defineConfig } from 'vite'

// https://vite.dev/config/
export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost:3000/',
changeOrigin: true,
},
},
},
plugins: [
vue(),
tailwindcss(),
Expand Down

0 comments on commit e25de60

Please sign in to comment.