refactor(client): Refine routing (#8846)

This commit is contained in:
syuilo 2022-06-20 17:38:49 +09:00 committed by GitHub
parent 30a39a296d
commit 699f24f3dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
149 changed files with 6312 additions and 6670 deletions

View file

@ -49,28 +49,12 @@ export default defineComponent({
MkSignin,
MkButton,
},
props: ['session', 'callback', 'name', 'icon', 'permission'],
data() {
return {
state: null
state: null,
};
},
computed: {
session(): string {
return this.$route.params.session;
},
callback(): string {
return this.$route.query.callback;
},
name(): string {
return this.$route.query.name;
},
icon(): string {
return this.$route.query.icon;
},
permission(): string[] {
return this.$route.query.permission ? this.$route.query.permission.split(',') : [];
},
},
methods: {
async accept() {
this.state = 'waiting';
@ -84,7 +68,7 @@ export default defineComponent({
this.state = 'accepted';
if (this.callback) {
location.href = appendQuery(this.callback, query({
session: this.session
session: this.session,
}));
}
},
@ -93,8 +77,8 @@ export default defineComponent({
},
onLogin(res) {
login(res.i);
}
}
},
},
});
</script>