Skip to content

Commit

Permalink
自动修改URL
Browse files Browse the repository at this point in the history
  • Loading branch information
dian-yu-luo committed Jun 8, 2023
1 parent a8fa99b commit ee3fc3e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 33 deletions.
18 changes: 2 additions & 16 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
<template>
<a-layout>
<a-layout-sider style="background-color: rgba(199,23,23,0.57);">
<sidebar-view></sidebar-view>
</a-layout-sider>
<a-layout>
<a-layout-header style="background-color: rgba(188,245,179,0.69);">
<header-view></header-view>
</a-layout-header>
<a-layout-content>
<router-view></router-view>
</a-layout-content>
<a-layout-footer style="background-color: azure">Footer</a-layout-footer>
</a-layout>
</a-layout>
<router-view></router-view>
</template>
<style>
</style>
<script setup>
import HeaderView from "@/views/HeaderView.vue";
import SidebarView from "@/views/SidebarView.vue";
</script>
26 changes: 13 additions & 13 deletions src/components/RepeatWord.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<br><br><br><br>
<a-input v-model:value="value" placeholder="Basic usage"/>
<br><br><br><br><br><br><br><br><br>
<a-button @click="logarea">ke</a-button>
<a-button @click="sendString">获得词组</a-button>
<a-button @click="func1">func1</a-button>
<a-button @click="func2">func2</a-button>
<a-button>xing</a-button>

<br><br>
Expand All @@ -23,24 +23,24 @@ export default {
}
},
methods: {
sendString() {
func1() {
service.get("/1").then(res => {
console.log(res.data)
this.value = "logaaa"
this.value=res.data
})
},
func2() {
service.post(
"deal", {
"deal", {
data1: this.value
}
).then(res => {
console.log(res.data)
this.value = res.data
}).catch(
this.value="button 1 can't be click"
)
},
logarea() {
service.get("/1").then(res => {
console.log(res.data)
this.value = "logaaa"
})
}
},
}
}
</script>
Expand Down
3 changes: 0 additions & 3 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ const routes = [
{
path: '/about',
name: 'about',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
}, {
path: "/repeatword",
Expand Down
7 changes: 6 additions & 1 deletion src/utils/service/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import axios from "axios";

let baseURL = "http://localhost:9000/";
if (process.env.NODE_ENV === "production") {
baseURL = ""
}

const service = axios.create(
{
baseURL: "http://localhost:9000/"
baseURL: baseURL
}
)
service.interceptors.response.use(
Expand Down

0 comments on commit ee3fc3e

Please sign in to comment.