Merge branches 'master' and 'master' of https://gitee.com/lvYeJu/lane-crawford-3
This commit is contained in:
@@ -8,12 +8,15 @@ import { useOverallStore } from '@/stores'
|
|||||||
|
|
||||||
|
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
console.log(import.meta.env.VITE_APP_URL,123)
|
// console.log(import.meta.env,123)
|
||||||
|
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
// baseURL: import.meta.env.VITE_APP_URL, // api的base_url
|
|
||||||
// baseURL: import.meta.env.VITE_APP_URL, // api的base_url
|
// baseURL: import.meta.env.VITE_APP_URL, // api的base_url
|
||||||
timeout: 20000, // 请求超时时间
|
timeout: 20000, // 请求超时时间
|
||||||
})
|
})
|
||||||
|
if(import.meta.env.MODE != 'development'){
|
||||||
|
service.defaults.baseURL = import.meta.env.VITE_APP_URL
|
||||||
|
}
|
||||||
axios.defaults.headers.post["Content-Type"] = "application/json";
|
axios.defaults.headers.post["Content-Type"] = "application/json";
|
||||||
axios.defaults.headers.post['lang'] = 'en'; //配置语言请求头
|
axios.defaults.headers.post['lang'] = 'en'; //配置语言请求头
|
||||||
axios.defaults.withCredentials = true; //跨域携带cookie
|
axios.defaults.withCredentials = true; //跨域携带cookie
|
||||||
|
|||||||
@@ -104,11 +104,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img :src="customizeInfo.tryOnUrl" />
|
<img :src="customizeInfo.tryOnUrl" />
|
||||||
<!-- <div class="select-box">
|
<div class="select-box">
|
||||||
<div class="icon"><SvgIcon name="history" size="35" /></div>
|
<div class="icon"><SvgIcon name="history" size="35" /></div>
|
||||||
<div class="label">History</div>
|
<div class="label">History</div>
|
||||||
<div class="icon"><SvgIcon name="xialajiantou" size="29" /></div>
|
<div class="icon"><SvgIcon name="xialajiantou" size="29" /></div>
|
||||||
</div> -->
|
</div>
|
||||||
<div class="icons">
|
<div class="icons">
|
||||||
<div @click="onLove">
|
<div @click="onLove">
|
||||||
<SvgIcon :name="`love_${customizeInfo.isFavorite ? 1 : 0}`" size="35" />
|
<SvgIcon :name="`love_${customizeInfo.isFavorite ? 1 : 0}`" size="35" />
|
||||||
|
|||||||
114
vite.config.ts
114
vite.config.ts
@@ -1,6 +1,6 @@
|
|||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig, loadEnv } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from 'unplugin-vue-components/vite'
|
||||||
@@ -14,58 +14,62 @@ import { VantResolver } from '@vant/auto-import-resolver'
|
|||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig(({ mode }) => {
|
||||||
plugins: [
|
const env = loadEnv(mode, process.cwd())
|
||||||
vue(),
|
|
||||||
DefineOptions(),
|
return {
|
||||||
// ...
|
plugins: [
|
||||||
AutoImport({
|
vue(),
|
||||||
resolvers: [VantResolver()],
|
DefineOptions(),
|
||||||
}),
|
// ...
|
||||||
Components({
|
AutoImport({
|
||||||
resolvers: [VantResolver()],
|
resolvers: [VantResolver()],
|
||||||
}),
|
}),
|
||||||
createSvgIconsPlugin({
|
Components({
|
||||||
// 指定需要缓存的图标文件夹
|
resolvers: [VantResolver()],
|
||||||
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
|
}),
|
||||||
// 指定symbolId格式
|
createSvgIconsPlugin({
|
||||||
symbolId: 'icon-[dir]-[name]',
|
// 指定需要缓存的图标文件夹
|
||||||
inject: 'body-last' // 注入位置优化
|
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
|
||||||
})
|
// 指定symbolId格式
|
||||||
],
|
symbolId: 'icon-[dir]-[name]',
|
||||||
css: {
|
inject: 'body-last' // 注入位置优化
|
||||||
preprocessorOptions: {
|
})
|
||||||
less: {
|
],
|
||||||
modifyVars: {
|
css: {
|
||||||
'primary-color': '#ec6800'
|
preprocessorOptions: {
|
||||||
},
|
less: {
|
||||||
javascriptEnabled: true,
|
modifyVars: {
|
||||||
// 全局导入less变量文件
|
'primary-color': '#ec6800'
|
||||||
additionalData: `@import "${path.resolve(__dirname, 'src/assets/css/style.less')}";`
|
},
|
||||||
}
|
javascriptEnabled: true,
|
||||||
}
|
// 全局导入less变量文件
|
||||||
},
|
additionalData: `@import "${path.resolve(__dirname, 'src/assets/css/style.less')}";`
|
||||||
resolve: {
|
}
|
||||||
alias: {
|
}
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
},
|
||||||
_c: fileURLToPath(new URL('./src/components', import.meta.url))
|
resolve: {
|
||||||
}
|
alias: {
|
||||||
},
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||||
server: {
|
_c: fileURLToPath(new URL('./src/components', import.meta.url))
|
||||||
host: '0.0.0.0', // 允许局域网内的IP访问
|
}
|
||||||
port: 8060, // 根据环境设置端口
|
},
|
||||||
open: false, // 自动打开浏览器
|
server: {
|
||||||
strictPort: true, // 如果端口已被占用,则尝试下一个可用端口
|
host: '0.0.0.0', // 允许局域网内的IP访问
|
||||||
hmr: {
|
port: 8060, // 根据环境设置端口
|
||||||
overlay: true
|
open: false, // 自动打开浏览器
|
||||||
},
|
strictPort: true, // 如果端口已被占用,则尝试下一个可用端口
|
||||||
proxy: {
|
hmr: {
|
||||||
'/api': {
|
overlay: true
|
||||||
//'/api'是自行设置的请求前缀
|
},
|
||||||
target: 'http://18.167.251.121:10095',
|
proxy: {
|
||||||
changeOrigin: true, //用于控制请求头中的host值
|
'/api': {
|
||||||
rewrite: (path) => path.replace(/^\/api/, '/api') //路径重写,(正则)匹配以api开头的路径为空(将请求前缀删除)
|
//'/api'是自行设置的请求前缀
|
||||||
}
|
target: env.VITE_APP_URL,
|
||||||
}
|
changeOrigin: true, //用于控制请求头中的host值
|
||||||
}
|
rewrite: (path) => path.replace(/^\/api/, '/api') //路径重写,(正则)匹配以api开头的路径为空(将请求前缀删除)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user