build 调试构建命令脚本

This commit is contained in:
DaxPay
2024-07-03 20:53:17 +08:00
parent 8bf095db12
commit 86abf23d48
20 changed files with 29 additions and 626 deletions

2
.env
View File

@@ -1,2 +0,0 @@
# spa-title
VITE_GLOB_APP_TITLE = DaxPay多商户管理端

View File

@@ -1,17 +1,20 @@
# 名称
VITE_GLOB_APP_TITLE=DaxPay运营管理
VITE_GLOB_APP_TITLE=DaxPay运营端
# 压缩方式
VITE_BUILD_COMPRESS='gzip'
# 发布路径
VITE_PUBLIC_PATH=/
# 接口地址
VITE_GLOB_API_URL=/server
VITE_GLOB_API_URL=/admin
# 接口前缀
VITE_GLOB_API_URL_PREFIX =
# 终端类型
VITE_GLOB_APP_CLIENT=dax-pay
VITE_GLOB_APP_CLIENT=admin
# 超时时间
VITE_GLOB_API_TIMEOUT=30000

View File

@@ -1,17 +1,20 @@
# 名称
VITE_GLOB_APP_TITLE=DaxPay商户管理端
# 压缩方式
VITE_BUILD_COMPRESS='gzip'
# 发布路径
VITE_PUBLIC_PATH=/
# 接口地址
VITE_GLOB_API_URL=/server
VITE_GLOB_API_URL=/merchant
# 接口前缀
VITE_GLOB_API_URL_PREFIX =
# 终端类型
VITE_GLOB_APP_CLIENT=dax-pay
VITE_GLOB_APP_CLIENT=merchant
# 超时时间
VITE_GLOB_API_TIMEOUT=30000

View File

@@ -1,15 +0,0 @@
# public path
VITE_PUBLIC_PATH = /
# Whether to enable gzip or brotli compression
# Optional: gzip | brotli | none
# If you need multiple forms, you can use `,` to separate
VITE_BUILD_COMPRESS = 'gzip'
# Basic interface address SPA
VITE_GLOB_API_URL = /basic-api
# Interface prefix
VITE_GLOB_API_URL_PREFIX =

View File

