|
@ -34,6 +34,11 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="24" style="padding-right: 10px; padding-left: 10px" v-if="needCode"> |
|
|
<el-col :span="24" style="padding-right: 10px; padding-left: 10px" v-if="needCode"> |
|
|
|
|
|
<el-form-item prop="code"> |
|
|
|
|
|
<Verify ref="VerifySlide" captchaType="blockPuzzle" mode="" :imgSize="{ width: '450px', height: '225px' }" @success="capctchaCheckSuccess" @error="capctchaCheckError"></Verify> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<!-- <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')" |
|
@ -47,7 +52,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> --> |
|
|
<el-col :span="24" style="padding-right: 10px; padding-left: 10px; margin-top: -20px; margin-bottom: -20px"> |
|
|
<el-col :span="24" style="padding-right: 10px; padding-left: 10px; margin-top: -20px; margin-bottom: -20px"> |
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
<el-row justify="space-between" style="width: 100%"> |
|
|
<el-row justify="space-between" style="width: 100%"> |
|
@ -70,13 +75,6 @@ |
|
|
@click="handleLogin()" /> |
|
|
@click="handleLogin()" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<!-- <Verify |
|
|
|
|
|
ref="verify" |
|
|
|
|
|
:captchaType="captchaType" |
|
|
|
|
|
:imgSize="{ width: '400px', height: '200px' }" |
|
|
|
|
|
mode="pop" |
|
|
|
|
|
@success="handleLogin" |
|
|
|
|
|
/> --> |
|
|
|
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</template> |
|
|
</template> |
|
@ -84,6 +82,7 @@ |
|
|
import { ElLoading } from 'element-plus' |
|
|
import { ElLoading } from 'element-plus' |
|
|
import LoginFormTitle from './LoginFormTitle.vue' |
|
|
import LoginFormTitle from './LoginFormTitle.vue' |
|
|
import type { RouteLocationNormalizedLoaded } from 'vue-router' |
|
|
import type { RouteLocationNormalizedLoaded } from 'vue-router' |
|
|
|
|
|
import { Verify } from '@/components/Verifition' |
|
|
|
|
|
|
|
|
import { useIcon } from '@/hooks/web/useIcon' |
|
|
import { useIcon } from '@/hooks/web/useIcon' |
|
|
|
|
|
|
|
@ -113,8 +112,7 @@ |
|
|
const permissionStore = usePermissionStore() |
|
|
const permissionStore = usePermissionStore() |
|
|
const redirect = ref<string>('') |
|
|
const redirect = ref<string>('') |
|
|
const loginLoading = ref(false) |
|
|
const loginLoading = ref(false) |
|
|
const verify = ref() |
|
|
const VerifySlide = ref() |
|
|
const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN) |
|
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN) |
|
@ -185,13 +183,14 @@ |
|
|
if(!needCode.value){ |
|
|
if(!needCode.value){ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
getCodeImg().then(res => { |
|
|
VerifySlide.value.refresh() |
|
|
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled; |
|
|
// getCodeImg().then(res => { |
|
|
if (captchaEnabled.value) { |
|
|
// captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled; |
|
|
codeUrl.value = "data:image/gif;base64," + res.img; |
|
|
// if (captchaEnabled.value) { |
|
|
loginData.loginForm.uuid = res.uuid; |
|
|
// codeUrl.value = "data:image/gif;base64," + res.img; |
|
|
} |
|
|
// loginData.loginForm.uuid = res.uuid; |
|
|
}); |
|
|
// } |
|
|
|
|
|
// }); |
|
|
} |
|
|
} |
|
|
//获取租户ID |
|
|
//获取租户ID |
|
|
const getTenantId = async () => { |
|
|
const getTenantId = async () => { |
|
@ -220,9 +219,20 @@ |
|
|
}) |
|
|
}) |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 滑块校验成功 |
|
|
|
|
|
const capctchaCheckSuccess = ({captchaVerification})=>{ |
|
|
|
|
|
console.log('capctchaCheckSuccess',captchaVerification) |
|
|
|
|
|
loginData.loginForm.code = captchaVerification |
|
|
|
|
|
handleLogin() |
|
|
|
|
|
} |
|
|
|
|
|
// 滑块校验失败 |
|
|
|
|
|
const capctchaCheckError = ()=>{ |
|
|
|
|
|
VerifySlide.value.refresh() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const loading = ref() // ElLoading.service 返回的实例 |
|
|
const loading = ref() // ElLoading.service 返回的实例 |
|
|
// 登录 |
|
|
// 登录 |
|
|
const handleLogin = async (params) => { |
|
|
const handleLogin = async () => { |
|
|
console.log('登录-185') |
|
|
console.log('登录-185') |
|
|
if(getSystermUpdateAlert()=='true'||getSystermUpdateAlert()===true){ |
|
|
if(getSystermUpdateAlert()=='true'||getSystermUpdateAlert()===true){ |
|
|
await ElMessageBox.alert( |
|
|
await ElMessageBox.alert( |
|
|