diff --git a/.env.example b/.env.example index 2d4a58a..eeecc31 100644 --- a/.env.example +++ b/.env.example @@ -4,13 +4,6 @@ APP_KEY=base64:q3NPkuRVhdHFRkVskaqQatUEs+fXcFVgJNiDtE9nSAA= APP_DEBUG=true APP_URL=http://127.0.0.1:8000 -GATEWAY_PORT=4000 -GATEWAY_REGISTER=4001 -GATEWAY_START=4002 -GATEWAY_PING='{"action":"ping"}' -GATEWAY_PANG='{"action":"pang"}' -GATEWAY_CLOSE=/api/Gateway/close - REQUEST_LOG=true TIMEZONE=Asia/Shanghai diff --git a/admin/src/pages/login.vue b/admin/src/pages/login.vue index 81a856f..2941643 100644 --- a/admin/src/pages/login.vue +++ b/admin/src/pages/login.vue @@ -44,7 +44,7 @@ const routerChange = (query) => { f: query.f || default_page_options.f, m: Number(query.m) || default_page_options.m, } - if (page_options.value.m === 1) apiManaShow() + if (page_options.value.m === 1) proxyManaShow() } const getCaptchaCreate = (reload = true) => { if (login_type_active.value === 'password') { @@ -128,65 +128,65 @@ const AdminQuit = async () => { } }) } -const api_list = ref([]) -const api_mana_show = ref(false) -const apiManaShow = () => { - api_list.value = JSON.parse(JSON.stringify($config.value.api.url)) - api_mana_show.value = true +const proxy_list = ref([]) +const proxy_mana_show = ref(false) +const proxyManaShow = () => { + proxy_list.value = JSON.parse(JSON.stringify($config.value.api.url)) + proxy_mana_show.value = true } -const add_api_data = ref({ +const add_proxy_data = ref({ name: '', url: '', active: false }) const addApiClick = () => { - if (!add_api_data.value.name) return window.$message().error('请输入名称') - if (!add_api_data.value.url) return window.$message().error('请输入接口地址') - if (add_api_data.value.url.indexOf('http') !== 0) return window.$message().error('请输入正确的接口地址') - if (add_api_data.value.active) { - api_list.value.forEach((item) => { + if (!add_proxy_data.value.name) return window.$message().error('请输入名称') + if (!add_proxy_data.value.url) return window.$message().error('请输入接口地址') + if (add_proxy_data.value.url.indexOf('http') !== 0) return window.$message().error('请输入正确的接口地址') + if (add_proxy_data.value.active) { + proxy_list.value.forEach((item) => { item.active = false }) } - api_list.value.unshift(JSON.parse(JSON.stringify(add_api_data.value))) - add_api_data.value = { + proxy_list.value.unshift(JSON.parse(JSON.stringify(add_proxy_data.value))) + add_proxy_data.value = { name: '', url: '', active: false } } -const apiDelClick = (k) => { - if (api_list.length === 1) return - let active = api_list.value[k] - api_list.value.splice(k, 1) +const proxyDelClick = (k) => { + if (proxy_list.length === 1) return + let active = proxy_list.value[k] + proxy_list.value.splice(k, 1) if (!!active) { - api_list.value[0].active = true + proxy_list.value[0].active = true } } -const apiActiveChange = (e, k) => { +const proxyActiveChange = (e, k) => { if (!!e) { - api_list.value.forEach((item) => { + proxy_list.value.forEach((item) => { item.active = false }) - api_list.value[k].active = true + proxy_list.value[k].active = true } else { - api_list.value[k].active = false - api_list.value[0].active = true + proxy_list.value[k].active = false + proxy_list.value[0].active = true } } -const apiSaveClick = () => { +const proxySaveClick = () => { const active_item = $config.value.api.url.filter((item) => { return item.active }) - const change_item = api_list.value.filter((item) => { + const change_item = proxy_list.value.filter((item) => { return item.active }) - $config.value.api.url = JSON.parse(JSON.stringify(api_list.value)) - api_mana_show.value = false + $config.value.api.url = JSON.parse(JSON.stringify(proxy_list.value)) + proxy_mana_show.value = false if (change_item[0].url !== active_item[0].url) { if (page_options.value.m === 1) { window.location.href = '/#/login' @@ -197,7 +197,7 @@ const apiSaveClick = () => { } } -const apiResetClick = () => { +const proxyResetClick = () => { window.$box.confirm( '确定要重置代理配置吗?', '提示', @@ -239,12 +239,6 @@ const apiResetClick = () => { size="small">密码登录 -
|
- |
- |
- |
@@ -354,20 +329,20 @@ const apiResetClick = () => {
|
|
- |
- |
- |
-
-
diff --git a/zero/src/api/index.js b/zero/src/api/index.js
deleted file mode 100644
index cdb4e6a..0000000
--- a/zero/src/api/index.js
+++ /dev/null
@@ -1,55 +0,0 @@
-import {$post} from '~/tool/axios'
-import {useConfig, useSessionToken, useSaveTokenType, useToken} from "~/store";
-
-const $save_token_type = useSaveTokenType()
-const $config = useConfig()
-const app_name = 'Zero'
-let url = ''
-const urlPick = () => {
- if ($config.value.api.url.length > 0) {
- url = $config.value.api.url[0].url
- for (let i in $config.value.api.url) {
- if (!!$config.value.api.url[i].active) {
- url = $config.value.api.url[i].url
- break
- }
- }
- }
-}
-urlPick()
-export const ConfigGetAction = async (data) => await $post({
- url: `${url}/api/${app_name}/Config/get?client=user`,
- data
-}, true)
-export const yo = async (data) => await $post({url: `${url}/api/yo`, data}, true)
-export const $headers = () => {
- let $token
- if ($save_token_type.value === 'local') {
- $token = useToken()
- } else {
- $token = useSessionToken()
- }
- return {
- 'Authorization': 'Bearer ' + $token.value
- }
-}
-export const $image = (path) => {
- const path_ret = ['http://', 'https://', ';base64,']
- for (let i = 0; i < path_ret.length; i++) {
- if (path.indexOf(path_ret[i]) !== -1) {
- return path
- }
- }
- return `${url}${path}`
-}
-export const $base64 = async (file) => {
- let reader = new FileReader()
- reader.readAsDataURL(file)
- return await new Promise(resolve => (reader.onloadend = () => resolve(reader.result)))
-}
-export const $response = (res, then, next = false) => {
- if (res) {
- if (res.code !== $config.value.api.success_code) return window.$message().error(res.message)
- then()
- }
-}
diff --git a/zero/src/components/Icon.vue b/zero/src/components/Icon.vue
deleted file mode 100644
index 9ca278a..0000000
--- a/zero/src/components/Icon.vue
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
+
@@ -397,20 +372,20 @@ const apiResetClick = () => {
-
-
-
diff --git a/zero/src/layouts/none.vue b/zero/src/layouts/none.vue
deleted file mode 100644
index f4edaf1..0000000
--- a/zero/src/layouts/none.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
-
- 404
- 未找到页面
-
-
-
- YO {{ $config.title }}
-
-
-
- |