This commit is contained in:
coderwei 2025-06-03 11:33:59 +08:00 committed by GitHub
commit 32539e57b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
50 changed files with 717 additions and 5837 deletions

View File

@ -1,11 +1,11 @@
VUE_APP_API_HOST=http://localhost:5678 VITE_APP_API_HOST=http://localhost:5678
VUE_APP_WS_HOST=ws://localhost:5678 VITE_APP_WS_HOST=ws://localhost:5678
VUE_APP_USER=18888888888 VITE_APP_USER=18888888888
VUE_APP_PASS=12345678 VITE_APP_PASS=12345678
VUE_APP_ADMIN_USER=admin VITE_APP_ADMIN_USER=admin
VUE_APP_ADMIN_PASS=admin123 VITE_APP_ADMIN_PASS=admin123
VUE_APP_KEY_PREFIX=GeekAI_DEV_ VITE_APP_KEY_PREFIX=GeekAI_DEV_
VUE_APP_TITLE="Geek-AI 创作系统" VITE_APP_TITLE="Geek-AI 创作系统"
VUE_APP_VERSION=v4.1.8 VITE_APP_VERSION=v4.1.8
VUE_APP_DOCS_URL=https://docs.geekai.me VITE_APP_DOCS_URL=https://docs.geekai.me
VUE_APP_GIT_URL=https://github.com/yangjian102621/geekai VITE_APP_GIT_URL=https://github.com/yangjian102621/geekai

View File

@ -1,7 +1,7 @@
VUE_APP_API_HOST= VITE_APP_API_HOST=
VUE_APP_WS_HOST= VITE_APP_WS_HOST=
VUE_APP_KEY_PREFIX=GeekAI_ VITE_APP_KEY_PREFIX=GeekAI_
VUE_APP_TITLE="Geek-AI 创作系统" VITE_APP_TITLE="Geek-AI 创作系统"
VUE_APP_VERSION=v4.1.8 VITE_APP_VERSION=v4.1.8
VUE_APP_DOCS_URL=https://docs.geekai.me VITE_APP_DOCS_URL=https://docs.geekai.me
VUE_APP_GIT_URL=https://github.com/yangjian102621/geekai VITE_APP_GIT_URL=https://github.com/yangjian102621/geekai

View File

@ -1,5 +1 @@
module.exports = { module.exports = {}
presets: [
'@vue/cli-plugin-babel/preset'
]
}

15
web/index.html Normal file
View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>geekai</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="./src/main.js"></script>
</body>
</html>

View File

