added feeds
This commit is contained in:
Generated
+7
-1
@@ -10,7 +10,8 @@
|
||||
"dependencies": {
|
||||
"axios": "^1.5.0",
|
||||
"vue": "^3.3.4",
|
||||
"vue-router": "^4.2.4"
|
||||
"vue-router": "^4.2.4",
|
||||
"vue-sessionstorage": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.3.2",
|
||||
@@ -2694,6 +2695,11 @@
|
||||
"vue": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-sessionstorage": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vue-sessionstorage/-/vue-sessionstorage-1.0.0.tgz",
|
||||
"integrity": "sha512-Axo8oY/3gcmU+OdsB/zePuoBCqmyjB2/ORUTrC/WVFm8OkMp8yYlzz6nOOzIU1Tgg6a4ogBaUa3loPtHROotbQ=="
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@
|
||||
"dependencies": {
|
||||
"axios": "^1.5.0",
|
||||
"vue": "^3.3.4",
|
||||
"vue-router": "^4.2.4"
|
||||
"vue-router": "^4.2.4",
|
||||
"vue-sessionstorage": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.3.2",
|
||||
|
||||
@@ -15,7 +15,7 @@ async function login() {
|
||||
const jsonData = JSON.stringify(loginData)
|
||||
console.log('test')
|
||||
try {
|
||||
const response = await axios.post('login', jsonData, {
|
||||
const response = await axios.post('login/rss', jsonData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json', // Set the content type to JSON
|
||||
'crossDomain': true,
|
||||
@@ -33,7 +33,11 @@ async function login() {
|
||||
|
||||
if (response.status == 200) {
|
||||
let token = response.headers.token
|
||||
localStorage.setItem("user-token", token);
|
||||
let user_id = response.headers.user_id
|
||||
localStorage.setItem("user-token", token)
|
||||
localStorage.setItem("user-id", user_id)
|
||||
sessionStorage.setItem("user-id", user_id)
|
||||
sessionStorage.setItem("user-token", token)
|
||||
router.push({ name: 'about' })
|
||||
}
|
||||
// Handle success
|
||||
|
||||
@@ -3,7 +3,6 @@ import './assets/main.css'
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(router)
|
||||
|
||||
+5
-5
@@ -16,17 +16,17 @@ export default defineConfig({
|
||||
|
||||
server: {
|
||||
proxy: {
|
||||
'/login': {
|
||||
target: 'http://localhost:8001/api/v1/auth',
|
||||
'/login/rss': {
|
||||
target: 'http://localhost:8001/api/v1/auth/login',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
// rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
rewrite: (path) => path.replace(/^\/login\/rss/, ''),
|
||||
},
|
||||
'/feeds': {
|
||||
'/feeds/get': {
|
||||
target: 'http://localhost:8001/api/v1/article/get',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
rewrite: (path) => path.replace(/^\/feeds/, ''),
|
||||
rewrite: (path) => path.replace(/^\/feeds\/get/, ''),
|
||||
},
|
||||
},
|
||||
cors: false
|
||||
|
||||
Reference in New Issue
Block a user