|
|
@@ -27,10 +27,10 @@
|
|
|
:inline="false"
|
|
|
@keyup.enter="onSubmit"
|
|
|
>
|
|
|
- <el-form-item prop="phone">
|
|
|
+ <el-form-item prop="userName">
|
|
|
<el-input
|
|
|
size="large"
|
|
|
- v-model.trim="phone"
|
|
|
+ v-model.trim="userName"
|
|
|
placeholder="用户名"
|
|
|
>
|
|
|
<template #prepend>
|
|
|
@@ -38,11 +38,12 @@
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="code">
|
|
|
+ <el-form-item prop="pwd">
|
|
|
<el-input
|
|
|
size="large"
|
|
|
- v-model.trim="code"
|
|
|
- placeholder="验证码"
|
|
|
+ type="password"
|
|
|
+ v-model.trim="pwd"
|
|
|
+ placeholder="密码"
|
|
|
>
|
|
|
<template #prepend>
|
|
|
<el-icon :size="20"><Key /></el-icon>
|
|
|
@@ -76,7 +77,7 @@ import { useStore } from "vuex";
|
|
|
import { useRouter } from "vue-router";
|
|
|
|
|
|
const rules = {
|
|
|
- phone: [{ required: true, message: "请输入用户名", trigger: "blur" }]
|
|
|
+ userName: [{ required: true, message: "请输入用户名", trigger: "blur" }]
|
|
|
};
|
|
|
|
|
|
// const rules = {
|
|
|
@@ -89,10 +90,10 @@ const rules = {
|
|
|
const store = useStore();
|
|
|
const router = useRouter();
|
|
|
const form = reactive({
|
|
|
- "code": "",
|
|
|
- "phone": "13797066447"
|
|
|
+ "pwd": "",
|
|
|
+ "userName": "汕头橡胶"
|
|
|
});
|
|
|
-const { phone, code } = toRefs(form);
|
|
|
+const { userName, pwd } = toRefs(form);
|
|
|
const ref_form = ref(null);
|
|
|
const success = ref(false);
|
|
|
sessionStorage.clear();
|
|
|
@@ -103,7 +104,7 @@ router.options.isAddDynamicMenuRoutes = false;
|
|
|
const onSubmit = () => {
|
|
|
ref_form.value.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
- const res = await VE_API.system.phoneLogin(form);
|
|
|
+ const res = await VE_API.system.login(form);
|
|
|
if (res.code == 0) {
|
|
|
const { token, userName, djiCloudToken } = res.data;
|
|
|
store.commit(`app/${SET_TOKEN}`, token);
|