前端跳转
This commit is contained in:
@@ -11,7 +11,8 @@ const baseURLStr = window.g.prod.VUE_APP_BASE_API
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
baseURL: process.env.NODE_ENV === 'production' ? baseURLStr : '/', // api 的 base_url
|
||||
timeout: Config.timeout // 请求超时时间
|
||||
timeout: Config.timeout, // 请求超时时间
|
||||
withCredentials: true
|
||||
})
|
||||
|
||||
// request拦截器
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="login" :style="'background-image:url('+ Background +');'">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
|
||||
<h3 class="title">
|
||||
{{title}}</h3>
|
||||
{{ title }}</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||
@@ -133,8 +133,13 @@ export default {
|
||||
Cookies.remove('rememberMe')
|
||||
}
|
||||
this.$store.dispatch('Login', user).then(() => {
|
||||
debugger
|
||||
this.loading = false
|
||||
this.$router.push({ path: this.redirect || '/' })
|
||||
window.location.href = this.redirect
|
||||
// if (this.redirect === 'http://localhost:8013/dashboard'){
|
||||
// window.location.href = this.redirect
|
||||
// }
|
||||
// this.$router.push({ path: this.redirect || '/' })
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
this.getCode()
|
||||
|
||||
Reference in New Issue
Block a user