From 7036c1fc02469bda2b51a007d53403bff1847912 Mon Sep 17 00:00:00 2001 From: ktianc Date: Sat, 2 Mar 2024 19:53:24 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=BC=82=E6=AD=A5=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=96=87=E4=BB=B6=E5=88=B0=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kinit-api/utils/file/file_manage.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/kinit-api/utils/file/file_manage.py b/kinit-api/utils/file/file_manage.py index 83043de..6b49096 100644 --- a/kinit-api/utils/file/file_manage.py +++ b/kinit-api/utils/file/file_manage.py @@ -63,19 +63,21 @@ async def save_video_local(self, accept: list = None) -> dict: async def async_save_local(self) -> dict: """ 保存文件到本地 - :return: + :return: 示例: + { + 'local_path': 'D:\\project\\kinit_dev\\kinit-api\\static\\system\\20240301\\1709303205HuYB3mrC.png', + 'remote_path': '/media/system/20240301/1709303205HuYB3mrC.png' + } """ - path = self.path + path = AsyncPath(self.path) if sys.platform == "win32": - path = self.path.replace("/", "\\") - save_path = AsyncPath(STATIC_ROOT) / path - if not await save_path.parent.exists(): - await save_path.parent.mkdir(parents=True, exist_ok=True) - await save_path.write_bytes(await self.file.read()) - remote_path = path.replace(STATIC_ROOT, '').replace("\\", '/') + path = AsyncPath(self.path.replace("/", "\\")) + if not await path.parent.exists(): + await path.parent.mkdir(parents=True, exist_ok=True) + await path.write_bytes(await self.file.read()) return { - "local_path": path, - "remote_path": f"{STATIC_URL}/{remote_path}" + "local_path": str(path), + "remote_path": STATIC_URL + str(path).replace(STATIC_ROOT, '').replace("\\", '/') } @classmethod From f8c748a15a3712afb0b1afa0eee71eaf8cdfae17 Mon Sep 17 00:00:00 2001 From: ktianc Date: Sat, 2 Mar 2024 19:54:31 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/Vadmin/System/Settings/components/Basic.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kinit-admin/src/views/Vadmin/System/Settings/components/Basic.vue b/kinit-admin/src/views/Vadmin/System/Settings/components/Basic.vue index a00d848..183c6ec 100644 --- a/kinit-admin/src/views/Vadmin/System/Settings/components/Basic.vue +++ b/kinit-admin/src/views/Vadmin/System/Settings/components/Basic.vue @@ -149,7 +149,7 @@ const formSchema = reactive([ show-file-list={false} before-upload={beforeImageUpload} on-success={handleUploadSuccess} - accept="image/jpeg,image/gif,image/png" + accept="image/x-icon" name="file" headers={{ Authorization: token }} > @@ -259,10 +259,10 @@ const save = async () => { try { const res = await putSystemSettingsApi(formData) if (res) { - appStore.setTitle(res.data.web_title || import.meta.env.VITE_APP_TITLE) - appStore.setLogoImage(res.data.web_logo || '/static/system/logo.png') - appStore.setFooterContent(res.data.web_copyright || 'Copyright ©2022-present K') - appStore.setIcpNumber(res.data.web_icp_number || '') + appStore.setTitle(formData.web_title || import.meta.env.VITE_APP_TITLE) + appStore.setLogoImage(formData.web_logo || '/media/system/logo.png') + appStore.setFooterContent(formData.web_copyright || 'Copyright ©2022-present K') + appStore.setIcpNumber(formData.web_icp_number || '') return ElMessage.success('更新成功') } } finally { From 5053d59f62ff2c5153edf60ce182a9f18dac8581 Mon Sep 17 00:00:00 2001 From: ktianc Date: Sat, 2 Mar 2024 19:55:23 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kinit-admin/.gitignore | 2 ++ kinit-admin/.vscode/extensions.json | 3 --- kinit-admin/.vscode/settings.json | 19 ------------------- .../src/components/Footer/src/Footer.vue | 4 ++-- kinit-admin/src/views/Login/Login.vue | 9 +++++++++ 5 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 kinit-admin/.vscode/extensions.json delete mode 100644 kinit-admin/.vscode/settings.json diff --git a/kinit-admin/.gitignore b/kinit-admin/.gitignore index c18fb3c..0ef2890 100644 --- a/kinit-admin/.gitignore +++ b/kinit-admin/.gitignore @@ -5,3 +5,5 @@ dist-ssr *-lock.* pnpm-debug stats.html +dist-pro +.vscode diff --git a/kinit-admin/.vscode/extensions.json b/kinit-admin/.vscode/extensions.json deleted file mode 100644 index 62a1b22..0000000 --- a/kinit-admin/.vscode/extensions.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "recommendations": ["vue.volar", "lokalise.i18n-ally"] -} diff --git a/kinit-admin/.vscode/settings.json b/kinit-admin/.vscode/settings.json deleted file mode 100644 index 9f03929..0000000 --- a/kinit-admin/.vscode/settings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "typescript.tsdk": "node_modules/typescript/lib", - "prettier.enable": false, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - }, - "[vue]": { - "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" - }, - "i18n-ally.localesPaths": ["src/locales"], - "i18n-ally.keystyle": "nested", - "i18n-ally.sortKeys": true, - "i18n-ally.namespace": false, - "i18n-ally.enabledParsers": ["ts"], - "i18n-ally.sourceLanguage": "zh-CN", - "i18n-ally.displayLanguage": "zh-CN", - "i18n-ally.enabledFrameworks": ["vue", "react"], - "god.tsconfig": "./tsconfig.json" -} diff --git a/kinit-admin/src/components/Footer/src/Footer.vue b/kinit-admin/src/components/Footer/src/Footer.vue index c725e4b..f4569ad 100644 --- a/kinit-admin/src/components/Footer/src/Footer.vue +++ b/kinit-admin/src/components/Footer/src/Footer.vue @@ -9,7 +9,7 @@ const prefixCls = getPrefixCls('footer') const appStore = useAppStore() -const title = computed(() => appStore.getTitle) +const footerContent = computed(() => appStore.getFooterContent) diff --git a/kinit-admin/src/views/Login/Login.vue b/kinit-admin/src/views/Login/Login.vue index e00058a..52e5d43 100644 --- a/kinit-admin/src/views/Login/Login.vue +++ b/kinit-admin/src/views/Login/Login.vue @@ -9,6 +9,7 @@ import { useDesign } from '@/hooks/web/useDesign' import { ref } from 'vue' import { ElScrollbar } from 'element-plus' import { computed } from 'vue' +import { ElButton } from 'element-plus' const { getPrefixCls } = useDesign() @@ -28,6 +29,11 @@ const toTelephoneLogin = () => { const toPasswordLogin = () => { isPasswordLogin.value = true } + +const icpNumber = computed(() => appStore.getIcpNumber) +const toICO = () => { + window.open('https://beian.miit.gov.cn/#/Integrated/index') +}