zhangli 1 year ago
parent
commit
2499779059
  1. 12
      src/api/login/index.ts
  2. 4
      src/views/Login/components/LoginForm.vue

12
src/api/login/index.ts

@ -69,14 +69,4 @@ export const getCodeImg = () => {
url: 'system/captcha/captchaImage', headers: {
isToken: false
}})
}
// export function getCodeImg() {
// return request({
// url: '/captchaImage',
// headers: {
// isToken: false
// },
// method: 'get',
// timeout: 20000
// })
// }
}

4
src/views/Login/components/LoginForm.vue

@ -29,7 +29,7 @@
<el-form-item prop="code">
<div class="flex w-[100%]">
<el-input v-model="loginData.loginForm.code" placeholder="请输入验证码" style="width: 76%;margin-right: 10px;height: 42px;"
:prefix-icon="iconLock" @keyup.enter="getCode()" />
:prefix-icon="iconLock" @keyup.enter="handleLogin()" />
<div class="login-code flex-1">
<img :src="codeUrl" @click="getCode" class="login-code-img" />
</div>
@ -204,6 +204,7 @@ const handleLogin = async (params) => {
if (redirect.value.indexOf('sso') !== -1) {
window.location.href = window.location.href.replace('/login?redirect=', '')
} else {
console.log(redirect.value)
push({ path: redirect.value || permissionStore.addRouters[0].path })
}
} finally {
@ -229,6 +230,7 @@ const doSocialLogin = async (type: number) => {
location.origin + '/social-login?type=' + type + '&redirect=' + (redirect.value || '/')
//
const res = await LoginApi.socialAuthRedirect(type, encodeURIComponent(redirectUri))
console.log(33)
window.location.href = res
}
}

Loading…
Cancel
Save