tianyuwu / nuxt3-vant4-wx-starter

Nuxt3+vant4+微信公众号授权登录的h5开发模板
16 stars 6 forks source link

nuxt.config.ts改完api端口不生效 #1

Open yxlwfds opened 1 year ago

yxlwfds commented 1 year ago

nuxt.config.ts: // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ app: { head: { htmlAttrs: { lang: 'zh-CN', }, link: [], script: [], } }, // 自定义配置项 runtimeConfig: { // 只在服务端可以访问的配置项 apiSecret: 'api-secret', // 可以暴露给客户端使用的配置项 public: {} }, modules: [ '@unocss/nuxt', '@vant/nuxt', '@vueuse/nuxt' ], css: [ '@unocss/reset/tailwind.css', ], postcss: { plugins: { autoprefixer: { remove: false }, 'postcss-100vh-fix': {}, 'postcss-pxtorem': { rootValue({ file }: any) { return file.indexOf('vant') !== -1 ? 37.5 : 100 }, propList: ['*'], exclude: /(node_module)/, selectorBlackList: ['html', '.rem-ignore'] } } }, nitro: { devProxy: { '/api': { target: 'http://127.0.0.1:8000', // 这里是接口地址 changeOrigin: true, // prependPath: true, }, }, routeRules: { '/api/**': { proxy: 'http://127.0.0.1:8000/**', }, }, }, sourcemap: { server: true, client: false, } }) login.vue ` ` 访问的时候访问的是localhost:3000/xxxxxxx

tianyuwu commented 1 year ago

你的邮件我已收到,谢谢