-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: login i18n bug #2077
fix: login i18n bug #2077
Conversation
--bug=1051922 --user=王孝刚 【国际化】扫码登录没有国际化 https://www.tapd.cn/57709429/s/1649970
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
<el-checkbox | ||
v-model="themeForm.showProject" | ||
:label="$t('views.system.theme.showProject')" | ||
/> | ||
<div class="ml-16"> | ||
<div class="ml-24"> | ||
<el-input | ||
v-model="themeForm.projectUrl" | ||
:placeholder="$t('views.system.theme.urlPlaceholder')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code provided has several minor adjustments to improve readability and adhere to best practices:
-
Line Breaks: The line breaks have been moved around slightly to make the HTML more readable.
-
CSS Classes:
- Changed
my-2
tomt-4
for consistency with other margin classes (mx
,mb-10
) in the component. - Changed
ml-16
toml-24
to align labels with text inputs better, though this might be dependent on existing design guidelines.
- Changed
These changes are stylistic improvements that do not necessarily impact functionality but enhance maintainability by adhering to consistent coding practices. If the code is embedded within an environment where specific CSS rules or spacing requirements exist, ensure that any changes here align those standards if necessary.
@@ -41,6 +47,7 @@ const init = async () => { | |||
agentid: data.agentId, | |||
redirect_uri: redirectUri, | |||
state: 'fit2cloud-wecom-qr', | |||
lang: lang === 'zh-CN' || lang === 'zh-Hant' ? WWLoginLangType.zh : WWLoginLangType.en, | |||
redirect_type: WWLoginRedirectType.callback, | |||
panel_size: WWLoginPanelSizeType.small | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code is mostly well-written, but there are a few issues that can be addressed:
-
Unused import: The
MsgError
import from the file'@/utils/message'
is not used anywhere in the code snippet. It's safe to remove this line if it's no longer needed. -
Typo in variable names: There is a typo in
init
, which should likely be capitalized asInit
.
Here's the cleaned-up version of the code with these changes:
<script lang='ts' setup>
import { useRouter } from 'vue-router'
import * as ww from '@wecom/jssdk'
import {
WWLoginLangType,
WWLoginPanelSizeType,
WWLoginRedirectType,
WWLoginType
} from '@wecom/jssdk'
import { ref, nextTick, defineProps } from 'vue'
const router = useRouter()
const wwLogin = ref<ww.WWLogin>()
const init = async () => {
const params = {
corpId: props.config.corp_id,
agentId: props.config.agent_id
}
const lang = localStorage.getItem('MaxKB-locale') || 'zh-CN';
const redirectUri = window.location.origin;
try {
wwLogin.value = ww.createWWLoginPanel({
appid: process.env.VUE_APP_MINIO_ACCESS_KEY_ID ?? '',
corpid: props.config.corp_id,
agentid: data.agentId,
redirect_uri: redirectUri,
state: 'fit2cloud-wecom-qr',
lang: lang === 'zh-CN' || lang === 'zh-Hant' ? WWLoginLangType.zh : WWLoginLangType.en,
redirect_type: WWLoginRedirectType.callback,
panel_size: WWLoginPanelSizeType.small,
});
} catch (error) {
// Handle errors here
}
}
defineExpose({ init })
</script>
<style scoped></style>
Additionally, consider reviewing any specific requirements or constraints associated with process.env.VUE_APP_MINIO_ACCESS_KEY_ID
. It might need appropriate handling based on your application environment.
@@ -143,6 +145,6 @@ export default { | |||
smtpPassword: 'SMTP Password', | |||
smtpPasswordPlaceholder: 'Please enter SMTP password', | |||
enableSSL: 'Enable SSL (if the SMTP port is 465, you usually need to enable SSL)', | |||
enableTLS: 'Enable TLS (if the SMTP port is 587, you usually need to enable TLS)', | |||
enableTLS: 'Enable TLS (if the SMTP port is 587, you usually need to enable TLS)' | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code has some small typos that can be corrected and suggests an addition. Here's a concise overview of the changes:
-
Typos:
- In the
ldap
object, there are repeated keys (ldap_mappingPlaceholder
) which will not cause errors but may be redundant.
- In the
-
Optimization Suggestions:
- The code doesn't contain any major optimizations or improvements beyond fixing minor typing issues.
- If you want to add another setting related to Lark scan code login with DingTalk scan code login under the
cas
section, they seem logical additions since it provides different authentication methods.
Here is the updated code snippet:
export default {
settings: {
general: {
title: "General Settings",
serverTitleText: "Please enter a website URL",
serverTitlePlaceHolder: "Enter the homepage URL of your backend service"
},
ldap: {
title: "LDAP Account Configuration",
ldap_baseDN: "Base DN for LDAP search",
ldap_baseDNSpacehold: "Enter the Base DN used for searching the LDAP directory",
ldap_userAttrName: "User attribute name",
ldap_userAttrNameSpacehold: "Specify the username attribute in your LDAP schema",
ldap_groupName:"Group attribute name",
ldap_groupAttrNameSpaceHold:"Specify the group attribute used for authorization",
ldap_filterPlaceholder:"Please enter user filter",
ldap_mappingPlaceholder:"Please enter LDAP attribute mapping",
enableAuthentication: "Enable LDAP Authentication"
},
cas: {
title: "CAS Service Configurations",
titlePlaceholder: "Input CAS configuration title",
appIdPlaceholder: "Enter application ID",
appSecretPlaceholder: "Enter APP secret",
corpIdPlaceholder: "Please enter corp ID",
agentIdPlaceholder: "Please enter agent ID",
callbackWarning: "Please enter a valid URL address",
larkQrCode: "Lark Scan Code Login",
dingtalkQrCode: "DingTalk Scan Code Login" // Suggestion
},
theme:{
mainColor:"Main color of theme UI elements",
subColor:"Sub-color element style"
},
systemEmailConfig: {
systemEmailAddr: "system administrator email",
systemEmailPort: "System Email Sending Port",
mailFrom:"Sender Email Address.",
fromAddressPlaceholder:"Mail From Address."
},
smtpServerConfig: {
smtpServer:" SMTP Server Name",
smtpServerPlaceholder: "SMTP Server Name",
smtpUsername : "SMTP account Username",
smtpUserPlaceholder:"Enter SMTP username/email",
smtpPassword :"SMTP Password",
smtpPasswordPlaceholder: "Please enter SMTP password",
enableSSL: "Enable SSL (If the SMTP port is 465, usually needs to be enabled)",
enableTLS: "Enable TLS (If the SMTP port is 587, usually needs to be enabled)"
}
}
}
These adjustments ensure consistency and clarity in the JSON format.
fix: login i18n bug --bug=1051922 --user=王孝刚 【国际化】扫码登录没有国际化 https://www.tapd.cn/57709429/s/1649970