@@ -25,7 +25,7 @@ async function createPlugins({ isBuild, root, compress, enableAnalyze }: Options
const appConfigPlugin = await createAppConfigPlugin({ root, isBuild })
vitePlugins.push(appConfigPlugin)
vitePlugins.push(DevTools())
vitePlugins.push(DevTools() as any)
// vite-plugin-html
vitePlugins.push(configHtmlPlugin({ isBuild }))

View File

@@ -10,11 +10,8 @@ function getConfFiles() {
const script = process.env.npm_lifecycle_script as string
const reg = new RegExp('--mode ([a-z_\\d]+)')
const result = reg.exec(script)
if (result) {
const mode = result[1]
return ['.env', `.env.${mode}`]
}
return ['.env', '.env.production']
const mode = result?.[1]
return [`.env.${mode}`]
}
/**

View File

@@ -1,26 +1,14 @@
{
"name": "vben-admin",
"name": "daxpay-multi-ui",
"version": "2.11.5",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": {
"url": "https://github.com/vbenjs/vue-vben-admin/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git"
},
"license": "MIT",
"author": {
"name": "vben",
"email": "anncwb@126.com",
"url": "https://github.com/anncwb"
},
"homepage": "",
"license": "Apache License v2",
"type": "module",
"scripts": {
"bootstrap": "pnpm install",
"build:analyze": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode admin",
"build:admin": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode admin",
"build:merchant": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode merchant",
"build:admin": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode admin",
"build:merchant": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode merchant",
"dev:admin": "pnpm vite --mode admin",
"dev:merchant": "pnpm vite --mode merchant",
"preinstall": "npx only-allow pnpm",

View File

@@ -1,24 +1,12 @@
<template>
<Layout.Footer :class="prefixCls" v-if="getShowLayoutFooter" ref="footerRef">
<div :class="`${prefixCls}__links`">
<a @click="openWindow(SITE_URL)">在线预览</a>
<GithubFilled @click="openWindow(GITHUB_URL)" :class="`${prefixCls}__github`" />
<a @click="openWindow(DOC_URL)">在线文档</a>
</div>
<div>Copyright &copy;2020 Vben Admin</div>
<div>Copyright &copy;2021 济南易杯光年软件技术有限公司</div>
</Layout.Footer>
</template>
<script lang="ts" setup>
import { computed, unref, ref } from 'vue'
import { Layout } from 'ant-design-vue'
import { GithubFilled } from '@ant-design/icons-vue'
import { DOC_URL, GITHUB_URL, SITE_URL } from '@/settings/siteSetting'
import { openWindow } from '@/utils'
import { useRootSetting } from '@/hooks/setting/useRootSetting'
import { useRouter } from 'vue-router'
import { useDesign } from '@/hooks/web/useDesign'

View File

@@ -1,37 +0,0 @@
import type { LocaleType } from '#/config'
import { set } from 'lodash-es'
export const loadLocalePool: LocaleType[] = []
export function setHtmlPageLang(locale: LocaleType) {
document.querySelector('html')?.setAttribute('lang', locale)
}
export function setLoadLocalePool(cb: (loadLocalePool: LocaleType[]) => void) {
cb(loadLocalePool)
}
export function genMessage(langs: Record<string, Record<string, any>>, prefix = 'lang') {
const obj: Recordable = {}
Object.keys(langs).forEach((key) => {
const langFileModule = langs[key].default
let fileName = key.replace(`./${prefix}/`, '').replace(/^\.\//, '')
const lastIndex = fileName.lastIndexOf('.')
fileName = fileName.substring(0, lastIndex)
const keyList = fileName.split('/')
const moduleName = keyList.shift()
const objKey = keyList.join('.')
if (moduleName) {
if (objKey) {
set(obj, moduleName, obj[moduleName] || {})
set(obj[moduleName], objKey, langFileModule)
} else {
set(obj, moduleName, langFileModule || {})
}
}
})
return obj
}

View File

@@ -1,19 +0,0 @@
{
"lang": {
"shortWeekDays": ["日", "一", "二", "三", "四", "五", "六"],
"shortMonths": [
"1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月"
]
}
}

View File

@@ -1,20 +0,0 @@
{
"okText": "确认",
"closeText": "关闭",
"cancelText": "取消",
"loadingText": "加载中...",
"saveText": "保存",
"delText": "删除",
"resetText": "重置",
"searchText": "搜索",
"queryText": "查询",
"inputText": "请输入",
"chooseText": "请选择",
"redo": "刷新",
"back": "返回",
"light": "亮色主题",
"dark": "黑暗主题"
}

View File

@@ -1,123 +0,0 @@
{
"app": {
"searchNotData": "暂无搜索结果",
"toSearch": "确认",
"toNavigate": "切换"
},
"countdown": {
"normalText": "获取验证码",
"sendText": "{0}秒后重新获取"
},
"cropper": {
"selectImage": "选择图片",
"uploadSuccess": "上传成功",
"imageTooBig": "图片超限",
"modalTitle": "头像上传",
"okText": "确认并上传",
"btn_reset": "重置",
"btn_rotate_left": "逆时针旋转",
"btn_rotate_right": "顺时针旋转",
"btn_scale_x": "水平翻转",
"btn_scale_y": "垂直翻转",
"btn_zoom_in": "放大",
"btn_zoom_out": "缩小",
"preview": "预览"
},
"drawer": {
"loadingText": "加载中...",
"cancelText": "关闭",
"okText": "确认"
},
"form": {
"putAway": "收起",
"unfold": "展开",
"maxTip": "字符数应小于{0}位",
"apiSelectNotFound": "请等待数据加载完成..."
},
"icon": {
"placeholder": "点击选择图标",
"search": "搜索图标",
"copy": "复制图标成功!"
},
"menu": {
"search": "菜单搜索"
},
"modal": {
"cancelText": "关闭",
"okText": "确认",
"close": "关闭",
"maximize": "最大化",
"restore": "还原"
},
"table": {
"settingDens": "密度",
"settingDensDefault": "默认",
"settingDensMiddle": "中等",
"settingDensSmall": "紧凑",
"settingColumn": "列设置",
"settingColumnShow": "列展示",
"settingIndexColumnShow": "序号列",
"settingSelectColumnShow": "勾选列",
"settingFixedLeft": "固定到左侧",
"settingFixedRight": "固定到右侧",
"settingFullScreen": "全屏",
"index": "序号",
"total": "共 {total} 条数据",
"selectionBarTips": "已选择{count}条记录",
"selectionBarClear": "清空",
"selectionBarEmpty": "未选中任何记录"
},
"time": {
"before": "前",
"after": "后",
"just": "刚刚",
"seconds": "秒",
"minutes": "分钟",
"hours": "小时",
"days": "天"
},
"tree": {
"selectAll": "选择全部",
"unSelectAll": "取消选择",
"expandAll": "展开全部",
"unExpandAll": "折叠全部",
"checkStrictly": "层级关联",
"checkUnStrictly": "层级独立"
},
"upload": {
"save": "保存",
"upload": "上传",
"imgUpload": "图片上传",
"uploaded": "已上传",
"operating": "操作",
"del": "删除",
"download": "下载",
"saveWarn": "请等待文件上传后,保存!",
"saveError": "没有上传成功的文件,无法保存!",
"preview": "预览",
"choose": "选择文件",
"accept": "支持{0}格式",
"acceptUpload": "只能上传{0}格式文件",
"maxSize": "单个文件不超过{0}MB",
"maxSizeMultiple": "只能上传不超过{0}MB的文件!",
"maxNumber": "最多只能上传{0}个文件",
"legend": "略缩图",
"fileName": "文件名",
"fileSize": "文件大小",
"fileStatue": "状态",
"pending": "待上传",
"startUpload": "开始上传",
"uploadSuccess": "上传成功",
"uploadError": "上传失败",
"uploading": "上传中",
"uploadWait": "请等待文件上传结束后操作",
"reUploadFailed": "重新上传失败文件"
},
"verify": {
"error": "验证失败!",
"time": "验证校验成功,耗时{time}秒!",
"redoTip": "点击图片可刷新",
"dragText": "请按住滑块拖动",
"successText": "验证通过"
}
}

View File

@@ -1,96 +0,0 @@
{
"footer": {
"onlinePreview": "在线预览",
"onlineDocument": "在线文档"
},
"header": {
"dropdownChangeApi": "切换API",
"dropdownItemDoc": "文档",
"dropdownItemLoginOut": "退出系统",
"tooltipErrorLog": "错误日志",
"tooltipLock": "锁定屏幕",
"tooltipNotify": "消息通知",
"tooltipEntryFull": "全屏",
"tooltipExitFull": "退出全屏",
"lockScreenPassword": "锁屏密码",
"lockScreen": "锁定屏幕",
"lockScreenBtn": "锁定",
"home": "首页"
},
"multipleTab": {
"reload": "重新加载",
"close": "关闭标签页",
"closeLeft": "关闭左侧标签页",
"closeRight": "关闭右侧标签页",
"closeOther": "关闭其它标签页",
"closeAll": "关闭全部标签页"
},
"setting": {
"contentModeFull": "流式",
"contentModeFixed": "定宽",
"topMenuAlignLeft": "居左",
"topMenuAlignRight": "居中",
"topMenuAlignCenter": "居右",
"menuTriggerNone": "不显示",
"menuTriggerBottom": "底部",
"menuTriggerTop": "顶部",
"menuTypeSidebar": "左侧菜单模式",
"menuTypeMixSidebar": "左侧菜单混合模式",
"menuTypeMix": "顶部菜单混合模式",
"menuTypeTopMenu": "顶部菜单模式",
"on": "开",
"off": "关",
"minute": "分钟",
"operatingTitle": "操作成功",
"operatingContent": "复制成功,请到 src/settings/projectSetting.ts 中修改配置!",
"resetSuccess": "重置成功!",
"copyBtn": "拷贝",
"clearBtn": "清空缓存并返回登录页",
"drawerTitle": "项目配置",
"darkMode": "主题",
"navMode": "导航栏模式",
"interfaceFunction": "界面功能",
"interfaceDisplay": "界面显示",
"animation": "动画",
"splitMenu": "分割菜单",
"closeMixSidebarOnChange": "切换页面关闭菜单",
"sysTheme": "系统主题",
"headerTheme": "顶栏主题",
"sidebarTheme": "菜单主题",
"menuDrag": "侧边菜单拖拽",
"menuSearch": "菜单搜索",
"menuAccordion": "侧边菜单手风琴模式",
"menuCollapse": "折叠菜单",
"collapseMenuDisplayName": "折叠菜单显示名称",
"topMenuLayout": "顶部菜单布局",
"menuCollapseButton": "菜单折叠按钮",
"contentMode": "内容区域宽度",
"expandedMenuWidth": "菜单展开宽度",
"breadcrumb": "面包屑",
"breadcrumbIcon": "面包屑图标",
"tabs": "标签页",
"tabDetail": "标签详情页",
"tabsQuickBtn": "标签页快捷按钮",
"tabsRedoBtn": "标签页刷新按钮",
"tabsFoldBtn": "标签页折叠按钮",
"sidebar": "左侧菜单",
"header": "顶栏",
"footer": "页脚",
"fullContent": "全屏内容",
"grayMode": "灰色模式",
"colorWeak": "色弱模式",
"progress": "顶部进度条",
"switchLoading": "切换loading",
"switchAnimation": "切换动画",
"animationType": "动画类型",
"autoScreenLock": "自动锁屏",
"notAutoScreenLock": "不自动锁屏",
"fixedHeader": "固定header",
"fixedSideBar": "固定Sidebar",
"mixSidebarTrigger": "混合菜单触发方式",
"triggerHover": "悬停",
"triggerClick": "点击",
"mixSidebarFixed": "固定展开菜单",
"autoCollapseTabsInFold": "fold模式下自动收起标签页"
}
}

View File

@@ -1,4 +0,0 @@
{
"login": "登录",
"errorLogList": "错误日志列表"
}

View File

@@ -1,6 +0,0 @@
{
"dashboard": "Dashboard",
"about": "关于",
"workbench": "工作台",
"analysis": "分析页"
}

View File

@@ -1,162 +0,0 @@
{
"charts": {
"baiduMap": "百度地图",
"aMap": "高德地图",
"googleMap": "谷歌地图",
"charts": "图表",
"map": "地图",
"line": "折线图",
"pie": "饼图"
},
"comp": {
"comp": "组件",
"basic": "基础组件",
"transition": "动画组件",
"countTo": "数字动画",
"scroll": "滚动组件",
"scrollBasic": "基础滚动",
"scrollAction": "滚动函数",
"virtualScroll": "虚拟滚动",
"tree": "Tree",
"treeBasic": "基础树",
"editTree": "可搜索/工具栏",
"actionTree": "函数操作示例",
"modal": "弹窗扩展",
"drawer": "抽屉扩展",
"desc": "详情组件",
"verify": "验证组件",
"verifyDrag": "拖拽校验",
"verifyRotate": "图片还原",
"qrcode": "二维码组件",
"strength": "密码强度组件",
"upload": "上传组件",
"loading": "Loading",
"time": "相对时间",
"cropperImage": "图片裁剪"
},
"feat": {
"feat": "功能",
"icon": "图标",
"sessionTimeout": "登录过期",
"tabs": "标签页操作",
"tabDetail": "标签详情页",
"print": "打印",
"contextMenu": "右键菜单",
"download": "文件下载",
"clickOutSide": "ClickOutSide组件",
"imgPreview": "图片预览",
"copy": "剪切板",
"ellipsis": "文本省略",
"msg": "消息提示",
"watermark": "水印",
"ripple": "水波纹",
"fullScreen": "全屏",
"errorLog": "错误日志",
"tab": "Tab带参",
"tab1": "Tab带参1",
"tab2": "Tab带参2",
"menu": "Menu带参",
"menu1": "Menu带参1",
"menu2": "Menu带参2",
"ws": "websocket测试",
"breadcrumb": "面包屑导航",
"breadcrumbFlat": "平级模式",
"requestDemo": "测试请求重试",
"breadcrumbFlatDetail": "平级详情",
"breadcrumbChildren": "层级模式",
"breadcrumbChildrenDetail": "层级详情"
},
"flow": {
"name": "图形编辑器",
"flowChart": "流程图"
},
"form": {
"form": "Form",
"basic": "基础表单",
"useForm": "useForm",
"refForm": "RefForm",
"advancedForm": "可收缩表单",
"ruleForm": "表单验证",
"dynamicForm": "动态表单",
"customerForm": "自定义组件",
"appendForm": "表单增删示例",
"tabsForm": "标签页+多级field"
},
"iframe": {
"frame": "外部页面",
"antv": "antVue文档(内嵌)",
"doc": "项目文档(内嵌)",
"docExternal": "项目文档(外链)"
},
"level": {
"level": "多级菜单"
},
"page": {
"page": "页面",
"form": "表单页",
"formBasic": "基础表单",
"formStep": "分步表单",
"formHigh": "高级表单",
"desc": "详情页",
"descBasic": "基础详情页",
"descHigh": "高级详情页",
"result": "结果页",
"resultSuccess": "成功页",
"resultFail": "失败页",
"account": "个人页",
"accountCenter": "个人中心",
"accountSetting": "个人设置",
"exception": "异常页",
"netWorkError": "网络错误",
"notData": "无数据",
"list": "列表页",
"listCard": "卡片列表",
"listBasic": "标准列表",
"listSearch": "搜索列表"
},
"permission": {
"permission": "权限管理",
"front": "基于前端权限",
"frontPage": "页面权限",
"frontBtn": "按钮权限",
"frontTestA": "权限测试页A",
"frontTestB": "权限测试页B",
"back": "基于后台权限",
"backPage": "页面权限",
"backBtn": "按钮权限"
},
"steps": {
"page": "引导页"
},
"system": {
"moduleName": "系统管理",
"account": "账号管理",
"vxeTableAccount": "账号管理(VxeTable)",
"account_detail": "账号详情",
"password": "修改密码",
"dept": "部门管理",
"menu": "菜单管理",
"role": "角色管理"
},
"table": {
"table": "Table",
"basic": "基础表格",
"treeTable": "树形表格",
"fetchTable": "远程加载示例",
"fixedColumn": "固定列",
"customerCell": "自定义列",
"formTable": "开启搜索区域",
"useTable": "UseTable",
"refTable": "RefTable",
"multipleHeader": "多级表头",
"mergeHeader": "合并单元格",
"expandTable": "可展开表格",
"fixedHeight": "定高/头部自定义",
"footerTable": "表尾行合计",
"editCellTable": "可编辑单元格",
"editRowTable": "可编辑行",
"authColumn": "权限列",
"resizeParentHeightTable": "继承父元素高度",
"vxeTable": "VxeTable"
}
}

View File

@@ -1,80 +0,0 @@
{
"api": {
"operationSuccess": "操作成功",
"operationFailed": "操作失败",
"successTip": "成功提示",
"errorMessage": "操作失败,系统异常!",
"timeoutMessage": "登录超时,请重新登录!",
"apiTimeoutMessage": "接口请求超时,请刷新页面重试!",
"apiRequestFailed": "请求出错,请稍候重试",
"networkException": "网络异常",
"networkExceptionMsg": "网络异常,请检查您的网络连接是否正常!"
},
"app": {
"logoutTip": "温馨提醒",
"logoutMessage": "是否确认退出系统?",
"menuLoading": "菜单加载中..."
},
"errorLog": {
"tableTitle": "错误日志列表",
"tableColumnType": "类型",
"tableColumnDate": "时间",
"tableColumnFile": "文件",
"tableColumnMsg": "错误信息",
"tableColumnStackMsg": "stack信息",
"tableActionDesc": "详情",
"modalTitle": "错误详情",
"fireVueError": "点击触发vue错误",
"fireResourceError": "点击触发资源加载错误",
"fireAjaxError": "点击触发ajax错误",
"enableMessage": "只在`/src/settings/projectSetting.ts` 内的useErrorHandle=true时生效."
},
"exception": {
"backLogin": "返回登录",
"backHome": "返回首页",
"subTitle403": "抱歉,您无权访问此页面。",
"subTitle404": "抱歉,您访问的页面不存在。",
"subTitle500": "抱歉,服务器报告错误。",
"noDataTitle": "当前页无数据",
"networkErrorTitle": "网络错误",
"networkErrorSubTitle": "抱歉,您的网络连接已断开,请检查您的网络!"
},
"lock": {
"unlock": "点击解锁",
"alert": "锁屏密码错误",
"backToLogin": "返回登录",
"entry": "进入系统",
"placeholder": "请输入锁屏密码或者用户密码"
},
"login": {
"backSignIn": "返回",
"signInFormTitle": "登录",
"mobileSignInFormTitle": "手机登录",
"qrSignInFormTitle": "二维码登录",
"signUpFormTitle": "注册",
"forgetFormTitle": "重置密码",
"signInTitle": "开箱即用的中后台管理系统",
"signInDesc": "输入您的个人详细信息开始使用!",
"policy": "我同意xxx隐私政策",
"scanSign": "扫码后点击\"确认\",即可完成登录",
"loginButton": "登录",
"registerButton": "注册",
"rememberMe": "记住我",
"forgetPassword": "忘记密码?",
"otherSignIn": "其他登录方式",
"loginSuccessTitle": "登录成功",
"loginSuccessDesc": "欢迎回来",
"accountPlaceholder": "请输入账号",
"passwordPlaceholder": "请输入密码",
"smsPlaceholder": "请输入验证码",
"mobilePlaceholder": "请输入手机号码",
"policyPlaceholder": "勾选后才能注册",
"diffPwd": "两次输入密码不一致",
"userName": "账号",
"password": "密码",
"confirmPassword": "确认密码",
"email": "邮箱",
"smsCode": "短信验证码",
"mobile": "手机号码"
}
}

View File

@@ -1,18 +0,0 @@
import { genMessage } from '../helper'
import antdLocale from 'ant-design-vue/es/locale/zh_CN'
import { deepMerge } from '@/utils'
const modules = import.meta.glob('./zh-CN/**/*.{json,ts,js}', { eager: true })
export default {
message: {
...genMessage(modules as Recordable<Recordable>, 'zh-CN'),
antdLocale: {
...antdLocale,
DatePicker: deepMerge(
antdLocale.DatePicker,
genMessage(modules as Recordable<Recordable>, 'zh-CN').antdLocale.DatePicker,
),
},
},
}

4
types/config.d.ts vendored
View File

@@ -143,6 +143,10 @@ export interface GlobConfig {
// Project abbreviation
shortName: string
}
/**
* 环境配置
*/
export interface GlobEnvConfig {
// 项目名称
VITE_GLOB_APP_TITLE: string

View File

@@ -14,10 +14,13 @@ export default defineApplicationConfig({
],
},
server: {
open: false, // 项目启动后,自动打开
host: true,
port: 3300,
proxy: {
// 运营管理端
'/admin': {
target: 'http://localhost:9000',
target: 'http://localhost:9999',
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(new RegExp(`^/server`), ''),
@@ -26,7 +29,7 @@ export default defineApplicationConfig({
},
// 商户端
'/merchant': {
target: 'http://localhost:9000',
target: 'http://localhost:8888',
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(new RegExp(`^/server`), ''),
@@ -34,7 +37,6 @@ export default defineApplicationConfig({
// secure: false
},
},
open: false, // 项目启动后,自动打开
warmup: {
clientFiles: ['./index.html', './src/{views,components}/*'],
},