-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7734c49
commit ae67323
Showing
71 changed files
with
2,396 additions
and
2,655 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
## 开发环境 | ||
|
||
# 变量必须以 VITE_ 为前缀才能暴露给外部读取 | ||
NODE_ENV='development' | ||
|
||
VITE_APP_TITLE = 'mall-admin' | ||
# 应用端口 | ||
VITE_APP_PORT = 9527 | ||
|
||
# API请求前缀 | ||
# 代理前缀 | ||
VITE_APP_BASE_API = '/dev-api' | ||
|
||
# proxy代理配置 | ||
VITE_APP_TARGET_URL = 'http://localhost:9999' | ||
VITE_APP_TARGET_BASE_API = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
## 生产环境 | ||
NODE_ENV='production' | ||
|
||
VITE_APP_TITLE = 'mall-admin' | ||
VITE_APP_PORT = 3000 | ||
|
||
# API请求前缀 | ||
# 代理前缀 | ||
VITE_APP_BASE_API = '/prod-api' | ||
|
||
# proxy代理配置 | ||
VITE_APP_TARGET_URL = "http://vapi.youlai.tech" | ||
VITE_APP_TARGET_BASE_API = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ node_modules | |
dist | ||
dist-ssr | ||
*.local | ||
.history | ||
|
||
# Editor directories and files | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,35 @@ | ||
<template> | ||
<el-config-provider :locale="locale" :size="size"> | ||
<!-- 开启水印 --> | ||
<el-watermark | ||
v-if="watermarkEnabled" | ||
:font="{ color: fontColor }" | ||
:content="defaultSettings.watermarkContent" | ||
class="wh-full" | ||
> | ||
<router-view /> | ||
</el-watermark> | ||
<!-- 关闭水印 --> | ||
<router-view v-else /> | ||
</el-config-provider> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ElConfigProvider } from "element-plus"; | ||
import { useAppStore } from "@/store/modules/app"; | ||
import { useAppStore, useSettingsStore } from "@/store"; | ||
import defaultSettings from "@/settings"; | ||
import { ThemeEnum } from "@/enums/ThemeEnum"; | ||
const appStore = useAppStore(); | ||
</script> | ||
const settingsStore = useSettingsStore(); | ||
<template> | ||
<el-config-provider :locale="appStore.locale" :size="appStore.size"> | ||
<router-view /> | ||
</el-config-provider> | ||
</template> | ||
const locale = computed(() => appStore.locale); | ||
const size = computed(() => appStore.size); | ||
const watermarkEnabled = computed(() => settingsStore.watermarkEnabled); | ||
// 明亮/暗黑主题水印字体颜色适配 | ||
const fontColor = computed(() => { | ||
return settingsStore.theme === ThemeEnum.DARK | ||
? "rgba(255, 255, 255, .15)" | ||
: "rgba(0, 0, 0, .15)"; | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<component :is="type" v-bind="linkProps(to)"> | ||
<slot></slot> | ||
</component> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
defineOptions({ | ||
name: "AppLink", | ||
inheritAttrs: false, | ||
}); | ||
import { isExternal } from "@/utils/index"; | ||
const props = defineProps({ | ||
to: { | ||
type: String, | ||
required: true, | ||
}, | ||
}); | ||
const isExternalLink = computed(() => isExternal(props.to)); | ||
const type = computed(() => { | ||
return isExternalLink.value ? "a" : "router-link"; | ||
}); | ||
const linkProps = (to: string) => { | ||
if (isExternalLink.value) { | ||
return { | ||
href: to, | ||
target: "_blank", | ||
rel: "noopener noreferrer", | ||
}; | ||
} | ||
return { | ||
to: to, | ||
}; | ||
}; | ||
</script> |
Oops, something went wrong.