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