add sesion belum fix
This commit is contained in:
19
server/api/auth/sidebarItem.ts
Normal file
19
server/api/auth/sidebarItem.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import axios from "axios";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const read_body = await readBody(event)
|
||||
console.log(`ini ${read_body}`)
|
||||
try {
|
||||
const response = await axios.get(`http://10.10.150.131:8080/api/login/${read_body.key}`)
|
||||
// console.log(response.data.data)
|
||||
|
||||
return response.data.data
|
||||
} catch (error) {
|
||||
console.log(`Messages Err: ${error.response.data.message} || nullable`)
|
||||
throw createError({
|
||||
statusCode: error.response?.status || 500,
|
||||
statusMessage: error.message || 'Internal Server Error',
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user