Commit 378603ea authored by 毛线's avatar 毛线

test

parent 47ae8e19
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
devtools: { enabled: true } devtools: { enabled: true },
nitro: {
devProxy: {
'/proxy': {
target: 'http://blf.localhost',
changeOrigin: true,
},
}
},
}) })
...@@ -4,5 +4,24 @@ ...@@ -4,5 +4,24 @@
<AppAlert> <AppAlert>
This is an auto-imported component This is an auto-imported component
</AppAlert> </AppAlert>
<div>{{ token }}</div>
</div> </div>
</template> </template>
\ No newline at end of file
<script setup>
let token = ''
console.log('created')
// const { data: count } = await useFetch('/api/count')
$fetch('/proxy/api.test/getToken', {
method: 'post',
body: {
phone: '18275342389',
},
}).then(({ data }) => {
// const { token } = data
token = data.token
console.log('token', token)
})
token = 123
</script>
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