feat(auth): 移除本地登录/注册页,登录跳转统一指向 gerp.gvsds.com/#/login

This commit is contained in:
TermiNexus committed 2026-08-18 12:22:56 +08:00
1 parent 5af46f2310
commit 2981a1108e
9 files changed
+6 -337

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 KiB

+2 -2
View File
@@ -63,8 +63,8 @@ const MenuData1: MegaMenuData = {
{ name: '主页', tag: 'basic', description: '介绍工作室基本信息,作为工作室门面', link: '/' },
{ name: '关于我们', tag: 'basic', description: '我们的相关事迹等内容', link: '/about' },
{ name: '联系我们', tag: 'basic', description: '与我们取得联系以进行友情合作或商业合作', link: '/ContactUS' },
{ name: '登录', tag: 'basic', description: '登录您已有的账户以查看和使用您的服务', link: '/login' },
{ name: '注册', tag: 'basic', description: '在本平台上注册以尝试我们的服务', link: '/register' },
{ name: '登录', tag: 'basic', description: '登录您已有的账户以查看和使用您的服务', link: 'https://gerp.gvsds.com/#/login', target: '_blank' },
{ name: '注册', tag: 'basic', description: '在本平台上注册以尝试我们的服务', link: 'https://gerp.gvsds.com/#/login', target: '_blank' },
{ name: '画廊', tag: 'hot', description: '我们工作室的画作和 Hero 界面的图片', link: '/gallery' },
{ name: '廉政举报', tag: 'new', description: '廉政举报是民众参与权力监督的关键途径,我们拒绝任何形式的收受贿赂等等问题。', link: '/IntegrityReport' },
],
+1 -1
View File
@@ -87,7 +87,7 @@
<div id="UserFrame">
<a
v-if="!avatarUrl"
href="https://www.gvsds.com/login"
href="https://gerp.gvsds.com/#/login"
target="_blank"
class="bg-primary text-white px-8 h-16 -mr-6 flex items-center text-sm font-medium hover:bg-primary/90 transition-colors duration-200"
>登录</a>
-12
View File
@@ -42,18 +42,6 @@ export const routes: RouteRecordRaw[] = [
component: () => import('@/views/IntegrityReportView.vue'),
meta: { title: '廉政举报' },
},
{
path: 'login',
name: 'Login',
component: () => import('@/views/LoginView.vue'),
meta: { title: '登录' },
},
{
path: 'register',
name: 'Register',
component: () => import('@/views/RegisterView.vue'),
meta: { title: '注册' },
},
// === ProJect 子目录 ===
{
path: 'ProJect/SMANAGE',
+1 -1
View File
@@ -4,7 +4,7 @@
大屏(lg+)负 margin 抵消 SiteLayout main 的 pt-16,让 header 悬浮不占位,hero 顶到最顶 -->
<div
class="w-full h-[100vh] overflow-hidden flex relative z-[1] bg-cover bg-center bg-no-repeat lg:-mt-16"
style="min-height: 760px; background-image: url('https://hb.cdn.gvsds.com/assets/img/Heroes/FUBG_R.png');"
style="min-height: 760px; background-image: url('https://hb.cdn.gvsds.com/assets/img/Heroes/FUBG.png');"
>
<img src="https://hb.cdn.gvsds.com/assets/img/Heroes/copyright.png" alt="" class="absolute right-[20px] bottom-[10px] h-[22px] pointer-events-none hidden lg:block opacity-70" style="z-index: 2;">
<div class="flex-1 flex flex-col z-10 xl:px-[60px] 2xl:px-[174px] px-[16px] pl-[16px]">
-151
View File
@@ -1,151 +0,0 @@
<template>
<!-- 迁移自 TempLate/login.html(登录页):移除 iframe 的 window.parent.location.reload() 逻辑,表单提交成功改为跳转到 GERP -->
<div class="relative min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-100 p-4">
<div class="hidden md:flex md:w-1/2 items-center justify-start px-4 opacity-0 translate-x-[-20px] animate-fade-in-left">
<div class="text-center w-full">
<div class="w-56 h-56 mx-auto mb-8 rounded-2xl bg-blue-500/5 flex items-center justify-center p-6 transition-all duration-300 hover:scale-105 hover:shadow-lg hover:shadow-blue-500/5"></div>
<h2 class="text-3xl font-bold text-gray-900 mb-4 opacity-0 animate-fade-in delay-100">欢迎使用 G-ERP 系统</h2>
<p class="text-gray-600 mx-auto leading-relaxed opacity-0 animate-fade-in delay-200"> 高效、安全的企业级管理平台,为您的工作提供便捷支持<br> 请尽可能使用工号和密码登录,保障账户信息安全。 </p>
<div class="relative mt-12 h-64">
<div class="absolute top-0 left-1/4 w-8 h-8 rounded bg-blue-500/30 animate-pulse"></div>
<div class="absolute top-1/4 left-1/2 w-12 h-12 rounded bg-blue-500/30 animate-pulse delay-300"></div>
<div class="absolute bottom-1/4 left-1/3 w-10 h-10 rounded bg-green-500/30 animate-pulse delay-500"></div>
<div class="absolute bottom-0 left-2/3 w-14 h-14 rounded bg-orange-500/30 animate-pulse delay-700"></div>
</div>
</div>
</div>
<div class="w-full md:w-1/2 max-w-md opacity-0 translate-x-[20px] animate-fade-in-right">
<div class="bg-white dark:bg-gray-50 rounded-xl shadow-xl overflow-hidden transition-all duration-300 hover:shadow-blue-500/5">
<div class="relative h-24">
<img src="https://bing.img.run/uhd.php" alt="Card image" class="w-full h-full object-cover">
<div class="absolute inset-0 bg-gradient-to-t from-white to-transparent"></div>
<h4 class="absolute bottom-4 left-6 text-xl font-bold text-gray-900">登录</h4>
</div>
<!-- Toast 固定容器,永远放在表单上方 -->
<div id="toastWrap" class="px-6 pt-6">
<div
v-if="toastMsg"
id="LoginToast"
class="mb-4 p-3 rounded-lg animate-fade-in"
:style="{ color: toastType === 'error' ? '#dc2626' : '#16a34a', background: toastType === 'error' ? '#fef2f2' : '#f0fdf4', border: toastType === 'error' ? '1px solid #fecaca' : '1px solid #bbf7d0' }"
>
{{ toastMsg }}
</div>
</div>
<div class="p-6 pt-0">
<form class="space-y-4" id="loginForm" @submit.prevent="handleSubmit">
<div class="relative">
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none transition-colors duration-200">
<i class="tim-icons icon-single-02 text-gray-500 input-icon"></i>
</div>
<input type="text" name="UserName" v-model="userName"
class="block w-full pl-10 pr-3 py-2.5 bg-gray-50 border border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 placeholder-gray-500 transition-all duration-200 focus:scale-[1.01] focus:bg-white" placeholder="昵称">
</div>
<div class="relative">
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none transition-colors duration-200">
<i class="tim-icons icon-lock-circle text-gray-500 input-icon"></i>
</div>
<input type="password" name="UserPassword" v-model="userPassword"
class="block w-full pl-10 pr-3 py-2.5 bg-gray-50 border border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 placeholder-gray-500 transition-all duration-200 focus:scale-[1.01] focus:bg-white" placeholder="密码" required>
</div>
<div class="flex items-start">
<div class="flex items-center h-5">
<input id="UserConsent" name="UserConsent" type="checkbox" v-model="userConsent" class="w-4 h-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500 bg-gray-100 transition-all duration-200 hover:border-gray-400 checked:scale-[0.95]">
</div>
<div class="ml-3 text-sm">
<label for="UserConsent" class="text-gray-700 transition-colors duration-200 hover:text-gray-900">
我阅读并同意
<a href="https://doc.gvsds.com/d2ae1dd63e9c35d687464a160896e1ab" target="_blank"
class="text-blue-600 hover:underline transition-colors duration-200 hover:text-blue-700">GVSDS用户协议</a>
</label>
</div>
</div>
<div class="text-sm text-gray-700">
我还没有账号,去
<a href="/#/register" class="text-blue-600 hover:underline transition-colors duration-200 hover:text-blue-700">注册</a>
</div>
<div class="pt-2">
<button type="submit" :disabled="submitting"
class="w-full py-3 px-4 bg-blue-500 hover:bg-blue-600 rounded-lg text-white font-medium transition-all duration-200 flex items-center justify-center hover:scale-[1.02] active:scale-[0.98] hover:shadow-lg hover:shadow-blue-500/10 disabled:opacity-60 disabled:cursor-not-allowed">
<i v-if="submitting" class="fa fa-spinner fa-spin mr-2"></i>
{{ submitting ? '登录中...' : '登录' }}
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
/** 迁移自 TempLate/login.html(登录页)
* 原页面:iframe 环境下 window.parent.location.reload() 刷新父框架 —— 迁移时移除;
* 登录成功跳转改为 GERP:https://gerp.gvsds.com/ */
const userName = ref('')
const userPassword = ref('')
const userConsent = ref(false)
const submitting = ref(false)
const toastMsg = ref('')
const toastType = ref<'error' | 'success'>('error')
function showToast(content: string, type: 'error' | 'success' = 'error') {
toastMsg.value = content
toastType.value = type
}
async function handleSubmit() {
if (!userConsent.value) {
showToast('必须签署协议')
return
}
submitting.value = true
try {
// 登录接口(原站同款后端)
const formData = new FormData()
formData.append('UserName', userName.value)
formData.append('UserPassword', userPassword.value)
formData.append('UserConsent', userConsent.value ? 'true' : 'false')
const res = await fetch('https://ugm.gvsds.com/Auth/Login', {
method: 'POST',
credentials: 'include',
body: formData,
})
const result = await res.json()
submitting.value = false
if (result.code === 0) {
showToast('登录成功,即将跳转...', 'success')
setTimeout(() => {
window.location.href = 'https://gerp.gvsds.com/'
}, 500)
} else {
showToast(result.msg || '登录失败')
}
} catch (err) {
submitting.value = false
showToast('网络错误:' + (err as Error).message)
}
}
onMounted(() => {
// 页面 URL 参数消息
const msg = new URLSearchParams(window.location.search).get('msg')
if (msg) {
showToast(msg, 'error')
}
})
</script>
<style scoped>
/* 迁移自 login.html 的动画与图标样式 */
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
.animate-fade-in-left { animation: fadeInLeft 0.5s ease-out forwards; }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.animate-fade-in-right { animation: fadeInRight 0.5s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
input:focus ~ .input-icon { color: #2563eb; }
</style>
-168
View File
@@ -1,168 +0,0 @@
<template>
<!-- 迁移自 TempLate/register.html(注册页):移除 iframe 的 window.parent.location.reload() 逻辑,注册成功跳转到 GERP -->
<div class="relative min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-100 p-4">
<div class="hidden md:flex md:w-1/2 items-center justify-start px-4 opacity-0 translate-x-[-20px] animate-fade-in-left">
<div class="text-center w-full">
<div class="w-56 h-56 mx-auto mb-8 rounded-2xl bg-blue-500/5 flex items-center justify-center p-6 transition-all duration-300 hover:scale-105 hover:shadow-lg hover:shadow-blue-500/5"></div>
<h2 class="text-3xl font-bold text-gray-900 mb-4 opacity-0 animate-fade-in delay-100">G-ERP 账号注册</h2>
<p class="text-gray-600 mx-auto leading-relaxed opacity-0 animate-fade-in delay-200"> 填写以下信息完成注册,账号将用于在所有 GVSDS 下属平台访问<br> 请确保信息真实有效,注册后信息可在后台修改 </p>
<div class="relative mt-12 h-64">
<div class="absolute top-0 left-1/4 w-8 h-8 rounded bg-blue-500/30 animate-pulse"></div>
<div class="absolute top-1/4 left-1/2 w-12 h-12 rounded bg-blue-500/30 animate-pulse delay-300"></div>
<div class="absolute bottom-1/4 left-1/3 w-10 h-10 rounded bg-green-500/30 animate-pulse delay-500"></div>
<div class="absolute bottom-0 left-2/3 w-14 h-14 rounded bg-blue-500/30 animate-pulse delay-700"></div>
</div>
</div>
</div>
<div class="w-full md:w-1/2 max-w-md opacity-0 translate-x-[20px] animate-fade-in-right">
<div class="bg-white dark:bg-gray-50 rounded-xl shadow-xl overflow-visible transition-all duration-300 hover:shadow-blue-500/5">
<div class="relative h-24">
<img src="https://bing.img.run/uhd.php" alt="Card image" class="w-full h-full object-cover">
<div class="absolute inset-0 bg-gradient-to-t from-white to-transparent"></div>
<h4 class="absolute bottom-4 left-6 text-xl font-bold text-gray-900">注册</h4>
</div>
<!-- Toast 固定容器 -->
<div id="toastWrap" class="px-6 pt-6">
<div
v-if="toastMsg"
id="RegisterToast"
class="mb-4 p-3 rounded-lg animate-fade-in"
:style="{ color: toastType === 'error' ? '#dc2626' : '#16a34a', background: toastType === 'error' ? '#fef2f2' : '#f0fdf4', border: toastType === 'error' ? '1px solid #fecaca' : '1px solid #bbf7d0' }"
>
{{ toastMsg }}
</div>
</div>
<div class="p-6 pt-0">
<form class="space-y-4" id="registerForm" @submit.prevent="handleSubmit">
<div class="relative">
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none transition-colors duration-200">
<i class="tim-icons icon-single-02 text-gray-500 input-icon"></i>
</div>
<input type="text" name="UserName" v-model="userName"
class="block w-full pl-10 pr-3 py-2.5 bg-gray-50 border border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 placeholder-gray-500 transition-all duration-200 focus:scale-[1.01] focus:bg-white" placeholder="昵称" required>
</div>
<div class="relative">
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none transition-colors duration-200">
<i class="tim-icons icon-email-85 text-gray-500 input-icon"></i>
</div>
<input type="email" name="UserEmail" v-model="userEmail"
class="block w-full pl-10 pr-3 py-2.5 bg-gray-50 border border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 placeholder-gray-500 transition-all duration-200 focus:scale-[1.01] focus:bg-white" placeholder="邮箱(注意:请填写有效的邮箱)" required>
</div>
<div class="relative">
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none transition-colors duration-200">
<i class="tim-icons icon-lock-circle text-gray-500 input-icon"></i>
</div>
<input type="password" name="UserPassword" v-model="userPassword"
class="block w-full pl-10 pr-3 py-2.5 bg-gray-50 border border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 placeholder-gray-500 transition-all duration-200 focus:scale-[1.01] focus:bg-white" placeholder="密码" required>
</div>
<div class="relative">
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none transition-colors duration-200">
<i class="tim-icons icon-lock-circle text-gray-500 input-icon"></i>
</div>
<input type="password" name="UserPassword2" v-model="userPassword2"
class="block w-full pl-10 pr-3 py-2.5 bg-gray-50 border border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 placeholder-gray-500 transition-all duration-200 focus:scale-[1.01] focus:bg-white" placeholder="重复密码" required>
</div>
<div class="flex items-start">
<div class="flex items-center h-5">
<input id="UserConsent" name="UserConsent" type="checkbox" v-model="userConsent" class="w-4 h-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500 bg-gray-100 transition-all duration-200 hover:border-gray-400 checked:scale-[0.95]" required>
</div>
<div class="ml-3 text-sm">
<label for="UserConsent" class="text-gray-700 transition-colors duration-200 hover:text-gray-900"> 我阅读并同意
<a href="/Document/9bc298e9c1d03ed3bd4777181bf7411d/d2ae1dd63e9c35d687464a160896e1ab" target="_blank" class="text-blue-600 hover:underline transition-colors duration-200 hover:text-blue-700">GVSDS用户协议</a>
</label>
</div>
</div>
<div class="text-sm text-gray-700"> 我已有账号,去
<a href="/#/login" class="text-blue-600 hover:underline transition-colors duration-200 hover:text-blue-700">登录</a>
</div>
<div class="pt-2">
<button type="submit" :disabled="submitting"
class="w-full py-3 px-4 bg-blue-500 hover:bg-blue-600 rounded-lg text-white font-medium transition-all duration-200 flex items-center justify-center hover:scale-[1.02] active:scale-[0.98] hover:shadow-lg hover:shadow-blue-500/10 disabled:opacity-60 disabled:cursor-not-allowed">
<i v-if="submitting" class="fa fa-spinner fa-spin mr-2"></i>
{{ submitting ? '注册中...' : '注册' }}
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
/** 迁移自 TempLate/register.html(注册页)
* 原页面:iframe 环境下 window.parent.location.reload() 刷新父框架 —— 迁移时移除;
* 注册成功跳转改为 GERP:https://gerp.gvsds.com/ */
const userName = ref('')
const userEmail = ref('')
const userPassword = ref('')
const userPassword2 = ref('')
const userConsent = ref(false)
const submitting = ref(false)
const toastMsg = ref('')
const toastType = ref<'error' | 'success'>('error')
function showToast(content: string, type: 'error' | 'success' = 'error') {
toastMsg.value = content
toastType.value = type
}
async function handleSubmit() {
if (!userConsent.value) {
showToast('必须阅读并同意用户协议')
return
}
if (userPassword.value !== userPassword2.value) {
showToast('两次输入的密码不一致,请重新输入')
return
}
submitting.value = true
try {
const formData = new FormData()
formData.append('UserName', userName.value)
formData.append('UserEmail', userEmail.value)
formData.append('UserPassword', userPassword.value)
formData.append('UserPassword2', userPassword2.value)
formData.append('UserConsent', userConsent.value ? 'true' : 'false')
const res = await fetch('https://ugm.gvsds.com/Auth/Register', {
method: 'POST',
credentials: 'include',
body: formData,
})
const result = await res.json()
submitting.value = false
if (result.code === 0) {
showToast('注册成功,即将跳转...', 'success')
setTimeout(() => {
window.location.href = 'https://gerp.gvsds.com/'
}, 500)
} else {
showToast(result.msg || '注册失败')
}
} catch (err) {
submitting.value = false
showToast('网络错误:' + (err as Error).message)
}
}
onMounted(() => {
const msg = new URLSearchParams(window.location.search).get('msg')
if (msg) {
showToast(msg, 'error')
}
})
</script>
<style scoped>
/* 迁移自 register.html 的动画与图标样式 */
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
.animate-fade-in-left { animation: fadeInLeft 0.5s ease-out forwards; }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.animate-fade-in-right { animation: fadeInRight 0.5s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
input:focus ~ .input-icon { color: #2563eb; }
</style>
+1 -1
View File
@@ -82,7 +82,7 @@
<div class="px-6 py-4 border-t border-gray-100 flex items-center justify-between">
<span v-if="!isLoggedIn" class="text-xs text-gray-400">
发布需
<a href="https://www.gvsds.com/login" target="_blank" class="text-blue-600 hover:underline">登录</a>
<a href="https://gerp.gvsds.com/#/login" target="_blank" class="text-blue-600 hover:underline">登录</a>
</span>
<span v-else />
<button
+1 -1
View File
@@ -81,7 +81,7 @@
<div class="gvs-card p-6">
<div v-if="!isLoggedIn" class="text-center text-sm text-gray-500 py-4">
请先
<a href="https://www.gvsds.com/login" target="_blank" class="text-blue-600 hover:underline">登录</a>
<a href="https://gerp.gvsds.com/#/login" target="_blank" class="text-blue-600 hover:underline">登录</a>
后参与讨论
</div>
<template v-else>