feat: 配置代码优化
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
NODE_ENV = development
|
||||
|
||||
VITE_API_BASE_URL = https://onefeel.brother7.cn/ingress
|
||||
VITE_BASE_URL = https://onefeel.brother7.cn/ingress
|
||||
|
||||
VITE_WSS_URL = wss://onefeel.brother7.cn/ingress/agent/ws/chat
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
NODE_ENV = production
|
||||
|
||||
VITE_API_BASE_URL = https://onefeel.brother7.cn/ingress
|
||||
VITE_BASE_URL = https://onefeel.brother7.cn/ingress
|
||||
|
||||
VITE_WSS_URL = wss://onefeel.brother7.cn/ingress/agent/ws/chat
|
||||
@@ -1,5 +1,5 @@
|
||||
NODE_ENV = staging
|
||||
|
||||
VITE_API_BASE_URL = https://onefeel.brother7.cn/ingress
|
||||
VITE_BASE_URL = https://onefeel.brother7.cn/ingress
|
||||
|
||||
VITE_WSS_URL = wss://onefeel.brother7.cn/ingress/agent/ws/chat
|
||||
@@ -15,7 +15,7 @@
|
||||
"dev:mp-lark": "uni -p mp-lark",
|
||||
"dev:mp-qq": "uni -p mp-qq",
|
||||
"dev:mp-toutiao": "uni -p mp-toutiao",
|
||||
"dev:mp-weixin": "uni -p mp-weixin",
|
||||
"dev:mp-weixin": "uni -p mp-weixin --mode development",
|
||||
"dev:mp-xhs": "uni -p mp-xhs",
|
||||
"dev:quickapp-webview": "uni -p quickapp-webview",
|
||||
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
|
||||
@@ -33,7 +33,7 @@
|
||||
"build:mp-lark": "uni build -p mp-lark",
|
||||
"build:mp-qq": "uni build -p mp-qq",
|
||||
"build:mp-toutiao": "uni build -p mp-toutiao",
|
||||
"build:mp-weixin": "uni build -p mp-weixin",
|
||||
"build:mp-weixin": "uni build -p mp-weixin --mode production",
|
||||
"build:mp-xhs": "uni build -p mp-xhs",
|
||||
"build:quickapp-webview": "uni build -p quickapp-webview",
|
||||
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
||||
@@ -54,6 +54,7 @@
|
||||
"@dcloudio/uni-mp-weixin": "3.0.0-4000720240327002",
|
||||
"@dcloudio/uni-mp-xhs": "3.0.0-4000720240327002",
|
||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4000720240327002",
|
||||
"md5-hash": "^1.0.1",
|
||||
"pinia-plugin-unistorage": "^0.1.2",
|
||||
"vue": "^3.4.21",
|
||||
"vue-i18n": "^9.1.9"
|
||||
@@ -64,8 +65,8 @@
|
||||
"@dcloudio/uni-cli-shared": "3.0.0-4000720240327002",
|
||||
"@dcloudio/uni-stacktracey": "3.0.0-4000720240327002",
|
||||
"@dcloudio/vite-plugin-uni": "3.0.0-4000720240327002",
|
||||
"@vue/tsconfig": "^0.1.3",
|
||||
"@vue/runtime-core": "^3.4.21",
|
||||
"@vue/tsconfig": "^0.1.3",
|
||||
"vite": "5.2.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ const defaultConfig = {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
};
|
||||
|
||||
const BASE_URL = import.meta.env.VITE_BASE_URL;
|
||||
console.log(import.meta.env);
|
||||
|
||||
function request(url, args = {}, method = "POST", customConfig = {}) {
|
||||
// 判断 url 是否以 http 开头
|
||||
|
||||
@@ -2,11 +2,17 @@ import { defineStore } from "pinia";
|
||||
|
||||
export const useAppStore = defineStore("app", {
|
||||
state() {
|
||||
return {};
|
||||
return {
|
||||
title: "",
|
||||
};
|
||||
},
|
||||
getters: {},
|
||||
|
||||
actions: {},
|
||||
actions: {
|
||||
setData(data) {
|
||||
this.title = data;
|
||||
},
|
||||
},
|
||||
|
||||
unistorage: true,
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { defineConfig } from "vite";
|
||||
import uni from "@dcloudio/vite-plugin-uni";
|
||||
import md5 from "md5-hash";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@@ -8,9 +9,9 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
output: {
|
||||
assetFileNames(d) {
|
||||
// const baseName = d.name.replace(/\\/g, "/").split("/").pop();
|
||||
// const newName = md5(baseName) + ".[hash].[extname]";
|
||||
// return `assets/${newName}`;
|
||||
const baseName = d.name.replace(/\\/g, "/").split("/").pop();
|
||||
const newName = md5(baseName) + ".[hash].[extname]";
|
||||
return `assets/${newName}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user