Skip to content

Commit

Permalink
兼容用户bucket为空的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
taoxm310 committed May 29, 2019
1 parent 3304d3b commit e56bdb0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/renderer/components/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ export default {
getBucket() {
this.submitState = true;
getBucketList(this.mac)
.then(it => {
.then(() => {
this.submitState = false;
if (it.data.length) {
this.$electron.ipcRenderer.send("bucketsList", {
accessKey: this.mac.accessKey,
secretKey: this.mac.secretKey
});
this.$store.dispatch("SetToken", this.mac);
this.$electron.ipcRenderer.send("switchToHome");
}
})
.catch(() => {
this.submitState = false;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/store/modules/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const app = {
dispatch("GetList", data);
dispatch("GetBucketDomain");
} else {
if (it.data.length) {
if (it.data && it.data.length) {
dispatch("GetList", it.data[0]);
dispatch("GetBucketDomain");
commit("SWITCH_BUCKET", it.data[0]);
Expand Down

0 comments on commit e56bdb0

Please sign in to comment.