修复切换语言,登录页谷歌登录和微信登录按钮添加语言适配
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<!-- <div class="icon" @click="toGmailLogin"> -->
|
||||
<div class="icon">
|
||||
<img src="@/assets/images/loginPage/gmailIcon.svg" alt="">
|
||||
<span>{{ $props.text }}</span>
|
||||
<span>{{ displayText }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -21,7 +21,7 @@
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
||||
default: 'Sign in with Google'
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
@@ -108,6 +108,9 @@
|
||||
const toGmailLogin = ()=>{
|
||||
message.info(t('account.canNotUtilize'))
|
||||
}
|
||||
const displayText = computed(() => {
|
||||
return props.text || t('Login.LoginWithGoogle')
|
||||
})
|
||||
onBeforeUnmount(()=>{
|
||||
var existingScript = document.querySelector(`script[src="${data.scriptSrc}"]`);
|
||||
if(existingScript){
|
||||
@@ -120,6 +123,7 @@
|
||||
})
|
||||
return {
|
||||
toGmailLogin,
|
||||
displayText,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="Container">
|
||||
<div class="icon" @click="openWeiXinModel">
|
||||
<img src="@/assets/images/loginPage/weiXinIcon.svg" alt="" />
|
||||
<span>{{ $props.text }}</span>
|
||||
<span>{{ displayText }}</span>
|
||||
</div>
|
||||
<weiXinModel ref="weiXinModel"></weiXinModel>
|
||||
</div>
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
toRefs,
|
||||
} from "vue";
|
||||
import weiXinModel from "./weiXinModel.vue";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
export default defineComponent({
|
||||
name: "login",
|
||||
components: {
|
||||
@@ -26,20 +27,25 @@ export default defineComponent({
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
||||
default: "Sign in with Wechat",
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
setup(props) {
|
||||
let weiXinDom = reactive({
|
||||
weiXinModel: null,
|
||||
});
|
||||
const { t } = useI18n()
|
||||
const openWeiXinModel = () => {
|
||||
weiXinDom.weiXinModel.init();
|
||||
};
|
||||
const displayText = computed(() => {
|
||||
return props.text || t('Login.LoginWithWechat')
|
||||
})
|
||||
onMounted(() => {});
|
||||
return {
|
||||
...toRefs(weiXinDom),
|
||||
openWeiXinModel,
|
||||
displayText,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1543,11 +1543,13 @@ export default {
|
||||
LoginMethod: '使用以下方式登录:',
|
||||
Individual: '个人账号',
|
||||
Academic: '学术账号',
|
||||
LogoOnToAiDA: '登录到AiDA 3.1',
|
||||
LogonToAiDA: '登录到AiDA 3.1',
|
||||
Infomation: '请填写以下信息',
|
||||
Device: '请使用iPad或电脑登录',
|
||||
AgreePolicies: '请勾选条款、隐私政策和费用',
|
||||
PasswordConditions: '您必须满足所有密码条件才能注册'
|
||||
PasswordConditions: '您必须满足所有密码条件才能注册',
|
||||
LoginWithGoogle: '使用谷歌账号登录',
|
||||
LoginWithWechat: '使用微信登录',
|
||||
},
|
||||
LoginPersonal: {
|
||||
Email: '邮箱',
|
||||
|
||||
@@ -1591,7 +1591,9 @@ export default {
|
||||
Infomation: 'Please fill your information below',
|
||||
Device: 'If you need to design, please log in using an iPad or computer.',
|
||||
AgreePolicies: 'Please agree to all terms, privacy policy, and fees.',
|
||||
PasswordConditions: 'You must satisfy ALL password conditions to register.'
|
||||
PasswordConditions: 'You must satisfy ALL password conditions to register.',
|
||||
LoginWithGoogle: 'Sign in with Google',
|
||||
LoginWithWechat: 'Sign in with Wechat',
|
||||
},
|
||||
LoginPersonal: {
|
||||
Email: 'Email',
|
||||
|
||||
@@ -432,6 +432,7 @@
|
||||
ref="home"
|
||||
@setNewProject="() => (leftShow = true)"
|
||||
@setTask="setTask"
|
||||
:key="userDetail.language"
|
||||
></home>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user