feat(i18n): 添加国际化配置和国家地址配置

- 新增 src/utils/countryConfig.js 文件,包含各国地址字段规则和邮编格式配置
- 新增 src/i18n/index.js 文件,实现基于货币代码的国际化翻译功能
- 新增 src/i18n/locales.js 文件,提供中英马泰菲多语言静态翻译文本
- 实现货币代码到国家代码映射及地址验证功能
- 添加订单创建页、商品详情页、订单确认页等多页面国际化支持
- 支持新加坡、马来西亚、菲律宾、泰国、越南等国家地址格式配置
This commit is contained in:
2025-12-24 17:39:06 +08:00
parent d914301ee3
commit 1c461ab5c3
7 changed files with 1525 additions and 0 deletions

34
vite.config.js Normal file
View File

@@ -0,0 +1,34 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { fileURLToPath } from 'url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
server: {
port: 3000,
proxy: {
'/api': {
target: 'http://127.0.0.1:8082', // 使用 127.0.0.1 而不是 localhost避免 IPv6 问题
changeOrigin: true,
secure: false,
ws: true,
timeout: 30000,
configure: (proxy, options) => {
proxy.on('error', (err, req, res) => {
console.error('代理错误:', err.message)
console.error('请确保后端服务已启动在 http://127.0.0.1:8082')
})
}
}
}
}
})