| | |
| | | |
| | | const app = createApp(App) |
| | | |
| | | app.provide('request', request) |
| | | |
| | | app.use(ElementPlus, { |
| | | locale: zhCn |
| | |
| | | |
| | | service.interceptors.request.use( |
| | | (config) => { |
| | | debugger |
| | | const token = "app-6MPX5Fr97eK6BWHpy8g7vddd" |
| | | if (token) config.headers['Authorization'] = `Bearer ${token}` |
| | | return config |
| | |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { ref } from 'vue' |
| | | import { ref, inject } from 'vue' |
| | | const request = inject('request') |
| | | const inputValue = ref('') |
| | | |
| | | const sendMsg = () => { |
| | | |
| | | console.log(inputValue.value); |
| | | request({ |
| | | url: '/chat-messages', |
| | | method: 'post', |
| | | data: { |
| | | query: inputValue.value, |
| | | inputs: {}, |
| | | response_mode: "blocking", |
| | | user: "test", |
| | | files: [] |
| | | } |
| | | }).then(res => { |
| | | console.log(res, "res"); |
| | | }) |
| | | } |
| | | // import { ref } from 'vue' |
| | | // import { useRouter } from 'vue-router' |