u
This commit is contained in:
1 parent
7dd7794fd1
commit
9b2db64cc6
10 files changed
+160
-5
No files matched your search
@@ -1,12 +1,12 @@
|
|||||||
server:
|
server:
|
||||||
port: 8081
|
port: 8083
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driver-class-name: net.sourceforge.jtds.jdbc.Driver
|
driver-class-name: net.sourceforge.jtds.jdbc.Driver
|
||||||
url: jdbc:jtds:sqlserver://192.168.1.176:1433;databaseName=G3-Website
|
url: jdbc:jtds:sqlserver://192.168.1.189:1433;databaseName=G3-Link
|
||||||
username: sa
|
username: sa
|
||||||
password: "sa"
|
password: "g3soft"
|
||||||
# druid 连接池管理
|
# druid 连接池管理
|
||||||
druid:
|
druid:
|
||||||
# 初始化时建立物理连接的个数
|
# 初始化时建立物理连接的个数
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
VITE_SERVER_BASEURL = 'http://127.0.0.1:8081'
|
VITE_SERVER_BASEURL = 'http://127.0.0.1:8083'
|
||||||
VITE_WEBSOCKET_BASEURL = 'ws://127.0.0.1:8081/websocket'
|
VITE_WEBSOCKET_BASEURL = 'ws://127.0.0.1:8083/websocket'
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './time';
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import dayjs from 'dayjs';
|
||||||
|
import utc from 'dayjs/plugin/utc';
|
||||||
|
import timezone from 'dayjs/plugin/timezone';
|
||||||
|
|
||||||
|
export function getBuildTime() {
|
||||||
|
dayjs.extend(utc);
|
||||||
|
dayjs.extend(timezone);
|
||||||
|
|
||||||
|
const buildTime = dayjs.tz(Date.now(), 'Asia/Shanghai').format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
|
return buildTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import IconsResolver from "unplugin-icons/resolver";
|
||||||
|
import Components from "unplugin-vue-components/vite";
|
||||||
|
import { ArcoResolver } from "unplugin-vue-components/resolvers";
|
||||||
|
import type { PluginOption } from "vite";
|
||||||
|
|
||||||
|
export function setupAutoImport(viteEnv: Env.ImportMeta) {
|
||||||
|
// 从环境变量中提取图标相关的前缀
|
||||||
|
const { VITE_ICON_PREFIX, VITE_ICON_LOCAL_PREFIX } = viteEnv;
|
||||||
|
|
||||||
|
// 从本地图标前缀中提取图标集合名称
|
||||||
|
const collectionName = VITE_ICON_LOCAL_PREFIX.replace(`${VITE_ICON_PREFIX}-`, "");
|
||||||
|
const plugins: PluginOption[] = [
|
||||||
|
Components({
|
||||||
|
// 自动导入的组件类型声明文件
|
||||||
|
dts: "src/types/auto-import.d.ts",
|
||||||
|
types: [
|
||||||
|
{
|
||||||
|
from: "vue-router",
|
||||||
|
names: ["RouterLink", "RouterView"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
// 配置图标解析器
|
||||||
|
resolvers: [
|
||||||
|
IconsResolver({
|
||||||
|
customCollections: [collectionName], // 本地图标集合
|
||||||
|
componentPrefix: VITE_ICON_PREFIX // 图标组件的前缀
|
||||||
|
}),
|
||||||
|
ArcoResolver()
|
||||||
|
]
|
||||||
|
})
|
||||||
|
];
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import type { Plugin } from 'vite';
|
||||||
|
|
||||||
|
export function setupHtmlPlugin(buildTime: string) {
|
||||||
|
const plugin: Plugin = {
|
||||||
|
name: 'html-plugin',
|
||||||
|
apply: 'build',
|
||||||
|
transformIndexHtml(html) {
|
||||||
|
return html.replace('<head>', `<head>\n <meta name="buildTime" content="${buildTime}">`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return plugin;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import type { PluginOption } from "vite";
|
||||||
|
import vue from "@vitejs/plugin-vue";
|
||||||
|
import VueDevtools from "vite-plugin-vue-devtools";
|
||||||
|
import progress from "vite-plugin-progress";
|
||||||
|
import { setupUnocss } from "./unocss";
|
||||||
|
import { setupHtmlPlugin } from "./html";
|
||||||
|
import { setupUnPluginIcon } from "./unplugin-icon";
|
||||||
|
import { setupAutoImport } from "./auto-import";
|
||||||
|
|
||||||
|
export function setupVitePlugins(viteEnv: Env.ImportMeta, buildTime: string) {
|
||||||
|
const plugins: PluginOption = [
|
||||||
|
vue(),
|
||||||
|
VueDevtools(),
|
||||||
|
progress(),
|
||||||
|
setupUnocss(viteEnv),
|
||||||
|
setupHtmlPlugin(buildTime),
|
||||||
|
setupAutoImport(viteEnv),
|
||||||
|
...setupUnPluginIcon(viteEnv),
|
||||||
|
];
|
||||||
|
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import process from "node:process";
|
||||||
|
import path from "node:path";
|
||||||
|
import unocss from "@unocss/vite";
|
||||||
|
import presetIcons from "@unocss/preset-icons";
|
||||||
|
import { FileSystemIconLoader } from "@iconify/utils/lib/loader/node-loaders";
|
||||||
|
|
||||||
|
export function setupUnocss(viteEnv: Env.ImportMeta) {
|
||||||
|
const { VITE_ICON_PREFIX, VITE_ICON_LOCAL_PREFIX } = viteEnv;
|
||||||
|
|
||||||
|
const localIconPath = path.join(process.cwd(), "src/assets/svg-icon");
|
||||||
|
|
||||||
|
/** The name of the local icon collection */
|
||||||
|
const collectionName = VITE_ICON_LOCAL_PREFIX.replace(
|
||||||
|
`${VITE_ICON_PREFIX}-`,
|
||||||
|
""
|
||||||
|
);
|
||||||
|
|
||||||
|
return unocss({
|
||||||
|
presets: [
|
||||||
|
presetIcons({
|
||||||
|
prefix: `${VITE_ICON_PREFIX}-`,
|
||||||
|
scale: 1,
|
||||||
|
extraProperties: {
|
||||||
|
display: "inline-block",
|
||||||
|
},
|
||||||
|
collections: {
|
||||||
|
[collectionName]: FileSystemIconLoader(localIconPath, (svg) =>
|
||||||
|
svg.replace(/^<svg\s/, '<svg width="1em" height="1em" ')
|
||||||
|
),
|
||||||
|
},
|
||||||
|
warn: true,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import path from "node:path";
|
||||||
|
import process from "node:process";
|
||||||
|
import { FileSystemIconLoader } from "unplugin-icons/loaders";
|
||||||
|
import type { PluginOption } from "vite";
|
||||||
|
import Icons from "unplugin-icons/vite";
|
||||||
|
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
|
||||||
|
export function setupUnPluginIcon(viteEnv: Env.ImportMeta) {
|
||||||
|
const { VITE_ICON_PREFIX, VITE_ICON_LOCAL_PREFIX } = viteEnv;
|
||||||
|
|
||||||
|
const localIconPath = path.join(process.cwd(), "src/assets/svg-icon");
|
||||||
|
/** The name of the local icon collection */
|
||||||
|
const collectionName = VITE_ICON_LOCAL_PREFIX.replace(
|
||||||
|
`${VITE_ICON_PREFIX}-`,
|
||||||
|
""
|
||||||
|
);
|
||||||
|
|
||||||
|
const plugins: PluginOption[] = [
|
||||||
|
createSvgIconsPlugin({
|
||||||
|
iconDirs: [localIconPath],
|
||||||
|
symbolId: `${VITE_ICON_LOCAL_PREFIX}-[dir]-[name]`,
|
||||||
|
inject: "body-last",
|
||||||
|
customDomId: "__SVG_ICON_LOCAL__",
|
||||||
|
}),
|
||||||
|
Icons({
|
||||||
|
compiler: "vue3",
|
||||||
|
customCollections: {
|
||||||
|
[collectionName]: FileSystemIconLoader(localIconPath, (svg) =>
|
||||||
|
svg.replace(/^<svg\s/, '<svg width="1em" height="1em" ')
|
||||||
|
),
|
||||||
|
},
|
||||||
|
scale: 1,
|
||||||
|
defaultClass: "inline-block",
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
@@ -57,6 +57,7 @@ declare module 'vue' {
|
|||||||
CustomEmpty: typeof import('./../components/custom-empty/index.vue')['default']
|
CustomEmpty: typeof import('./../components/custom-empty/index.vue')['default']
|
||||||
CustomLoading: typeof import('./../components/custom-loading/index.vue')['default']
|
CustomLoading: typeof import('./../components/custom-loading/index.vue')['default']
|
||||||
Directory: typeof import('./../components/wang-editor/modules/directory.vue')['default']
|
Directory: typeof import('./../components/wang-editor/modules/directory.vue')['default']
|
||||||
|
Editor: typeof import('./../components/editor/index.vue')['default']
|
||||||
HomeQuery: typeof import('./../components/HomeQuery.vue')['default']
|
HomeQuery: typeof import('./../components/HomeQuery.vue')['default']
|
||||||
ImageUpdateCard: typeof import('./../components/image-update-card/index.vue')['default']
|
ImageUpdateCard: typeof import('./../components/image-update-card/index.vue')['default']
|
||||||
ImageUpload: typeof import('./../components/image-upload/index.vue')['default']
|
ImageUpload: typeof import('./../components/image-upload/index.vue')['default']
|
||||||
|
|||||||
Reference in new issue
Block a user