|
|
@ -33,7 +33,7 @@ |
|
|
|
:prefix-icon="iconLock" show-password type="password" @keyup.enter="getCode()" style="height: 42px;" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24" style="padding-right: 10px; padding-left: 10px"> |
|
|
|
<el-col :span="24" style="padding-right: 10px; padding-left: 10px" v-if="needCode!='false'"> |
|
|
|
<el-form-item prop="code"> |
|
|
|
<div class="flex w-[100%]"> |
|
|
|
<el-input v-model="loginData.loginForm.code" :placeholder="t('login.codePlaceholder')" |
|
|
@ -96,7 +96,8 @@ |
|
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
import * as DeptApi from '@/api/system/dept' |
|
|
|
import { getTenant } from '@/utils/systemParam' |
|
|
|
import { getSystermUpdateAlert,getSystermUpdateUrl } from '@/utils/systemParam' |
|
|
|
import { getSystermUpdateAlert,getSystermUpdateUrl,getNeedCode } from '@/utils/systemParam' |
|
|
|
const needCode = ref(getNeedCode()) |
|
|
|
|
|
|
|
defineOptions({ name: 'LoginForm' }) |
|
|
|
|
|
|
@ -173,6 +174,9 @@ |
|
|
|
// } |
|
|
|
// } |
|
|
|
function getCode() { |
|
|
|
if(needCode.value=='false'){ |
|
|
|
return |
|
|
|
} |
|
|
|
getCodeImg().then(res => { |
|
|
|
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled; |
|
|
|
if (captchaEnabled.value) { |
|
|
@ -229,7 +233,12 @@ |
|
|
|
if (!data) { |
|
|
|
return |
|
|
|
} |
|
|
|
const res = await LoginApi.login(loginData.loginForm) |
|
|
|
let res = null |
|
|
|
if(needCode.value=='false'){ |
|
|
|
res = await LoginApi.loginNoCode(loginData.loginForm) |
|
|
|
}else{ |
|
|
|
res = await LoginApi.login(loginData.loginForm) |
|
|
|
} |
|
|
|
if (!res) { |
|
|
|
console.log('登录-195') |
|
|
|
getCode() |
|
|
|