to:sync
This commit is contained in:
parent
469fcceb4d
commit
b7bca018e3
@ -124,7 +124,7 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<p
|
<p
|
||||||
style="border-left: 8.8rem solid rgb(146, 146, 156); border-right:8.8rem solid rgb(146, 146, 156);margin:4rem 0px 0px; color: rgb(146, 146, 156); line-height: 1px;">
|
style="border-left: 8.8rem solid rgb(146, 146, 156); border-right:8.8rem solid rgb(146, 146, 156);margin:4rem 0 0; color: rgb(146, 146, 156); line-height: 1px;">
|
||||||
第三方快捷登录
|
第三方快捷登录
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -189,7 +189,7 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<section style="min-height: 800px; background-color: #f8f7fa;">
|
<section style="min-height: 800px; background-color: #f8f7fa;">
|
||||||
|
<iframe src="ai-chat1.html"></iframe>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<footer style="display: flex; justify-content:center; height: 80%; font-size: 1.5rem; background-color:black;">
|
<footer style="display: flex; justify-content:center; height: 80%; font-size: 1.5rem; background-color:black;">
|
||||||
@ -247,15 +247,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function myLogout() {
|
function myLogout() {
|
||||||
localStorage.removeItem("token")
|
localStorage.removeItem("token");
|
||||||
localStorage.removeItem("nickname")
|
localStorage.removeItem("nickname");
|
||||||
location.reload()
|
location.reload();
|
||||||
document.getElementById("myInfo").style.display = "none"
|
document.getElementById("myInfo").style.display = "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function toLogin() {
|
async function toLogin() {
|
||||||
console.log(123)
|
// console.log(123)
|
||||||
try {
|
try {
|
||||||
let response = await fetch('/v1/user/login', {
|
let response = await fetch('/v1/user/login', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -269,16 +269,15 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
let result = await response.json()
|
let result = await response.json()
|
||||||
console.log(result)
|
// console.log(result)
|
||||||
if (result.code === 0 && result.data !== undefined) {
|
if (result.code === 0 && result.data !== undefined) {
|
||||||
console.log('登录成功')
|
console.log('登录成功')
|
||||||
localStorage.setItem("token", result.data.token)
|
localStorage.setItem("token", result.data.token)
|
||||||
localStorage.setItem("nickname", result.data.nickname)
|
localStorage.setItem("nickname", result.data.nickname)
|
||||||
// alert(localStorage.getItem("token"))
|
// alert(localStorage.getItem("token"))
|
||||||
|
|
||||||
//设置昵称
|
//设置昵称
|
||||||
if (result.data.nickname.length > 8) {
|
if (result.data.nickname.length > 8) {
|
||||||
document.getElementById("goToLogin").innerText = result.data.nickname.slice(0, 7) + "..."
|
document.getElementById("goToLogin").innerText = result.data.nickname.slice(0, 5) + "..."
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("goToLogin").innerText = result.data.nickname
|
document.getElementById("goToLogin").innerText = result.data.nickname
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user