Browse Source

优化未授权时无法进行登录的问题

master
Gao xiaosong 5 years ago
parent
commit
cceddb9e87
  1. 24
      pages/authorization/index.vue
  2. 7
      pages/user/User/index.vue

24
pages/authorization/index.vue

@ -115,20 +115,18 @@ export default {
this.changeAuthorization(false);
},
mounted() {
// console.log(",11111");
// this.UPDATE_AUTHORIZATIONPAGE(true);
this.UPDATE_AUTHORIZATIONPAGE(true);
// //
// console.log("");
// authorize("userInfo")
// .then(res => {
// console.log(res);
// this.authorize = false;
// })
// .catch(error => {
// console.log(error);
// //
// this.authorize = true;
// });
console.log("先校验用户是否授权,如果没有授权,显示授权按钮");
authorize("userInfo")
.then(res => {
console.log(res);
})
.catch(error => {
console.log(error);
//
this.authorize = true;
});
}
};
</script>

7
pages/user/User/index.vue

@ -164,11 +164,11 @@
</view>
</template>
<script>
import { mapState, mapGetters, mapMutations, mapActions } from "vuex";
import { getUser, getMenuUser, bindingPhone } from "@/api/user";
import { isWeixin, VUE_APP_RESOURCES_URL } from "@/utils";
import SwitchWindow from "@/components/SwitchWindow";
import Authorization from "@/pages/authorization/index";
import { mapGetters } from "vuex";
const NAME = "User";
@ -188,6 +188,7 @@ export default {
},
computed: mapGetters(["userInfo"]),
methods: {
...mapMutations(["UPDATE_AUTHORIZATIONPAGE", "CHANGE_TABTAR"]),
goReturnList() {
this.$yrouter.push("/pages/order/ReturnList/index");
},
@ -349,6 +350,10 @@ export default {
this.MenuUser();
this.isWeixin = isWeixin();
}
},
onHide() {
console.log('离开用户中心')
this.UPDATE_AUTHORIZATIONPAGE(false);
}
};
</script>

Loading…
Cancel
Save