120
120
{{ $t('commons.button.login') }}
121
121
</el-button >
122
122
</el-form-item >
123
- <el-form-item prop =" agreeLicense" >
124
- <el-checkbox v-model =" loginForm.agreeLicense" >
125
- <template #default >
126
- <span class =" agree" v-html =" $t('commons.login.licenseHelper')" ></span >
127
- </template >
128
- </el-checkbox >
129
- </el-form-item >
130
- <div class =" agree-helper" >
131
- <span
132
- v-if =" !loginForm.agreeLicense && !_isMobile()"
133
- class =" input-error"
134
- style =" line-height : 14px "
135
- >
136
- {{ $t('commons.login.errorAgree') }}
137
- </span >
138
- </div >
123
+ <template v-if =" ! isIntl " >
124
+ <el-form-item prop =" agreeLicense" >
125
+ <el-checkbox v-model =" loginForm.agreeLicense" >
126
+ <template #default >
127
+ <span class =" agree" v-html =" $t('commons.login.licenseHelper')" ></span >
128
+ </template >
129
+ </el-checkbox >
130
+ </el-form-item >
131
+ <div class =" agree-helper" >
132
+ <span
133
+ v-if =" !loginForm.agreeLicense && !_isMobile()"
134
+ class =" input-error"
135
+ style =" line-height : 14px "
136
+ >
137
+ {{ $t('commons.login.errorAgree') }}
138
+ </span >
139
+ </div >
140
+ </template >
139
141
</el-form >
140
142
<div class =" demo" >
141
143
<span v-if =" isDemo" >
171
173
import { ref , reactive , onMounted , computed } from ' vue' ;
172
174
import { useRouter } from ' vue-router' ;
173
175
import type { ElForm } from ' element-plus' ;
174
- import { loginApi , getCaptcha , mfaLoginApi , checkIsDemo , getLanguage } from ' @/api/modules/auth' ;
176
+ import { loginApi , getCaptcha , mfaLoginApi , checkIsDemo , getLanguage , checkIsIntl } from ' @/api/modules/auth' ;
175
177
import { GlobalStore , MenuStore , TabsStore } from ' @/store' ;
176
178
import { MsgSuccess } from ' @/utils/message' ;
177
179
import { useI18n } from ' vue-i18n' ;
@@ -188,6 +190,7 @@ const errAuthInfo = ref(false);
188
190
const errCaptcha = ref (false );
189
191
const errMfaInfo = ref (false );
190
192
const isDemo = ref (false );
193
+ const isIntl = ref (true );
191
194
const agreeVisible = ref (false );
192
195
193
196
type FormInstance = InstanceType <typeof ElForm >;
@@ -235,6 +238,12 @@ const mfaShow = ref<boolean>(false);
235
238
const router = useRouter ();
236
239
const dropdownText = ref (' 中文(简体)' );
237
240
241
+ const checkIsSystemIntl = async () => {
242
+ const res = await checkIsIntl ();
243
+ isIntl .value = res .data ;
244
+ globalStore .isIntl = isIntl .value ;
245
+ };
246
+
238
247
function handleCommand(command : string ) {
239
248
loginForm .language = command ;
240
249
usei18n .locale .value = command ;
@@ -258,6 +267,9 @@ const login = (formEl: FormInstance | undefined) => {
258
267
if (! formEl || isLoggingIn ) return ;
259
268
formEl .validate (async (valid ) => {
260
269
if (! valid ) return ;
270
+ if (isIntl .value ) {
271
+ loginForm .agreeLicense = true ;
272
+ }
261
273
if (! loginForm .agreeLicense ) {
262
274
if (_isMobile ()) {
263
275
agreeVisible .value = true ;
@@ -372,6 +384,7 @@ const loadDataFromDB = async () => {
372
384
373
385
onMounted (() => {
374
386
globalStore .isOnRestart = false ;
387
+ checkIsSystemIntl ();
375
388
loginVerify ();
376
389
loadLanguage ();
377
390
document .title = globalStore .themeConfig .panelName ;
0 commit comments