|
@@ -6,7 +6,7 @@ import SvgIcon from '@/components/SvgIcon.vue';
|
|
import { useRequest } from '@/hooks/request';
|
|
import { useRequest } from '@/hooks/request';
|
|
import { useUserInfoStore } from '@/stores/user-info';
|
|
import { useUserInfoStore } from '@/stores/user-info';
|
|
import { t } from '@/i18n';
|
|
import { t } from '@/i18n';
|
|
-import { loginUser } from '@/api';
|
|
|
|
|
|
+import { getNeedFirstWizard, loginUser } from '@/api';
|
|
|
|
|
|
import { setToken } from '../../utils/auth';
|
|
import { setToken } from '../../utils/auth';
|
|
|
|
|
|
@@ -26,7 +26,7 @@ const rules: Record<string, Rule[]> = {
|
|
{
|
|
{
|
|
validator: (_rule: unknown, value: string) => {
|
|
validator: (_rule: unknown, value: string) => {
|
|
if (!isValidPhone(value)) {
|
|
if (!isValidPhone(value)) {
|
|
- return Promise.reject('手机号格式错误');
|
|
|
|
|
|
+ return Promise.reject(t('logView.invalidPhoneNumberFormat'));
|
|
}
|
|
}
|
|
return Promise.resolve();
|
|
return Promise.resolve();
|
|
},
|
|
},
|
|
@@ -46,24 +46,33 @@ const addLog = () => {
|
|
if (access_token) {
|
|
if (access_token) {
|
|
saveToken(access_token);
|
|
saveToken(access_token);
|
|
setToken(access_token);
|
|
setToken(access_token);
|
|
- router.push('/env-monitor/index');
|
|
|
|
|
|
+ const data = await getNeedFirstWizard();
|
|
|
|
+ if (data) {
|
|
|
|
+ router.push('/first-usage');
|
|
|
|
+ } else {
|
|
|
|
+ router.push('/env-monitor/index');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+const clickReturn = () => {
|
|
|
|
+ router.push('/index');
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
<AFlex>
|
|
<AFlex>
|
|
<div class="login-bgc">
|
|
<div class="login-bgc">
|
|
- <AButton type="text" @click="$router.go(-1)">
|
|
|
|
- <AFlex align="center"> <SvgIcon class="icon-left" name="left" /> 返回 </AFlex>
|
|
|
|
|
|
+ <AButton type="text" @click="clickReturn">
|
|
|
|
+ <AFlex align="center"> <SvgIcon class="icon-left" name="left" /> {{ t('common.return') }} </AFlex>
|
|
</AButton>
|
|
</AButton>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<AFlex class="login-div" align="center">
|
|
<AFlex class="login-div" align="center">
|
|
<div>
|
|
<div>
|
|
- <div class="login-title">暖通智控平台</div>
|
|
|
|
|
|
+ <div class="login-title">{{ t('logView.hvacIntelligentControlPlatform') }}</div>
|
|
<AForm
|
|
<AForm
|
|
ref="formRef"
|
|
ref="formRef"
|
|
:colon="false"
|
|
:colon="false"
|
|
@@ -72,22 +81,30 @@ const addLog = () => {
|
|
:rules="rules"
|
|
:rules="rules"
|
|
:hide-required-mark="true"
|
|
:hide-required-mark="true"
|
|
>
|
|
>
|
|
- <AFormItem label="账号" name="mobile">
|
|
|
|
- <AInput class="input-width" v-model:value="loginForm.mobile" placeholder="请输入手机号">
|
|
|
|
|
|
+ <AFormItem :label="t('logView.account')" name="mobile">
|
|
|
|
+ <AInput
|
|
|
|
+ class="input-width"
|
|
|
|
+ v-model:value="loginForm.mobile"
|
|
|
|
+ :placeholder="t('logView.pleaseEnterMobileNumber')"
|
|
|
|
+ >
|
|
<template #prefix>
|
|
<template #prefix>
|
|
- <SvgIcon name="calendar" class="icon-style" />
|
|
|
|
|
|
+ <SvgIcon name="a-accountnumber" class="icon-style" />
|
|
</template>
|
|
</template>
|
|
</AInput>
|
|
</AInput>
|
|
</AFormItem>
|
|
</AFormItem>
|
|
- <AFormItem label="密码" name="password">
|
|
|
|
- <AInput class="input-width" v-model:value="loginForm.password" placeholder="请输入密码">
|
|
|
|
|
|
+ <AFormItem :label="t('userManage.password')" name="password">
|
|
|
|
+ <AInput
|
|
|
|
+ class="input-width"
|
|
|
|
+ v-model:value="loginForm.password"
|
|
|
|
+ :placeholder="t('registerGateway.pleasePassword')"
|
|
|
|
+ >
|
|
<template #prefix>
|
|
<template #prefix>
|
|
- <SvgIcon name="calendar" class="icon-style" />
|
|
|
|
|
|
+ <SvgIcon name="password" class="icon-style" />
|
|
</template>
|
|
</template>
|
|
</AInput>
|
|
</AInput>
|
|
</AFormItem>
|
|
</AFormItem>
|
|
</AForm>
|
|
</AForm>
|
|
- <AButton type="primary" class="button-style" @click="addLog">登陆</AButton>
|
|
|
|
|
|
+ <AButton type="primary" class="button-style" @click="addLog">{{ t('logView.login') }}</AButton>
|
|
</div>
|
|
</div>
|
|
</AFlex>
|
|
</AFlex>
|
|
</AFlex>
|
|
</AFlex>
|
|
@@ -103,6 +120,8 @@ const addLog = () => {
|
|
|
|
|
|
.icon-style {
|
|
.icon-style {
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ color: #999;
|
|
}
|
|
}
|
|
|
|
|
|
.button-style {
|
|
.button-style {
|