1
This commit is contained in:
28
Yes.Blog/wwwroot/admin/js/user/add.js
Normal file
28
Yes.Blog/wwwroot/admin/js/user/add.js
Normal file
@@ -0,0 +1,28 @@
|
||||
document.addEventListener('alpine:init', function () {
|
||||
Alpine.data('data', function () {
|
||||
|
||||
return {
|
||||
user: {
|
||||
},
|
||||
isSubmitting: false,
|
||||
addUser() {
|
||||
if (this.isSubmitting) {
|
||||
return;
|
||||
}
|
||||
this.isSubmitting = true;
|
||||
axios.post('users', this.user)
|
||||
.then(data => {
|
||||
location.href = "/admin/user";
|
||||
})
|
||||
.finally(() => {
|
||||
this.isSubmitting = false;
|
||||
});
|
||||
},
|
||||
init() {
|
||||
window.addEventListener('load', () => {
|
||||
document.title = "添加管理员 - " + window.config.name + "";
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user