改为使用vue-cli打包,修改所有的请求方式,优化页面间的交互,增加数据源分组

This commit is contained in:
暮光:城中城
2020-05-23 12:21:23 +08:00
parent adadffa0cd
commit 88686f84f4
63 changed files with 8421 additions and 8773 deletions

View File

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

View File

@@ -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;
});
},
}