feat(login): 私有化部署时隐藏注册账号入口
通过 /api/private/deployment/status 判断部署模式,PRIVATE 模式下不渲染注册链接。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
父节点
bbbd382651
当前提交
7fe3cc767c
@ -25,7 +25,7 @@
|
||||
</el-form>
|
||||
|
||||
<div class="links">
|
||||
<router-link to="/register">注册账号</router-link>
|
||||
<router-link v-if="!isPrivate" to="/register">注册账号</router-link>
|
||||
<router-link to="/forgot-password">忘记密码</router-link>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -39,6 +39,7 @@ import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { authApi } from '@/api/auth'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import { getDeploymentStatus } from '@/api/system'
|
||||
|
||||
const router = useRouter()
|
||||
const auth = useAuthStore()
|
||||
@ -47,6 +48,7 @@ const formRef = ref<FormInstance>()
|
||||
const loading = ref(false)
|
||||
const captchaKey = ref('')
|
||||
const captchaImage = ref('')
|
||||
const isPrivate = ref(false)
|
||||
|
||||
const form = reactive({ account: '', password: '', captchaCode: '' })
|
||||
const rules: FormRules = {
|
||||
@ -81,7 +83,13 @@ async function handleLogin() {
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(loadCaptcha)
|
||||
onMounted(async () => {
|
||||
loadCaptcha()
|
||||
try {
|
||||
const status = await getDeploymentStatus()
|
||||
isPrivate.value = status.mode === 'PRIVATE'
|
||||
} catch {}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户