From c0007c33dc8bc32a55f479a3a4ff47db59332e31 Mon Sep 17 00:00:00 2001 From: Gap Zhang Date: Wed, 17 Apr 2024 17:55:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20lodash=20?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E4=B8=BA=20lodash-es=20=E5=90=8E=E9=81=97?= =?UTF-8?q?=E6=BC=8F=E7=9A=84=E9=94=99=E8=AF=AF=E4=BB=A3=E7=A0=81=20(#2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pnpm-lock.yaml | 2 +- src/hooks/app/useFormCurd.ts | 2 +- src/hooks/modules/useForm.ts | 4 ++-- src/utils/index.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3826e23..e45dc53 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6354,4 +6354,4 @@ packages: resolution: {integrity: sha512-O3MilSi/9mwoovx77m6ROZM7sXShR/O/JIanvzTwjN3FORfLSr81PsUGd7jlaYOeds9d8tw82oP44+3YucVo+w==} dependencies: tslib: 2.3.0 - dev: false + dev: false \ No newline at end of file diff --git a/src/hooks/app/useFormCurd.ts b/src/hooks/app/useFormCurd.ts index f6dd6d5..b96ef4c 100644 --- a/src/hooks/app/useFormCurd.ts +++ b/src/hooks/app/useFormCurd.ts @@ -1,7 +1,7 @@ import { reactive, computed, ref, type Ref } from 'vue' import { useRoute, useRouter } from 'vue-router' import { Modal, Message, type FormInstance } from '@arco-design/web-vue' -import { isEqual } from 'lodash' +import { isEqual } from 'lodash-es' type Option = { key?: string diff --git a/src/hooks/modules/useForm.ts b/src/hooks/modules/useForm.ts index 5c1728a..fbf2ac5 100644 --- a/src/hooks/modules/useForm.ts +++ b/src/hooks/modules/useForm.ts @@ -1,8 +1,8 @@ import { reactive } from 'vue' -import _ from 'lodash' +import { cloneDeep } from 'lodash-es' export function useForm(initValue: F) { - const getInitValue = () => _.cloneDeep(initValue) + const getInitValue = () => cloneDeep(initValue) const form = reactive(getInitValue()) diff --git a/src/utils/index.ts b/src/utils/index.ts index d7dfcc6..6262d31 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,6 +1,6 @@ import { isExternal } from '@/utils/validate' import { browse, mapTree } from 'xe-utils' -import _ from 'lodash' +import { upperFirst, camelCase } from 'lodash-es' import { Message } from '@arco-design/web-vue' export function getProperty(obj: T, key: K): T[K] { @@ -184,7 +184,7 @@ export const randomHex = () => { export const transformPathToName = (path: string) => { if (!path) return '' if (isExternal(path)) return '' - return _.upperFirst(_.camelCase(path)) + return upperFirst(camelCase(path)) } /** From 287c667d6815e3263d12fa1541d9270890892328 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Wed, 17 Apr 2024 21:04:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2=E5=85=B6=E4=BB=96=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/auth/index.ts | 5 +++ src/apis/auth/type.ts | 5 +++ src/views/home/components/WorkCard.vue | 1 - src/views/login/index.vue | 44 ++++++++++++++++++++++++-- 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/apis/auth/index.ts b/src/apis/auth/index.ts index e600191..399c8a3 100644 --- a/src/apis/auth/index.ts +++ b/src/apis/auth/index.ts @@ -22,3 +22,8 @@ export const getUserInfo = () => { export const getUserRoute = () => { return http.get(`${BASE_URL}/route`) } + +/** @desc 第三方登录授权 */ +export function socialAuth(source: string) { + return http.get(`/oauth/${source}`) +} \ No newline at end of file diff --git a/src/apis/auth/type.ts b/src/apis/auth/type.ts index 05b29f4..1ef2cd3 100644 --- a/src/apis/auth/type.ts +++ b/src/apis/auth/type.ts @@ -51,3 +51,8 @@ export interface AccountLoginReq { export interface LoginResp { token: string } + +// 第三方登录授权类型 +export interface SocialAuthAuthorizeResp { + authorizeUrl: string; +} \ No newline at end of file diff --git a/src/views/home/components/WorkCard.vue b/src/views/home/components/WorkCard.vue index 90a0a8e..f64cd4b 100644 --- a/src/views/home/components/WorkCard.vue +++ b/src/views/home/components/WorkCard.vue @@ -39,7 +39,6 @@ const userStore = useUserStore() } .card { - margin-top: $margin; .content { padding: 8px 20px; .welcome { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 0bf8de9..896e916 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -50,13 +50,24 @@ 登录 + - - + + + + + +## Issue 类型 + +- [ ] 缺陷报告(Bug) +- [ ] 需求建议(Feature) + +## Issue 描述 + + + +## 复现步骤(如果是提交 Feature Issue,请删除本项) + + + +## 预期结果(如果是提交 Feature Issue,请删除本项) + + + +## 环境信息(如果是提交 Feature Issue,请删除本项) + + + +## 解决方案(如果是提交 Bug Issue,请删除本项) + + + +## 替代方案(如果是提交 Bug Issue,请删除本项) + + + +## 额外补充 + + + + +## 提交前确认 + + + +- [ ] 阅读[文档](https://doc.charles7c.top/admin/other/faq.html) +- [ ] 搜索是否有其他人提交过类似的 issue,如果对应 issue 尚未解决,您可以先订阅关注该 issue(为了方便后来者查找问题解决方法,请尽量避免创建重复的 issue) \ No newline at end of file diff --git a/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md new file mode 100644 index 0000000..1d7cdfa --- /dev/null +++ b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md @@ -0,0 +1,53 @@ + + + + +## PR 类型 + + + + +- [ ] 新 feature +- [ ] Bug 修复 +- [ ] 功能增强 +- [ ] 文档变更 +- [ ] 代码样式变更 +- [ ] 重构 +- [ ] 性能改进 +- [ ] 单元测试 +- [ ] CI/CD +- [ ] 其他 + +## PR 目的 + + + +## 解决方案 + + + +## PR 测试 + + + + +## Changelog + +| 模块 | Changelog | Related issues | +|-----|-----------| -------------- | +| | | | + + + + +## 其他信息 + + + +## 提交前确认 + +- [ ] PR 代码经过了完整测试,并且通过了代码规范检查 +- [ ] 已经完整填写 Changelog,并链接到了相关 issues +- [ ] PR 代码将要提交到 dev 分支 \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..b1187c4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,57 @@ +name: "\U0001F41E Bug 报告" +description: Create a report to help us improve +labels: ['bug: pending triage'] +body: + - type: markdown + attributes: + value: | + 感谢您使用 ContiNew Admin!请您花些时间填写这份 Bug 报告。 + - type: textarea + id: bug-description + attributes: + label: Bug 描述 + description: 清楚而简洁地描述您遇到的 Bug。另外,非常欢迎您对此 Bug 提交 PR。 + placeholder: 例如:在使用 xxx 功能时出现异常 + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: 复现步骤 + description: 条理清晰的步骤或演示视频可以帮助快速定位问题。 + placeholder: 例如:1、xxx; 2、xxx; + validations: + required: true + - type: textarea + id: expected + attributes: + label: 预期结果 + description: 清楚而简洁地描述您期望的结果。 + placeholder: 预期结果 + validations: + required: true + - type: textarea + id: environment-info + attributes: + label: 环境信息 + description: 描述清楚您所使用的相关环境,例如:Node 版本:xxxx;框架版本:v1.0.0;其他可能与该 issue 相关的依赖版本。 + placeholder: Node 版本, 框架版本等 + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: 额外补充 + description: 添加您的完整报错信息或屏幕截图,以及一切能帮助定位问题的信息。 + - type: checkboxes + id: checkboxes + attributes: + label: 确认 + description: 在提交 issue 之前,请确保执行过以下操作。 + options: + - label: 阅读[文档](https://doc.charles7c.top/admin/other/faq.html) + required: true + - label: 根据报错信息百度或 Google 一下 + required: true + - label: 搜索是否有其他人提交过类似的 issue,如果对应 issue 尚未解决,您可以先订阅关注该 issue(为了方便后来者查找问题解决方法,请尽量避免创建重复的 issue) + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..1d3b258 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,42 @@ +name: "\U0001F680 新 Feature 建议" +description: Suggest an idea for this project +body: + - type: markdown + attributes: + value: | + 感谢您使用 ContiNew Admin!请您花些时间填写这份 Feature 调查。 + - type: textarea + id: feature-description + attributes: + label: Feature 描述 + description: 清楚而简洁地描述您的 Feature。另外,非常欢迎您对此 Feature 提交 PR。 + placeholder: 例如:我希望增加 xxx 功能;现有的 xxx 功能不好用... + validations: + required: true + - type: textarea + id: suggested-solution + attributes: + label: 描述一下您想要的解决方案 + description: 清楚而简洁地描述您想要的解决方案。 + validations: + required: true + - type: textarea + id: alternative + attributes: + label: 描述一下您考虑过的替代方案 + description: 清楚而简洁地描述您考虑过的任何替代解决方案或功能。 + - type: textarea + id: additional-context + attributes: + label: 额外补充 + description: 添加您在其他框架或场景遇见的效果截图或链接,以及一切能帮助理解 Feature 的信息。 + - type: checkboxes + id: checkboxes + attributes: + label: 确认 + description: 在提交 issue 之前,请确保执行过以下操作。 + options: + - label: 阅读[文档](https://doc.charles7c.top/admin/intro/require.html) + required: true + - label: 搜索是否有其他人提交过类似的 issue,如果对应 issue 尚未解决,您可以先订阅关注该 issue(为了方便后来者查找问题解决方法,请尽量避免创建重复的 issue) + required: true \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..e0fe589 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,53 @@ + + + + +## PR 类型 + + + + +- [ ] 新 feature +- [ ] Bug 修复 +- [ ] 功能增强 +- [ ] 文档变更 +- [ ] 代码样式变更 +- [ ] 重构 +- [ ] 性能改进 +- [ ] 单元测试 +- [ ] CI/CD +- [ ] 其他 + +## PR 目的 + + + +## 解决方案 + + + +## PR 测试 + + + + +## Changelog + +| 模块 | Changelog | Related issues | +|-----|-----------| -------------- | +| | | | + + + + +## 其他信息 + + + +## 提交前确认 + +- [ ] PR 代码经过了完整测试,并且通过了代码规范检查 +- [ ] 已经完整填写 Changelog,并链接到了相关 issues +- [ ] PR 代码将要提交到 dev 分支 \ No newline at end of file