feat(website): Restrict unhealthy application selection during websit… (#8269)

This commit is contained in:
zhengkunwang 2025-03-28 16:55:39 +08:00 committed by GitHub
parent 79c8349747
commit 076f3f0e0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 4 deletions

View file

@ -39,7 +39,7 @@ func (b *BaseApi) Login(c *gin.Context) {
user, msgKey, err := authService.Login(c, req, string(entrance))
go saveLoginLogs(c, err)
if msgKey == "ErrAuth" {
if msgKey == "ErrAuth" || msgKey == "ErrEntrance" {
helper.BadAuth(c, msgKey, err)
return
}

View file

@ -185,6 +185,12 @@
"tw": "柬埔寨",
"en": "Cambodia"
},
{
"iso": "KN",
"zh": "圣基茨和尼维斯",
"tw": "聖基茨和尼維斯",
"en": "St Kitts and Nevis"
},
{
"iso": "CM",
"zh": "喀麦隆",

View file

@ -181,7 +181,7 @@ import { useRouter } from 'vue-router';
import type { ElForm } from 'element-plus';
import { loginApi, getCaptcha, mfaLoginApi, getLoginSetting } from '@/api/modules/auth';
import { GlobalStore, MenuStore, TabsStore } from '@/store';
import { MsgSuccess } from '@/utils/message';
import { MsgError, MsgSuccess } from '@/utils/message';
import { useI18n } from 'vue-i18n';
import { encryptPassword } from '@/utils/util';
import { getXpackSettingForTheme } from '@/utils/xpack';
@ -338,6 +338,7 @@ const login = (formEl: FormInstance | undefined) => {
tabsStore.removeAllTabs();
globalStore.currentNode = 'local';
MsgSuccess(i18n.t('commons.msg.loginSuccess'));
console.log('loiin syc');
router.push({ name: 'home' });
document.onkeydown = null;
} catch (res) {
@ -346,12 +347,15 @@ const login = (formEl: FormInstance | undefined) => {
loginForm.captcha = '';
errCaptcha.value = true;
errAuthInfo.value = false;
return;
}
if (res.message === 'ErrAuth') {
globalStore.ignoreCaptcha = false;
errCaptcha.value = false;
errAuthInfo.value = true;
return;
}
MsgError(res.message);
}
loginVerify();
} finally {

View file

@ -107,13 +107,19 @@
:label="$t('website.appInstalled')"
prop="appInstallId"
>
<el-select v-model="website.appInstallId" class="p-w-200">
<el-select v-model="website.appInstallId" class="p-w-300">
<el-option
v-for="(appInstall, index) in appInstalls"
:key="index"
:label="appInstall.name"
:value="appInstall.id"
></el-option>
:disabled="appInstall.status !== 'Running'"
>
<div class="flex justify-between items-center w-full">
<span>{{ appInstall.name }}</span>
<span><Status :key="appInstall.status" :status="appInstall.status"></Status></span>
</div>
</el-option>
</el-select>
</el-form-item>
<div v-if="website.appType == 'new'">