Browse Source

是否需要验证码

hella_online_20240819
wangyufei 3 months ago
parent
commit
965b13eb61
  1. 8
      src/views/login/components/LoginForm.vue

8
src/views/login/components/LoginForm.vue

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

Loading…
Cancel
Save