改为使用vue-cli打包,修改所有的请求方式,优化页面间的交互,增加数据源分组
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import userApi from '../../common/api/user'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -43,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();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var app;
|
||||
import userApi from '../../common/api/user'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -29,13 +29,12 @@
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
app = this;
|
||||
this.getUserInfo();
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
this.common.post(this.apilist1.getSelfUserInfo, this.searchParam, function (json) {
|
||||
app.userInfo = json.data;
|
||||
userApi.getSelfUserInfo().then(json => {
|
||||
this.userInfo = json.data;
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user