サイドバーメニューからアカウントを作成できるように (#5910)
* メニューからアカウントを作成できるようにした * i18n * Update signup.vue Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
@ -84,6 +84,14 @@ export default Vue.extend({
|
||||
}
|
||||
},
|
||||
|
||||
props: {
|
||||
autoSet: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
meta() {
|
||||
return this.$store.state.instance.meta;
|
||||
@ -97,6 +105,15 @@ export default Vue.extend({
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
if (this.autoSet) {
|
||||
this.$once('signup', res => {
|
||||
localStorage.setItem('i', res.i);
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
const script = document.createElement('script');
|
||||
@ -166,8 +183,7 @@ export default Vue.extend({
|
||||
username: this.username,
|
||||
password: this.password
|
||||
}).then(res => {
|
||||
localStorage.setItem('i', res.i);
|
||||
location.href = '/';
|
||||
this.$emit('signup', res);
|
||||
});
|
||||
}).catch(() => {
|
||||
this.submitting = false;
|
||||
|
Reference in New Issue
Block a user