diff --git a/packages/global/common/system/types/index.d.ts b/packages/global/common/system/types/index.d.ts index ffb18eeb025e..a2647fd2bfb9 100644 --- a/packages/global/common/system/types/index.d.ts +++ b/packages/global/common/system/types/index.d.ts @@ -56,6 +56,7 @@ export type FastGPTFeConfigsType = { github?: string; google?: string; wechat?: string; + microsoft?: string; }; limit?: { exportDatasetLimitMinutes?: number; diff --git a/packages/global/support/user/constant.ts b/packages/global/support/user/constant.ts index 332090a6a246..4f8e7926b395 100644 --- a/packages/global/support/user/constant.ts +++ b/packages/global/support/user/constant.ts @@ -14,5 +14,6 @@ export const userStatusMap = { export enum OAuthEnum { github = 'github', google = 'google', - wechat = 'wechat' + wechat = 'wechat', + microsoft = 'microsoft' } diff --git a/packages/web/components/common/Icon/constants.ts b/packages/web/components/common/Icon/constants.ts index 5a26825ee5a2..da1bf101cc52 100644 --- a/packages/web/components/common/Icon/constants.ts +++ b/packages/web/components/common/Icon/constants.ts @@ -50,6 +50,7 @@ export const iconPaths = { 'common/list': () => import('./icons/common/list.svg'), 'common/loading': () => import('./icons/common/loading.svg'), 'common/logLight': () => import('./icons/common/logLight.svg'), + 'common/microsoft': () => import('./icons/common/microsoft.svg'), 'common/monitor': () => import('./icons/common/monitor.svg'), 'common/navbar/pluginFill': () => import('./icons/common/navbar/pluginFill.svg'), 'common/navbar/pluginLight': () => import('./icons/common/navbar/pluginLight.svg'), diff --git a/packages/web/components/common/Icon/icons/common/microsoft.svg b/packages/web/components/common/Icon/icons/common/microsoft.svg new file mode 100644 index 000000000000..a0c415384d24 --- /dev/null +++ b/packages/web/components/common/Icon/icons/common/microsoft.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/web/i18n/en/common.json b/packages/web/i18n/en/common.json index a042562b9260..481c17aae42b 100644 --- a/packages/web/i18n/en/common.json +++ b/packages/web/i18n/en/common.json @@ -997,6 +997,7 @@ "support.user.login.Email": "Email", "support.user.login.Github": "GitHub Login", "support.user.login.Google": "Google Login", + "support.user.login.Microsoft": "Microsoft Login", "support.user.login.Password": "Password", "support.user.login.Password login": "Password Login", "support.user.login.Phone": "Phone Login", diff --git a/packages/web/i18n/zh/common.json b/packages/web/i18n/zh/common.json index d963a4198147..98f933f88aae 100644 --- a/packages/web/i18n/zh/common.json +++ b/packages/web/i18n/zh/common.json @@ -18,9 +18,6 @@ "FAQ.switch_package_a": "套餐使用规则为优先使用更高级的套餐,因此,购买的新套餐若比当前套餐更高级,则新套餐立即生效:否则将继续使用当前套餐。", "FAQ.switch_package_q": "是否切换订阅套餐?", "Folder": "文件夹", - "just_now": "刚刚", - "yesterday": "昨天", - "yesterday_detail_time": "昨天 {{time}}", "Login": "登录", "Move": "移动", "Name": "名称", @@ -125,6 +122,7 @@ "common.Documents": "文档", "common.Done": "完成", "common.Edit": "编辑", + "common.Error": "错误", "common.Exit": "退出", "common.Exit Directly": "直接退出", "common.Expired Time": "过期时间", @@ -194,7 +192,6 @@ "common.Update Successful": "更新成功", "common.Username": "用户名", "common.Waiting": "等待中", - "common.Error": "错误", "common.Warning": "警告", "common.Website": "网站", "common.all_result": "完整结果", @@ -551,6 +548,7 @@ "core.dataset.import.Chunk Range": "范围:{{min}}~{{max}}", "core.dataset.import.Chunk Split": "直接分段", "core.dataset.import.Chunk Split Tip": "将文本按一定的规则进行分段处理后,转成可进行语义搜索的格式,适合绝大多数场景。不需要调用模型额外处理,成本低。", + "core.dataset.import.Continue upload": "继续上传", "core.dataset.import.Custom process": "自定义规则", "core.dataset.import.Custom process desc": "自定义设置数据处理规则", "core.dataset.import.Custom prompt": "自定义提示词", @@ -579,11 +577,10 @@ "core.dataset.import.Select source": "选择来源", "core.dataset.import.Source name": "来源名", "core.dataset.import.Sources list": "来源列表", - "core.dataset.import.Continue upload": "继续上传", - "core.dataset.import.Upload complete": "完成上传", "core.dataset.import.Start upload": "开始上传", "core.dataset.import.Total files": "共 {{total}} 个文件", "core.dataset.import.Training mode": "训练模式", + "core.dataset.import.Upload complete": "完成上传", "core.dataset.import.Upload data": "确认上传", "core.dataset.import.Upload file progress": "文件上传进度", "core.dataset.import.Upload status": "状态", @@ -894,6 +891,7 @@ "is_using": "正在使用", "item_description": "字段描述", "item_name": "字段名", + "just_now": "刚刚", "key_repetition": "key 重复", "move.confirm": "确认移动", "navbar.Account": "账号", @@ -998,6 +996,7 @@ "support.user.login.Email": "邮箱", "support.user.login.Github": "GitHub 登录", "support.user.login.Google": "Google 登录", + "support.user.login.Microsoft": "微软登录", "support.user.login.Password": "密码", "support.user.login.Password login": "密码登录", "support.user.login.Phone": "手机号登录", @@ -1214,5 +1213,7 @@ "user.type": "类型", "verification": "验证", "xx_search_result": "{{key}} 的搜索结果", - "yes": "是" + "yes": "是", + "yesterday": "昨天", + "yesterday_detail_time": "昨天 {{time}}" } diff --git a/projects/app/src/pages/login/components/LoginForm/components/FormLayout.tsx b/projects/app/src/pages/login/components/LoginForm/components/FormLayout.tsx index 7ee0f3463055..2a8d655879f5 100644 --- a/projects/app/src/pages/login/components/LoginForm/components/FormLayout.tsx +++ b/projects/app/src/pages/login/components/LoginForm/components/FormLayout.tsx @@ -59,6 +59,16 @@ const FormLayout = ({ children, setPageType, pageType }: Props) => { } ] : []), + ...(feConfigs?.oauth?.microsoft + ? [ + { + label: t('common:support.user.login.Microsoft'), + provider: OAuthEnum.microsoft, + icon: 'common/microsoft', + redirectUrl: `https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=${feConfigs?.oauth?.microsoft}&response_type=code&redirect_uri=${redirectUri}&response_mode=query&scope=https%3A%2F%2Fgraph.microsoft.com%2Fuser.read&state=${state.current}` + } + ] + : []), ...(pageType !== LoginPageTypeEnum.passwordLogin ? [ {