前端跳转

This commit is contained in:
zhangzhiqiang
2022-12-05 14:55:21 +08:00
parent 8205ea111b
commit b7d76da855
4 changed files with 10 additions and 4 deletions

View File

@@ -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拦截器

View File

@@ -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()