改为使用vue-cli打包,修改所有的请求方式

This commit is contained in:
暮光:城中城
2020-05-29 22:38:25 +08:00
parent ba29b57a14
commit 13ddbc05ee
44 changed files with 7611 additions and 7970 deletions

View File

@@ -1,17 +1,16 @@
<template>
<div style="padding-top: 50px;" class="user-login-vue">
<div style="padding-top: 50px;">
<el-form :model="loginParam" :rules="loginRules" ref="loginParam" label-position="left" label-width="0px"
class="demo-ruleForm login-container">
<h3 class="title">系统登录</h3>
<el-form-item>
<el-form-item prop="username">
<el-input type="text" v-model="loginParam.username" auto-complete="off" placeholder="账号" @keyup.enter="loginSubmit"></el-input>
</el-form-item>
<el-form-item>
<el-form-item prop="password">
<el-input type="password" v-model="loginParam.password" auto-complete="off" placeholder="密码" @keyup.enter="loginSubmit"></el-input>
</el-form-item>
<el-form-item style="width:100%;">
<el-button type="primary" style="width:100%;" @click.native.prevent="loginSubmit" :loading="logining">登录
</el-button>
<el-button type="primary" style="width:100%;" @click.native.prevent="loginSubmit" :loading="logining">登录</el-button>
<!--<el-button @click.native.prevent="handleReset2">重置</el-button>-->
</el-form-item>
</el-form>
@@ -19,6 +18,7 @@
</template>
<script>
import userApi from '../../common/api/user'
export default {
data() {
return {
@@ -44,14 +44,13 @@
},
methods: {
loginSubmit() {
var that = this;
this.$refs.loginParam.validate((valid) => {
if (!valid) return;
that.common.post(that.apilist1.userLogin, that.loginParam, function (json) {
if(!!that.redirect) {
location.href = decodeURIComponent(that.redirect);
userApi.userLogin(this.loginParam).then(() => {
if (!!this.redirect) {
location.href = decodeURIComponent(this.redirect);
} else {
that.$router.back();
this.$router.back();
}
});
});
@@ -61,7 +60,7 @@
</script>
<style>
.user-login-vue .login-container {
.login-container {
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
@@ -73,12 +72,14 @@
border: 1px solid #eaeaea;
box-shadow: 0 0 25px #cac6c6;
}
.user-login-vue .title {
.title {
margin: 0px auto 40px auto;
text-align: center;
color: #505458;
}
.user-login-vue .remember {
.remember {
margin: 0px 0px 35px 0px;
}