|
@@ -9,7 +9,7 @@
|
|
v-show="getShow"
|
|
v-show="getShow"
|
|
@keypress.enter="handleLogin"
|
|
@keypress.enter="handleLogin"
|
|
>
|
|
>
|
|
- <FormItem name="account" class="enter-x">
|
|
|
|
|
|
+ <FormItem name="account" class="enter-x mymargin">
|
|
<Input
|
|
<Input
|
|
size="large"
|
|
size="large"
|
|
v-model:value="formData.account"
|
|
v-model:value="formData.account"
|
|
@@ -17,7 +17,7 @@
|
|
class="fix-auto-fill"
|
|
class="fix-auto-fill"
|
|
/>
|
|
/>
|
|
</FormItem>
|
|
</FormItem>
|
|
- <FormItem name="password" class="enter-x">
|
|
|
|
|
|
+ <FormItem name="password" class="enter-x mymargin">
|
|
<InputPassword
|
|
<InputPassword
|
|
size="large"
|
|
size="large"
|
|
visibilityToggle
|
|
visibilityToggle
|
|
@@ -28,7 +28,7 @@
|
|
|
|
|
|
<ARow class="enter-x">
|
|
<ARow class="enter-x">
|
|
<ACol :span="12">
|
|
<ACol :span="12">
|
|
- <FormItem>
|
|
|
|
|
|
+ <FormItem class="">
|
|
<!-- No logic, you need to deal with it yourself -->
|
|
<!-- No logic, you need to deal with it yourself -->
|
|
<Checkbox v-model:checked="rememberMe" size="small">
|
|
<Checkbox v-model:checked="rememberMe" size="small">
|
|
{{ t('sys.login.rememberMe') }}
|
|
{{ t('sys.login.rememberMe') }}
|
|
@@ -36,7 +36,7 @@
|
|
</FormItem>
|
|
</FormItem>
|
|
</ACol>
|
|
</ACol>
|
|
<ACol :span="12">
|
|
<ACol :span="12">
|
|
- <FormItem :style="{ 'text-align': 'right' }">
|
|
|
|
|
|
+ <FormItem :style="{ 'text-align': 'right' }" class="mymargin">
|
|
<!-- No logic, you need to deal with it yourself -->
|
|
<!-- No logic, you need to deal with it yourself -->
|
|
<!-- <Button type="link" size="small" @click="setLoginState(LoginStateEnum.RESET_PASSWORD)">
|
|
<!-- <Button type="link" size="small" @click="setLoginState(LoginStateEnum.RESET_PASSWORD)">
|
|
{{ t('sys.login.forgetPassword') }}
|
|
{{ t('sys.login.forgetPassword') }}
|
|
@@ -46,15 +46,21 @@
|
|
</ARow>
|
|
</ARow>
|
|
|
|
|
|
<FormItem class="enter-x">
|
|
<FormItem class="enter-x">
|
|
- <Button style="border-radius: 5px" type="primary" size="large" block @click="handleLogin" :loading="loading">
|
|
|
|
|
|
+ <Button
|
|
|
|
+ class="mybtmargin"
|
|
|
|
+ style="border-radius: 5px"
|
|
|
|
+ type="primary"
|
|
|
|
+ size="large"
|
|
|
|
+ block
|
|
|
|
+ @click="handleLogin"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ >
|
|
{{ t('sys.login.loginButton') }}
|
|
{{ t('sys.login.loginButton') }}
|
|
</Button>
|
|
</Button>
|
|
- <Button size="large" class="mt-4 enter-x" block @click="handleRegister">
|
|
|
|
|
|
+ <Button size="large" class="mybtmargin enter-x" block @click="handleRegister">
|
|
{{ t('sys.login.registerButton') }}
|
|
{{ t('sys.login.registerButton') }}
|
|
</Button>
|
|
</Button>
|
|
- <Button size="large" class="mt-4 enter-x" block @click="handlesybz">
|
|
|
|
- 使用帮助
|
|
|
|
- </Button>
|
|
|
|
|
|
+ <Button size="large" class="mybtmargin enter-x" block @click="handlesybz"> 使用帮助 </Button>
|
|
</FormItem>
|
|
</FormItem>
|
|
<!-- <ARow class="enter-x">
|
|
<!-- <ARow class="enter-x">
|
|
<ACol :md="8" :xs="24">
|
|
<ACol :md="8" :xs="24">
|
|
@@ -88,7 +94,7 @@
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import { reactive, ref, unref, computed, onMounted } from 'vue';
|
|
import { reactive, ref, unref, computed, onMounted } from 'vue';
|
|
|
|
|
|
- import { Checkbox, Form, Input, Row, Col, Button, } from 'ant-design-vue';// Divider
|
|
|
|
|
|
+ import { Checkbox, Form, Input, Row, Col, Button } from 'ant-design-vue'; // Divider
|
|
// import {
|
|
// import {
|
|
// GithubFilled,
|
|
// GithubFilled,
|
|
// WechatFilled,
|
|
// WechatFilled,
|
|
@@ -124,10 +130,10 @@
|
|
const rememberMe = ref(false);
|
|
const rememberMe = ref(false);
|
|
const registerUrl = ref('');
|
|
const registerUrl = ref('');
|
|
fetch('./register.json')
|
|
fetch('./register.json')
|
|
- .then((response) => response.json())
|
|
|
|
- .then((data) => {
|
|
|
|
- registerUrl.value = data.url
|
|
|
|
- });
|
|
|
|
|
|
+ .then((response) => response.json())
|
|
|
|
+ .then((data) => {
|
|
|
|
+ registerUrl.value = data.url;
|
|
|
|
+ });
|
|
const formData = reactive({
|
|
const formData = reactive({
|
|
account: '',
|
|
account: '',
|
|
password: '',
|
|
password: '',
|
|
@@ -140,18 +146,17 @@
|
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN);
|
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN);
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- let localePass = localStorage.getItem('password')
|
|
|
|
- if(localePass){
|
|
|
|
|
|
+ let localePass = localStorage.getItem('password');
|
|
|
|
+ if (localePass) {
|
|
let password = decodeURIComponent(escape(window.atob(localePass))),
|
|
let password = decodeURIComponent(escape(window.atob(localePass))),
|
|
- account:string = localStorage.getItem('username')
|
|
|
|
- formData.account = account
|
|
|
|
- formData.password = password
|
|
|
|
- rememberMe.value = true
|
|
|
|
|
|
+ account: string = localStorage.getItem('username');
|
|
|
|
+ formData.account = account;
|
|
|
|
+ formData.password = password;
|
|
|
|
+ rememberMe.value = true;
|
|
}
|
|
}
|
|
-
|
|
|
|
});
|
|
});
|
|
function handleRegister() {
|
|
function handleRegister() {
|
|
- window.open(registerUrl.value)
|
|
|
|
|
|
+ window.open(registerUrl.value);
|
|
}
|
|
}
|
|
function handlesybz() {
|
|
function handlesybz() {
|
|
window.open('//help.map.jms.gd/forum-4.htm');
|
|
window.open('//help.map.jms.gd/forum-4.htm');
|
|
@@ -167,17 +172,17 @@
|
|
mode: 'none', //不要默认的错误提示
|
|
mode: 'none', //不要默认的错误提示
|
|
});
|
|
});
|
|
if (userInfo) {
|
|
if (userInfo) {
|
|
- console.log('userInfo', userInfo)
|
|
|
|
|
|
+ console.log('userInfo', userInfo);
|
|
if (userInfo.platformName) {
|
|
if (userInfo.platformName) {
|
|
appStore.setTitle(userInfo.platformName);
|
|
appStore.setTitle(userInfo.platformName);
|
|
}
|
|
}
|
|
- if(rememberMe.value){
|
|
|
|
- let password:string = window.btoa(unescape(encodeURIComponent(data.password)))
|
|
|
|
- localStorage.setItem('password',password)
|
|
|
|
- localStorage.setItem('username',data.account)
|
|
|
|
- }else{
|
|
|
|
- localStorage.removeItem("password");
|
|
|
|
- localStorage.removeItem("username");
|
|
|
|
|
|
+ if (rememberMe.value) {
|
|
|
|
+ let password: string = window.btoa(unescape(encodeURIComponent(data.password)));
|
|
|
|
+ localStorage.setItem('password', password);
|
|
|
|
+ localStorage.setItem('username', data.account);
|
|
|
|
+ } else {
|
|
|
|
+ localStorage.removeItem('password');
|
|
|
|
+ localStorage.removeItem('username');
|
|
}
|
|
}
|
|
notification.success({
|
|
notification.success({
|
|
message: t('sys.login.loginSuccessTitle'),
|
|
message: t('sys.login.loginSuccessTitle'),
|
|
@@ -196,3 +201,17 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+ .mymargin {
|
|
|
|
+ margin-bottom: 24px;
|
|
|
|
+ @media (min-width: 3000px) {
|
|
|
|
+ margin-bottom: 14px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .mybtmargin {
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+ @media (min-width: 3000px) {
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</style>
|