|
@@ -93,6 +93,7 @@
|
|
</template>
|
|
</template>
|
|
<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 { useRoute } from 'vue-router'
|
|
|
|
|
|
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 {
|
|
@@ -124,7 +125,7 @@
|
|
|
|
|
|
const { setLoginState, getLoginState } = useLoginState();
|
|
const { setLoginState, getLoginState } = useLoginState();
|
|
const { getFormRules } = useFormRules();
|
|
const { getFormRules } = useFormRules();
|
|
-
|
|
|
|
|
|
+ const { query } = useRoute()
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
const rememberMe = ref(false);
|
|
const rememberMe = ref(false);
|
|
@@ -161,7 +162,17 @@
|
|
function handlesybz() {
|
|
function handlesybz() {
|
|
window.open('//help.map.jms.gd/forum-4.htm');
|
|
window.open('//help.map.jms.gd/forum-4.htm');
|
|
}
|
|
}
|
|
|
|
+ function isUrl(string){
|
|
|
|
+ try {
|
|
|
|
+ new URL(string);
|
|
|
|
+ return true;
|
|
|
|
+ } catch (err) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
async function handleLogin() {
|
|
async function handleLogin() {
|
|
|
|
+ console.log('handleLogin', query);
|
|
const data = await validForm();
|
|
const data = await validForm();
|
|
if (!data) return;
|
|
if (!data) return;
|
|
try {
|
|
try {
|
|
@@ -172,7 +183,7 @@
|
|
mode: 'none', //不要默认的错误提示
|
|
mode: 'none', //不要默认的错误提示
|
|
});
|
|
});
|
|
if (userInfo) {
|
|
if (userInfo) {
|
|
- console.log('userInfo', userInfo);
|
|
|
|
|
|
+ console.log('handleLogin', userInfo, query);
|
|
if (userInfo.platformName) {
|
|
if (userInfo.platformName) {
|
|
appStore.setTitle(userInfo.platformName);
|
|
appStore.setTitle(userInfo.platformName);
|
|
}
|
|
}
|
|
@@ -184,6 +195,9 @@
|
|
localStorage.removeItem('password');
|
|
localStorage.removeItem('password');
|
|
localStorage.removeItem('username');
|
|
localStorage.removeItem('username');
|
|
}
|
|
}
|
|
|
|
+ if(query?.redirect && isUrl(query?.redirect as string)){
|
|
|
|
+ window.open(query?.redirect as string);
|
|
|
|
+ }
|
|
notification.success({
|
|
notification.success({
|
|
message: t('sys.login.loginSuccessTitle'),
|
|
message: t('sys.login.loginSuccessTitle'),
|
|
description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.nickName}`,
|
|
description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.nickName}`,
|