@ -3,9 +3,9 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vite",
"build": "vue-cli-service build", "build": "vite build",
"lint": "vue-cli-service lint" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",
@ -22,7 +22,7 @@
"json-bigint": "^1.0.0", "json-bigint": "^1.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"markdown-it": "^13.0.1", "markdown-it": "^13.0.1",
"markdown-it-emoji": "^2.0.0", "markdown-it-emoji": "^2.0.0",
"markdown-it-mathjax3": "^4.3.2", "markdown-it-mathjax3": "^4.3.2",
"markmap-common": "^0.16.0", "markmap-common": "^0.16.0",
"markmap-lib": "^0.16.1", "markmap-lib": "^0.16.1",
@ -43,17 +43,14 @@
"devDependencies": { "devDependencies": {
"@babel/core": "7.18.6", "@babel/core": "7.18.6",
"@babel/eslint-parser": "^7.12.16", "@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0", "@vitejs/plugin-vue": "^5.2.4",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3", "eslint-plugin-vue": "^8.0.3",
"postcss": "^8.4.49", "postcss": "^8.4.49",
"stylus": "^0.58.1", "stylus": "^0.58.1",
"stylus-loader": "^7.0.0",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"webpack": "^5.90.3" "vite": "^6.3.5"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,7 @@ watch(
const handler = ref(0); const handler = ref(0);
// websocket // websocket
const connect = () => { const connect = () => {
let host = process.env.VUE_APP_WS_HOST; let host = import.meta.env.VITE_APP_WS_HOST;
if (host === "") { if (host === "") {
if (location.protocol === "https:") { if (location.protocol === "https:") {
host = "wss://" + location.host; host = "wss://" + location.host;

View File

@ -20,8 +20,8 @@ import { showMessageError } from "@/utils/dialog";
import { getLicenseInfo, getSystemInfo } from "@/store/cache"; import { getLicenseInfo, getSystemInfo } from "@/store/cache";
const title = ref(""); const title = ref("");
const version = ref(process.env.VUE_APP_VERSION); const version = ref(import.meta.env.VITE_APP_VERSION);
const gitURL = ref(process.env.VUE_APP_GIT_URL); const gitURL = ref(import.meta.env.VITE_APP_GIT_URL);
const copyRight = ref(""); const copyRight = ref("");
const license = ref({}); const license = ref({});
const props = defineProps({ const props = defineProps({
@ -34,7 +34,7 @@ const props = defineProps({
// //
getSystemInfo() getSystemInfo()
.then((res) => { .then((res) => {
title.value = res.data.title ?? process.env.VUE_APP_TITLE; title.value = res.data.title ?? import.meta.env.VITE_APP_TITLE;
copyRight.value = copyRight.value =
res.data.copyright.length > 1 res.data.copyright.length > 1
? res.data.copyright ? res.data.copyright

View File

@ -218,8 +218,8 @@ watch(
const login = ref(true); const login = ref(true);
const data = ref({ const data = ref({
username: process.env.VUE_APP_USER, username: import.meta.env.VITE_APP_USER,
password: process.env.VUE_APP_PASS, password: import.meta.env.VITE_APP_PASS,
mobile: "", mobile: "",
email: "", email: "",
repass: "", repass: "",

View File

@ -107,7 +107,7 @@ const animateVoice = () => {
const wavRecorder = ref(new WavRecorder({ sampleRate: 24000 })); const wavRecorder = ref(new WavRecorder({ sampleRate: 24000 }));
const wavStreamPlayer = ref(new WavStreamPlayer({ sampleRate: 24000 })); const wavStreamPlayer = ref(new WavStreamPlayer({ sampleRate: 24000 }));
let host = process.env.VUE_APP_WS_HOST; let host = import.meta.env.VITE_APP_WS_HOST;
if (host === "") { if (host === "") {
if (location.protocol === "https:") { if (location.protocol === "https:") {
host = "wss://" + location.host; host = "wss://" + location.host;
@ -334,5 +334,5 @@ defineExpose({ connect, hangUp });
<style scoped lang="stylus"> <style scoped lang="stylus">
@import "@/assets/css/realtime.styl" @import "../assets/css/realtime.styl"
</style> </style>

View File

@ -34,5 +34,5 @@ const props = defineProps({
</script> </script>
<style scoped lang="stylus"> <style scoped lang="stylus">
@import "~@/assets/css/running-job-list.styl" @import "../assets/css/running-job-list.styl"
</style> </style>

View File

@ -62,8 +62,8 @@ import { onMounted, ref } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { getSystemInfo } from "@/store/cache"; import { getSystemInfo } from "@/store/cache";
const title = ref(process.env.VUE_APP_TITLE); const title = ref(import.meta.env.VITE_APP_TITLE);
const version = ref(process.env.VUE_APP_VERSION); const version = ref(import.meta.env.VITE_APP_VERSION);
const samples = ref([ const samples = ref([
"用小学生都能听懂的术语解释什么是量子纠缠", "用小学生都能听懂的术语解释什么是量子纠缠",

View File

@ -52,7 +52,7 @@ import {ElMessage} from "element-plus";
import {removeAdminToken} from "@/store/session"; import {removeAdminToken} from "@/store/session";
import {useSharedStore} from "@/store/sharedata"; import {useSharedStore} from "@/store/sharedata";
const version = ref(process.env.VUE_APP_VERSION); const version = ref(import.meta.env.VITE_APP_VERSION);
const avatar = ref("/images/user-info.jpg"); const avatar = ref("/images/user-info.jpg");
const sidebar = useSidebarStore(); const sidebar = useSidebarStore();
const router = useRouter(); const router = useRouter();

View File

@ -6,8 +6,8 @@ import {removeAdminInfo} from "@/store/cache";
* storage handler * storage handler
*/ */
const UserTokenKey = process.env.VUE_APP_KEY_PREFIX + "Authorization"; const UserTokenKey = import.meta.env.VITE_APP_KEY_PREFIX + "Authorization";
const AdminTokenKey = process.env.VUE_APP_KEY_PREFIX + "Admin-Authorization" const AdminTokenKey = import.meta.env.VITE_APP_KEY_PREFIX + "Admin-Authorization"
export function getSessionId() { export function getSessionId() {
return randString(42) return randString(42)

View File

@ -46,9 +46,9 @@ export function FormatFileSize(bytes) {
} }
export function setRoute(path) { export function setRoute(path) {
Storage.set(process.env.VUE_APP_KEY_PREFIX + 'ROUTE_',path) Storage.set(import.meta.env.VITE_APP_KEY_PREFIX + 'ROUTE_', path)
} }
export function getRoute() { export function getRoute() {
return Storage.get(process.env.VUE_APP_KEY_PREFIX + 'ROUTE_') return Storage.get(import.meta.env.VITE_APP_KEY_PREFIX + 'ROUTE_')
} }

View File

@ -9,7 +9,7 @@ import axios from 'axios'
import {getAdminToken, getUserToken, removeAdminToken, removeUserToken} from "@/store/session"; import {getAdminToken, getUserToken, removeAdminToken, removeUserToken} from "@/store/session";
axios.defaults.timeout = 180000 axios.defaults.timeout = 180000
axios.defaults.baseURL = process.env.VUE_APP_API_HOST axios.defaults.baseURL = import.meta.env.VITE_APP_API_HOST
axios.defaults.withCredentials = true; axios.defaults.withCredentials = true;
//axios.defaults.headers.post['Content-Type'] = 'application/json' //axios.defaults.headers.post['Content-Type'] = 'application/json'

View File

@ -228,7 +228,7 @@ export const replaceImg =(img) => {
if (!img.startsWith("http")) { if (!img.startsWith("http")) {
img = `${location.protocol}//${location.host}/${img}` img = `${location.protocol}//${location.host}/${img}`
} }
const devHost = process.env.VUE_APP_API_HOST const devHost = import.meta.env.VITE_APP_API_HOST
const localhost = "http://localhost:5678" const localhost = "http://localhost:5678"
if (img.includes(localhost)) { if (img.includes(localhost)) {
return img?.replace(localhost, devHost) return img?.replace(localhost, devHost)

View File

@ -175,6 +175,6 @@ const useRole = (role) => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/chat-app.styl" @import "../assets/css/chat-app.styl"
@import "@/assets/css/custom-scroll.styl" @import "../assets/css/custom-scroll.styl"
</style> </style>

View File

@ -975,7 +975,7 @@ const realtimeChat = () => {
</script> </script>
<style scoped lang="stylus"> <style scoped lang="stylus">
@import "@/assets/css/chat-plus.styl" @import "../assets/css/chat-plus.styl"
</style> </style>
<style lang="stylus"> <style lang="stylus">

View File

@ -486,6 +486,6 @@ const changeModel = (model) => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/image-dall.styl" @import "../assets/css/image-dall.styl"
@import "@/assets/css/custom-scroll.styl" @import "../assets/css/custom-scroll.styl"
</style> </style>

View File

@ -169,7 +169,7 @@ const loginUser = ref({});
const routerViewKey = ref(0); const routerViewKey = ref(0);
const showConfigDialog = ref(false); const showConfigDialog = ref(false);
const license = ref({ de_copy: true }); const license = ref({ de_copy: true });
const gitURL = ref(process.env.VUE_APP_GIT_URL); const gitURL = ref(import.meta.env.VITE_APP_GIT_URL);
const showLoginDialog = ref(false); const showLoginDialog = ref(false);
/** /**
@ -294,6 +294,6 @@ const loginSuccess = () => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/custom-scroll.styl" @import "../assets/css/custom-scroll.styl"
@import "@/assets/css/home.styl" @import "../assets/css/home.styl"
</style> </style>

View File

@ -1101,6 +1101,6 @@ const generatePrompt = () => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/image-mj.styl" @import "../assets/css/image-mj.styl"
@import "@/assets/css/custom-scroll.styl" @import "../assets/css/custom-scroll.styl"
</style> </style>

View File

@ -582,6 +582,6 @@ const generatePrompt = () => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/image-sd.styl" @import "../assets/css/image-sd.styl"
@import "@/assets/css/custom-scroll.styl" @import "../assets/css/custom-scroll.styl"
</style> </style>

View File

@ -300,6 +300,6 @@ const drawSameMj = (row) => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/images-wall.styl" @import "../assets/css/images-wall.styl"
@import "@/assets/css/custom-scroll.styl" @import "../assets/css/custom-scroll.styl"
</style> </style>

View File

@ -80,8 +80,8 @@ const slogan = ref("");
const license = ref({ de_copy: true }); const license = ref({ de_copy: true });
const isLogin = ref(false); const isLogin = ref(false);
const docsURL = ref(process.env.VUE_APP_DOCS_URL); const docsURL = ref(import.meta.env.VITE_APP_DOCS_URL);
const gitURL = ref(process.env.VUE_APP_GIT_URL); const gitURL = ref(import.meta.env.VITE_APP_GIT_URL);
const navs = ref([]); const navs = ref([]);
const iconMap = ref({ const iconMap = ref({
@ -168,5 +168,5 @@ const rainbowColor = (index) => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/index.styl" @import "../assets/css/index.styl"
</style> </style>

View File

@ -160,7 +160,7 @@ const initData = () => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/custom-scroll.styl" @import "../assets/css/custom-scroll.styl"
.page-invitation { .page-invitation {
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

@ -62,8 +62,8 @@ const enableVerify = ref(false);
const captchaRef = ref(null); const captchaRef = ref(null);
const ruleFormRef = ref(null); const ruleFormRef = ref(null);
const ruleForm = reactive({ const ruleForm = reactive({
username: process.env.VUE_APP_USER, username: import.meta.env.VITE_APP_USER,
password: process.env.VUE_APP_PASS, password: import.meta.env.VITE_APP_PASS,
}); });
const rules = { const rules = {
username: [{ required: true, trigger: "blur", message: "请输入账号" }], username: [{ required: true, trigger: "blur", message: "请输入账号" }],
@ -152,5 +152,5 @@ const doLogin = (verifyData) => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/login.styl" @import "../assets/css/login.styl"
</style> </style>

View File

@ -171,7 +171,7 @@ onUnmounted(() => {
const download = (item) => { const download = (item) => {
const url = replaceImg(item.video_url); const url = replaceImg(item.video_url);
const downloadURL = `${process.env.VUE_APP_API_HOST}/api/download?url=${url}`; const downloadURL = `${import.meta.env.VITE_APP_API_HOST}/api/download?url=${url}`;
// parse filename // parse filename
const urlObj = new URL(url); const urlObj = new URL(url);
const fileName = urlObj.pathname.split("/").pop(); const fileName = urlObj.pathname.split("/").pop();
@ -314,5 +314,5 @@ const generatePrompt = () => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/luma.styl" @import "../assets/css/luma.styl"
</style> </style>

View File

@ -291,6 +291,6 @@ const downloadImage = () => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/mark-map.styl" @import "../assets/css/mark-map.styl"
@import "@/assets/css/custom-scroll.styl" @import "../assets/css/custom-scroll.styl"
</style> </style>

View File

@ -209,11 +209,11 @@ const pay = (product, payWay) => {
} }
loading.value = true; loading.value = true;
loadingText.value = "正在生成支付订单..."; loadingText.value = "正在生成支付订单...";
let host = process.env.VUE_APP_API_HOST; let host = import.meta.env.VITE_APP_API_HOST;
if (host === "") { if (host === "") {
host = `${location.protocol}//${location.host}`; host = `${location.protocol}//${location.host}`;
} }
httpPost(`${process.env.VUE_APP_API_HOST}/api/payment/doPay`, { httpPost(`${import.meta.env.VITE_APP_API_HOST}/api/payment/doPay`, {
product_id: product.id, product_id: product.id,
pay_way: payWay.pay_way, pay_way: payWay.pay_way,
pay_type: payWay.pay_type, pay_type: payWay.pay_type,
@ -262,6 +262,6 @@ const payCallback = (success) => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/custom-scroll.styl" @import "../assets/css/custom-scroll.styl"
@import "@/assets/css/member.styl" @import "../assets/css/member.styl"
</style> </style>

View File

@ -128,7 +128,7 @@ const fetchData = () => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/custom-scroll.styl" @import "../assets/css/custom-scroll.styl"
.power-log { .power-log {
color #ffffff color #ffffff
.inner { .inner {

View File

@ -2,7 +2,7 @@
<div data-component="ConsolePage"> <div data-component="ConsolePage">
<div class="content-top"> <div class="content-top">
<div class="content-title"> <div class="content-title">
<img src="/openai-logomark.svg" alt="OpenAI Logo" /> <!-- <img src="/openai-logomark.svg" alt="OpenAI Logo" /> -->
<span>realtime console</span> <span>realtime console</span>
</div> </div>

View File

@ -231,7 +231,7 @@ const doSubmitRegister = (verifyData) => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/login.styl" @import "../assets/css/login.styl"
:deep(.back){ :deep(.back){
margin-bottom: 10px; margin-bottom: 10px;
} }

View File

@ -146,7 +146,7 @@ const save = () => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/login.styl" @import "../assets/css/login.styl"
::v-deep(.el-tabs__item.is-active, .el-tabs__item:hover){ ::v-deep(.el-tabs__item.is-active, .el-tabs__item:hover){
color: var(--common-text-color) !important; color: var(--common-text-color) !important;
} }

View File

@ -102,5 +102,5 @@ const getShareURL = (item) => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/song.styl" @import "../assets/css/song.styl"
</style> </style>

View File

@ -447,7 +447,7 @@ const merge = (item) => {
// //
const download = (item) => { const download = (item) => {
const url = replaceImg(item.audio_url); const url = replaceImg(item.audio_url);
const downloadURL = `${process.env.VUE_APP_API_HOST}/api/download?url=${url}`; const downloadURL = `${import.meta.env.VITE_APP_API_HOST}/api/download?url=${url}`;
// parse filename // parse filename
const urlObj = new URL(url); const urlObj = new URL(url);
const fileName = urlObj.pathname.split("/").pop(); const fileName = urlObj.pathname.split("/").pop();
@ -635,5 +635,5 @@ const createLyric = () => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/suno.styl" @import "../assets/css/suno.styl"
</style> </style>

View File

@ -326,7 +326,7 @@ const remove = function (row) {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/admin/form.styl"; @import "../../assets/css/admin/form.styl";
.model-list { .model-list {
.handle-box { .handle-box {

View File

@ -56,5 +56,5 @@ watch(
</script> </script>
<style scoped lang="stylus"> <style scoped lang="stylus">
@import '@/assets/css/main.styl'; @import '../../assets/css/main.styl';
</style> </style>

View File

@ -52,8 +52,8 @@ import Captcha from "@/components/Captcha.vue";
const router = useRouter(); const router = useRouter();
const title = ref("Geek-AI Console"); const title = ref("Geek-AI Console");
const username = ref(process.env.VUE_APP_ADMIN_USER); const username = ref(import.meta.env.VITE_APP_ADMIN_USER);
const password = ref(process.env.VUE_APP_ADMIN_PASS); const password = ref(import.meta.env.VITE_APP_ADMIN_PASS);
const logo = ref(""); const logo = ref("");
const enableVerify = ref(false); const enableVerify = ref(false);
const captchaRef = ref(null); const captchaRef = ref(null);

View File

@ -240,8 +240,8 @@ const uploadImg = (file) => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/admin/form.styl" @import "../../assets/css/admin/form.styl"
@import "@/assets/css/main.styl" @import "../../assets/css/main.styl"
.menu { .menu {
.handle-box { .handle-box {

View File

@ -593,8 +593,8 @@ const fixData = () => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/admin/form.styl" @import "../../assets/css/admin/form.styl"
@import "@/assets/css/main.styl" @import "../../assets/css/main.styl"
.system-config { .system-config {
display flex display flex
justify-content center justify-content center

View File

@ -262,5 +262,5 @@ const removeChat = (item) => {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import "@/assets/css/mobile/chat-list.styl" @import "../../assets/css/mobile/chat-list.styl"
</style> </style>

View File

@ -382,7 +382,7 @@ watch(
// const connect = function () { // const connect = function () {
// // WebSocket // // WebSocket
// const _sessionId = getSessionId(); // const _sessionId = getSessionId();
// let host = process.env.VUE_APP_WS_HOST // let host = import.meta.env.VITE_APP_WS_HOST
// if (host === '') { // if (host === '') {
// if (location.protocol === 'https:') { // if (location.protocol === 'https:') {
// host = 'wss://' + location.host; // host = 'wss://' + location.host;
@ -634,5 +634,5 @@ const getModelName = (model_id) => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/mobile/chat-session.styl" @import "../../assets/css/mobile/chat-session.styl"
</style> </style>

View File

@ -74,7 +74,7 @@ import { arrayContains, removeArrayItem, showLoginDialog, substr } from "@/utils
import { showNotify } from "vant"; import { showNotify } from "vant";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
const title = ref(process.env.VUE_APP_TITLE); const title = ref(import.meta.env.VITE_APP_TITLE);
const router = useRouter(); const router = useRouter();
const isLogin = ref(false); const isLogin = ref(false);
const apps = ref([]); const apps = ref([]);

View File

@ -284,11 +284,11 @@ const pay = (product, payWay) => {
message: "正在创建订单", message: "正在创建订单",
forbidClick: true, forbidClick: true,
}); });
let host = process.env.VUE_APP_API_HOST; let host = import.meta.env.VITE_APP_API_HOST;
if (host === "") { if (host === "") {
host = `${location.protocol}//${location.host}`; host = `${location.protocol}//${location.host}`;
} }
httpPost(`${process.env.VUE_APP_API_HOST}/api/payment/doPay`, { httpPost(`${import.meta.env.VITE_APP_API_HOST}/api/payment/doPay`, {
product_id: product.id, product_id: product.id,
pay_way: payWay.pay_way, pay_way: payWay.pay_way,
pay_type: payWay.pay_type, pay_type: payWay.pay_type,

View File

@ -435,5 +435,5 @@ const modelConfirm = (item) => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/mobile/image-sd.styl" @import "../../../assets/css/mobile/image-sd.styl"
</style> </style>

View File

@ -603,5 +603,5 @@ const tabChange = (tab) => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/mobile/image-mj.styl" @import "../../../assets/css/mobile/image-mj.styl"
</style> </style>

View File

@ -467,5 +467,5 @@ const showInfo = (message) => {
</script> </script>
<style lang="stylus"> <style lang="stylus">
@import "@/assets/css/mobile/image-sd.styl" @import "../../../assets/css/mobile/image-sd.styl"
</style> </style>

53
web/vite.config.js Normal file
View File

@ -0,0 +1,53 @@
import { defineConfig, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
console.log('VITE_API_HOST from .env:', env);
return {
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
css: {
preprocessorOptions: {
stylus: {
paths: [path.resolve(__dirname, 'src')],
},
},
},
build: {
sourcemap: false,
minify: 'terser',
rollupOptions: {
output: {
manualChunks: {
vendor: ['vue', 'vue-router', 'pinia'],
},
},
},
},
server: {
port: 8888,
host: true,
proxy: {
'/api': {
target: env.VITE_APP_API_HOST,
changeOrigin: true,
},
'/static/upload/': {
target: env.VITE_APP_API_HOST,
changeOrigin: true,
},
},
},
esbuild: {
// 模拟 transpileDependencies: true
},
};
});

View File

@ -1,36 +0,0 @@
const { defineConfig } = require("@vue/cli-service");
const path = require("path");
let webpack = require("webpack");
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false, //关闭eslint校验
productionSourceMap: false, //在生产模式中禁用 Source Map既可以减少包大小也可以加密源码
configureWebpack: {
// disable performance hints
performance: {
hints: false,
},
plugins: [new webpack.optimize.MinChunkSizePlugin({ minChunkSize: 10000 })],
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
},
publicPath: "/",
outputDir: "dist",
crossorigin: "anonymous",
devServer: {
allowedHosts: "all",
port: 8888,
proxy: {
"/static/upload/": {
target: process.env.VUE_APP_API_HOST,
changeOrigin: true,
},
},
},
});