|
@@ -2,7 +2,7 @@
|
|
import { reactive, ref, unref, watch } from 'vue'
|
|
import { reactive, ref, unref, watch } from 'vue'
|
|
import { Form } from '@/components/Form'
|
|
import { Form } from '@/components/Form'
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
-import { ElButton, ElCheckbox, ElLink } from 'element-plus'
|
|
|
|
|
|
+import { ElButton, ElCheckbox, ElLink, ElMessage } from 'element-plus'
|
|
import { useForm } from '@/hooks/web/useForm'
|
|
import { useForm } from '@/hooks/web/useForm'
|
|
import { loginApi, getTestRoleApi, getAdminRoleApi } from '@/api/login'
|
|
import { loginApi, getTestRoleApi, getAdminRoleApi } from '@/api/login'
|
|
import { useCache } from '@/hooks/web/useCache'
|
|
import { useCache } from '@/hooks/web/useCache'
|
|
@@ -43,7 +43,7 @@ const schema = reactive<FormSchema[]>([
|
|
{
|
|
{
|
|
field: 'username',
|
|
field: 'username',
|
|
label: t('login.username'),
|
|
label: t('login.username'),
|
|
- value: 'admin',
|
|
|
|
|
|
+ value: '18380313545',
|
|
component: 'Input',
|
|
component: 'Input',
|
|
colProps: {
|
|
colProps: {
|
|
span: 24
|
|
span: 24
|
|
@@ -55,7 +55,7 @@ const schema = reactive<FormSchema[]>([
|
|
{
|
|
{
|
|
field: 'password',
|
|
field: 'password',
|
|
label: t('login.password'),
|
|
label: t('login.password'),
|
|
- value: 'admin',
|
|
|
|
|
|
+ value: '313545',
|
|
component: 'InputPassword',
|
|
component: 'InputPassword',
|
|
colProps: {
|
|
colProps: {
|
|
span: 24
|
|
span: 24
|
|
@@ -124,12 +124,12 @@ const signIn = async () => {
|
|
if (isValid) {
|
|
if (isValid) {
|
|
loading.value = true
|
|
loading.value = true
|
|
const { getFormData } = methods
|
|
const { getFormData } = methods
|
|
- const formData = await getFormData<UserType>()
|
|
|
|
|
|
+ let formData = await getFormData<UserType>()
|
|
|
|
|
|
try {
|
|
try {
|
|
const res = await loginApi(formData)
|
|
const res = await loginApi(formData)
|
|
-
|
|
|
|
if (res) {
|
|
if (res) {
|
|
|
|
+ ElMessage.success('登录成功!')
|
|
wsCache.set(appStore.getUserInfo, res.data)
|
|
wsCache.set(appStore.getUserInfo, res.data)
|
|
// 是否使用动态路由
|
|
// 是否使用动态路由
|
|
if (appStore.getDynamicRouter) {
|
|
if (appStore.getDynamicRouter) {
|