|
@@ -51,7 +51,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
-import { defineComponent, ref } from 'vue'
|
|
|
+import { defineComponent, nextTick, ref } from 'vue'
|
|
|
import { ElButton, ElForm, ElFormItem, ElInput, ElMessage } from 'element-plus'
|
|
|
import type { FormInstance } from 'element-plus'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
@@ -114,4 +114,16 @@ const tryLogin = () => {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+const query = $route.query
|
|
|
+if (query.u && query.u.length) {
|
|
|
+ form.value.username = decodeURIComponent(query.u as string)
|
|
|
+}
|
|
|
+if (query.p && query.p.length) {
|
|
|
+ form.value.password = decodeURIComponent(query.p as string)
|
|
|
+}
|
|
|
+if (query.action === 'autoLogin') {
|
|
|
+ nextTick(() => {
|
|
|
+ tryLogin()
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|