|
@ -11,7 +11,8 @@ import { useRouter } from 'vue-router' |
|
|
const router = useRouter() |
|
|
const router = useRouter() |
|
|
|
|
|
|
|
|
const sys = useSystemStore() |
|
|
const sys = useSystemStore() |
|
|
|
|
|
|
|
|
|
|
|
const form = ref(sys.loginForm) |
|
|
|
|
|
form.value.password = undefined |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
setToken('login success') |
|
|
setToken('login success') |
|
|
const rules = { |
|
|
const rules = { |
|
@ -31,7 +32,7 @@ const loginHandle = async () => { |
|
|
if (!valid) { |
|
|
if (!valid) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
const res = await login(sys.loginForm) |
|
|
|
|
|
|
|
|
const res = await login(form.value) |
|
|
setToken('login success') |
|
|
setToken('login success') |
|
|
sys.systemStatus.currentUser = res |
|
|
sys.systemStatus.currentUser = res |
|
|
await router.push('/') |
|
|
await router.push('/') |
|
@ -47,15 +48,15 @@ const loginHandle = async () => { |
|
|
.login-box-content |
|
|
.login-box-content |
|
|
img(:src="logo", alt="" class="logo") |
|
|
img(:src="logo", alt="" class="logo") |
|
|
//.title 长春黄金研究院有限公司 |
|
|
//.title 长春黄金研究院有限公司 |
|
|
el-form(ref="formRef", :model="sys.loginForm", :rules="rules", style="width: 100%") |
|
|
|
|
|
|
|
|
el-form(ref="formRef", :model="form", :rules="rules", style="width: 100%") |
|
|
.input-title 用户名 |
|
|
.input-title 用户名 |
|
|
el-form-item |
|
|
el-form-item |
|
|
ft-input(v-model="sys.loginForm.username", size="large", placeholder="请输入用户名") |
|
|
|
|
|
|
|
|
ft-input(v-model="form.username", size="large", placeholder="请输入用户名") |
|
|
template(#prepend) |
|
|
template(#prepend) |
|
|
img.input-icon(:src="user", alt="") |
|
|
img.input-icon(:src="user", alt="") |
|
|
.input-title 密码 |
|
|
.input-title 密码 |
|
|
el-form-item |
|
|
el-form-item |
|
|
ft-input(v-model="sys.loginForm.password", size="large", placeholder="请输入密码", type="password") |
|
|
|
|
|
|
|
|
ft-input(autocomplete="new-password" v-model="form.password", size="large", placeholder="请输入密码", type="password") |
|
|
template(#prepend) |
|
|
template(#prepend) |
|
|
img.input-icon(:src="password", alt="") |
|
|
img.input-icon(:src="password", alt="") |
|
|
el-form-item |
|
|
el-form-item |
|
|