This commit is contained in:
2025-05-12 23:57:05 +08:00
parent 10a344f6d6
commit 4fa451be97
57 changed files with 344 additions and 106 deletions

View File

@@ -5,15 +5,27 @@
name: "",
password: ""
},
validate() {
axios.post('validate')
.then(data => {
console.log('data:', data);
if (data.isValid) {
location.href = "/admin";
}
})
},
login() {
axios.post('login', this.user)
.then(data => {
console.log('data:', data);
localStorage.setItem("username", this.user.name);
localStorage.setItem("token", data.token);
location.href = "/admin";
})
},
init() {
this.validate();
window.addEventListener('load', () => {
document.title = "登录到 - " + window.config.name + "";
});