mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
fix: remove unnecessary console log
This commit is contained in:
1 parent
72b2711367
commit
50bed23d37
8 files changed
+2
-14
No files matched your search
@@ -64,7 +64,6 @@ async function check() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleRegister() {
|
function handleRegister() {
|
||||||
console.log('register', username.value, email.value, password.value)
|
|
||||||
register(username.value, email.value, password.value)
|
register(username.value, email.value, password.value)
|
||||||
.then((isSuccess) => {
|
.then((isSuccess) => {
|
||||||
if (isSuccess) {
|
if (isSuccess) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function resizeScreen() {
|
|||||||
// 窗口大小改变时,触发xterm的resize方法使自适应
|
// 窗口大小改变时,触发xterm的resize方法使自适应
|
||||||
fitAddon.fit()
|
fitAddon.fit()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('e', e.message)
|
console.error('e', e.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.addEventListener('resize', resizeScreen)
|
window.addEventListener('resize', resizeScreen)
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ const router = createRouter({
|
|||||||
})
|
})
|
||||||
|
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
console.log(to, from)
|
|
||||||
const loggedIn = await isLoggedIn()
|
const loggedIn = await isLoggedIn()
|
||||||
// Check if the route requires authentication
|
// Check if the route requires authentication
|
||||||
if (to.meta.requiresAuth && !loggedIn) {
|
if (to.meta.requiresAuth && !loggedIn) {
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ export async function isLoggedIn() {
|
|||||||
|
|
||||||
export const login = async (username, password) => {
|
export const login = async (username, password) => {
|
||||||
try {
|
try {
|
||||||
const res = await api.post('/auth/login', { username, password })
|
await api.post('/auth/login', { username, password })
|
||||||
console.log(res.data)
|
|
||||||
return true
|
return true
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.response?.status === 401) {
|
if (err.response?.status === 401) {
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ class SessionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleHintUpdate(event) {
|
handleHintUpdate(event) {
|
||||||
console.log(event)
|
|
||||||
this.hints.value = [...this.hints.value, ...event]
|
this.hints.value = [...this.hints.value, ...event]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ export function pushToSession(sessionId, event, ...args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function connectClient(socket) {
|
async function connectClient(socket) {
|
||||||
console.log('Connected to the client.')
|
|
||||||
|
|
||||||
const user = socket.request.session?.passport?.user
|
const user = socket.request.session?.passport?.user
|
||||||
if (!user) {
|
if (!user) {
|
||||||
socket.send('User not found.')
|
socket.send('User not found.')
|
||||||
@@ -85,7 +83,6 @@ async function connectClient(socket) {
|
|||||||
listenToSession(session.id, socketCallback)
|
listenToSession(session.id, socketCallback)
|
||||||
|
|
||||||
socket.on('disconnect', () => {
|
socket.on('disconnect', () => {
|
||||||
console.log('Disconnected from the client.')
|
|
||||||
stream.socket.write('exit\n')
|
stream.socket.write('exit\n')
|
||||||
removeFromSession(session.id, socketCallback)
|
removeFromSession(session.id, socketCallback)
|
||||||
stream.destroy()
|
stream.destroy()
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import config from '../config.js'
|
|||||||
import User from '../models/user.js'
|
import User from '../models/user.js'
|
||||||
|
|
||||||
function verify(issuer, profile, cb) {
|
function verify(issuer, profile, cb) {
|
||||||
console.log('Get a google login:', profile)
|
|
||||||
|
|
||||||
process.nextTick(async () => {
|
process.nextTick(async () => {
|
||||||
const email = profile.emails[0]?.value
|
const email = profile.emails[0]?.value
|
||||||
if (!email) {
|
if (!email) {
|
||||||
@@ -20,7 +18,6 @@ function verify(issuer, profile, cb) {
|
|||||||
id: profile.id,
|
id: profile.id,
|
||||||
displayName: profile.displayName,
|
displayName: profile.displayName,
|
||||||
}
|
}
|
||||||
console.log('Existing user:', user)
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
user = new User({
|
user = new User({
|
||||||
email,
|
email,
|
||||||
|
|||||||
@@ -33,12 +33,10 @@ test('check valid email', () => {
|
|||||||
]
|
]
|
||||||
|
|
||||||
validEmails.forEach((email) => {
|
validEmails.forEach((email) => {
|
||||||
console.log(email)
|
|
||||||
expect(isValidEmail(email)).toBe(true)
|
expect(isValidEmail(email)).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
invalidEmails.forEach((email) => {
|
invalidEmails.forEach((email) => {
|
||||||
console.log(email)
|
|
||||||
expect(isValidEmail(email)).toBe(false)
|
expect(isValidEmail(email)).toBe(false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
Reference in new issue
Block a user