登出登入bug修复

This commit is contained in:
2025-06-26 20:33:42 +08:00
parent cd7f61d141
commit a10173d98a
8 changed files with 248 additions and 169 deletions
+8 -7
View File
@@ -71,12 +71,12 @@
<div id="pass_err" class="invalid-feedback">不能为空</div>
</div>
</div>
<div class="mb-2">
<!-- <div class="mb-2">
<label class="form-check">
<input id="keep_login" type="checkbox" class="form-check-input" />
<span class="form-check-label">保持登录</span>
</label>
</div>
</div> -->
<div class="form-footer">
<button onclick="sign_in()" class="btn btn-primary w-100">登录</button>
</div>
@@ -160,20 +160,21 @@
post_json("/user/login", {
username: username_dom.value,
password: password_dom.value,
is_keep_login: keep_login_dom.checked
is_keep_login: true
}, (c) => {
if (c.statusCode == 200) {
if (c.data.err_code == 0) {
save_json("cookie", c.data.return.cookie)
//save_json("cookie", c.data.return.cookie)
banner_alert('success', "登录成功",9500)
save_json("user_info", c.data.return.user_info)
setTimeout(() => {
location.href = '/'
}, 500);
}, 1000);
} else {
//this.$refs.footer.alert('warning', "账号或密码不正确")
banner_alert('warning', "账号或密码不正确",3000)
}
} else {
//this.$refs.footer.alert('danger', "网络连接错误:" + c.statusCode)
banner_alert('danger', "网络连接错误:" + c.statusCode,3000)
}
})