diff --git a/.env b/.env index d407df6..f5d8333 100644 --- a/.env +++ b/.env @@ -1,3 +1,9 @@ -VITE_TITLE = 'Vue Naive Admin' +VITE_TITLE = '捷兑通 - 平台端' -VITE_PORT = 3100 +VITE_PORT = 4000 + +VITE_WS_URL = 'www.wanzhuanyongcheng.cn/admin/data' + +VITE_WS1_URL = 'www.jdt168.com/dice/home' + +VITE_GAME_API = 'https://www.jdt168.com' \ No newline at end of file diff --git a/.env.development b/.env.development index 9feaca6..39ce38e 100644 --- a/.env.development +++ b/.env.development @@ -2,10 +2,10 @@ VITE_PUBLIC_PATH = '/' # 是否启用MOCK -VITE_USE_MOCK = true +VITE_USE_MOCK = false -# 是否启用MOCK +# 是否启用代理 VITE_USE_PROXY = true # base api -VITE_BASE_API = '/api' +VITE_BASE_API = '/admin' diff --git a/.env.production b/.env.production index 67c17e2..ce6a786 100644 --- a/.env.production +++ b/.env.production @@ -1,11 +1,13 @@ # 资源公共路径,需要以 /开头和结尾 -VITE_PUBLIC_PATH = '/' +VITE_PUBLIC_PATH = '/static/admin' # 是否启用MOCK -VITE_USE_MOCK = true +VITE_USE_MOCK = false # base api -VITE_BASE_API = '/api' +VITE_BASE_API = 'https://www.wanzhuanyongcheng.cn/admin' + +# VITE_GAME_API = 'http://www.wanzhuanyongcheng.cn/admin' # 是否启用压缩 VITE_USE_COMPRESS = true diff --git a/build/constant.js b/build/constant.js index e63072c..29ef842 100644 --- a/build/constant.js +++ b/build/constant.js @@ -6,28 +6,28 @@ export const PROXY_CONFIG = { * @请求路径 http://localhost:3100/api/user * @转发路径 http://localhost:8080/user */ - '/api': { - target: 'http://localhost:8080', + '/admin': { + target: 'https://www.wanzhuanyongcheng.cn', changeOrigin: true, - rewrite: (path) => path.replace(new RegExp('^/api'), ''), + // rewrite: (path) => path.replace(new RegExp('^/api'), ''), }, /** * @desc 不替换匹配值 * @请求路径 http://localhost:3100/api/v2/user * @转发路径 http://localhost:8080/api/v2/user */ - '/api/v2': { - target: 'http://localhost:8080', - changeOrigin: true, - }, + // '/api/v2': { + // target: 'http://localhost:8080', + // changeOrigin: true, + // }, /** * @desc 替换部分匹配值 * @请求路径 http://localhost:3100/api/v3/user * @转发路径 http://localhost:8080/user */ - '/api/v3': { - target: 'http://localhost:8080', - changeOrigin: true, - rewrite: (path) => path.replace(new RegExp('^/api'), ''), - }, + // '/api/v3': { + // target: 'http://localhost:8080', + // changeOrigin: true, + // rewrite: (path) => path.replace(new RegExp('^/api'), ''), + // }, } diff --git a/settings/theme.json b/settings/theme.json index add0a7e..d611894 100644 --- a/settings/theme.json +++ b/settings/theme.json @@ -8,7 +8,7 @@ }, "naiveThemeOverrides": { "common": { - "primaryColor": "#316C72FF", + "primaryColor": "#409EFFE3", "primaryColorHover": "#316C72E3", "primaryColorPressed": "#2B4C59FF", "primaryColorSuppl": "#316C72E3", diff --git a/src/components/Upload.vue b/src/components/Upload.vue new file mode 100644 index 0000000..12c935e --- /dev/null +++ b/src/components/Upload.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/src/components/page/AppPage.vue b/src/components/page/AppPage.vue index 9e30448..56df81a 100644 --- a/src/components/page/AppPage.vue +++ b/src/components/page/AppPage.vue @@ -2,7 +2,7 @@
- +
diff --git a/src/hooks/useScript.js b/src/hooks/useScript.js new file mode 100644 index 0000000..73d5ec6 --- /dev/null +++ b/src/hooks/useScript.js @@ -0,0 +1,43 @@ +import { onMounted, onUnmounted, ref } from 'vue' + +export function useScript(opts) { + const isLoading = ref(false) + const error = ref(false) + const success = ref(false) + let script + + const promise = new Promise((resolve, reject) => { + onMounted(() => { + script = document.createElement('script') + script.type = 'text/javascript' + script.charset = 'utf-8' + script.onload = function () { + isLoading.value = false + success.value = true + error.value = false + resolve('') + } + + script.onerror = function (err) { + isLoading.value = false + success.value = false + error.value = true + reject(err) + } + + script.src = opts.src + document.head.appendChild(script) + }) + }) + + onUnmounted(() => { + script && script.remove() + }) + + return { + isLoading, + error, + success, + toPromise: () => promise, + } +} diff --git a/src/layout/components/header/index.vue b/src/layout/components/header/index.vue index 571ab26..4f8c0c0 100644 --- a/src/layout/components/header/index.vue +++ b/src/layout/components/header/index.vue @@ -4,9 +4,9 @@