Commit b47211f7 authored by Khalid Ali's avatar Khalid Ali
Browse files

Add GET request with proper login requests

parent be7b204c
Pipeline #4000 failed with stages
in 3 minutes and 4 seconds
......@@ -2,6 +2,7 @@
node_modules
/dist
cockroach-data/*
*.pem
/tests/e2e/reports/
selenium-debug.log
......
This diff is collapsed.
......@@ -2,7 +2,10 @@ import axios from 'axios';
const https = require('https');
export default axios.create({
baseURL: `https://localhost:9090/bs/api/`,
baseURL: `/api/`,
// baseURL: `https://localhost:9090/bs/api`,
headers: {
// 'Access-Control-Allow-Origin': '*'
},
maxRedirects: 10,
});
\ No newline at end of file
<template>
<b-container class="b-form-container">
<div v-html="casLogin">
<p>Hello</p>
</div>
<h1 class="text-center"><strong>SRCT</strong> BOOKSHARE</h1>
<h3 class="text-center">Add Textbook</h3>
<b-form @submit="onSubmit" @reset="onReset" v-if="show">
......@@ -137,6 +140,7 @@ export default class CreateListing extends Vue {
isbn: '', course: '', condition: 0, photo: [], accessCode: 2, price: 0, description: '',
};
private show: boolean = true;
private casLogin: any = ``;
// List of options
private condition: {value: number, text: string}[] = [
......@@ -149,15 +153,39 @@ export default class CreateListing extends Vue {
{value: 0, text: 'Access Code NOT Included'},
];
// private login() {
// API.get('login').then(function (response) {
// console.log(response);
// });
// }
private onSubmit(evt: Event) {
evt.preventDefault();
API.post('listing', {
data: this.form,
}).catch(function (response) {
//handle error
console.log(response);
});
console.log(fetch('https://localhost:8888/api/bs/api/listing', {
mode: "no-cors",
method: 'get',
}));
// API.get('bs/api/listing', {
// // data: this.form,
// })
// .then(function (this: CreateListing, response) {
// console.log(response.status);
// console.log(response.data);
// if (response.status == 200) {
// this.casLogin = response.data;
// }
// })
// .catch(function (this: CreateListing, error) {
// //handle error
// console.log(error.response);
// // console.log("hello");
// // if (error.response.status == 403) {
// // location.replace('https://localhost:8888/bs/api/listing');
// // this.login();
// // }
// });
}
private onReset(evt: Event) {
......
module.exports = {
devServer: {
https: true,
port: 8081,
proxy: {
'/bs/api/': {
target: 'http://localhost:9090',
changeOrigin: true
}
}
// proxy: {
// '/bs/api/': {
// target: 'https://localhost:9090',
// ws: true,
// changeOrigin: true
// }
// }
},
configureWebpack: {
module: {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment