|
|
@@ -100,7 +100,7 @@
|
|
|
placeholder="请输入密码"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
+ <!-- <el-form-item
|
|
|
v-if="loginFormData.openCaptcha"
|
|
|
prop="captcha"
|
|
|
class="mb-6"
|
|
|
@@ -122,7 +122,7 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item class="mb-6">
|
|
|
<el-button
|
|
|
class="shadow shadow-blue-600 h-11 w-full"
|
|
|
@@ -168,7 +168,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { captcha } from "@/api/user";
|
|
|
+// import { captcha } from "@/api/user";
|
|
|
import { checkDB } from "@/api/initdb";
|
|
|
import BottomInfo from "@/view/layout/bottomInfo/bottomInfo.vue";
|
|
|
import { reactive, ref } from "vue";
|
|
|
@@ -203,18 +203,18 @@ const checkPassword = (rule, value, callback) => {
|
|
|
|
|
|
// 获取验证码
|
|
|
const loginVerify = () => {
|
|
|
- captcha({}).then(async (ele) => {
|
|
|
- rules.captcha.push({
|
|
|
- max: ele.data.captchaLength,
|
|
|
- min: ele.data.captchaLength,
|
|
|
- message: `请输入${ele.data.captchaLength}位验证码`,
|
|
|
- trigger: "blur",
|
|
|
- });
|
|
|
- picPath.value = ele.data.picPath;
|
|
|
- loginFormData.captchaId = ele.data.captchaId;
|
|
|
- loginFormData.openCaptcha = ele.data.openCaptcha;
|
|
|
- console.log();
|
|
|
- });
|
|
|
+ // captcha({}).then(async (ele) => {
|
|
|
+ // rules.captcha.push({
|
|
|
+ // max: ele.data.captchaLength,
|
|
|
+ // min: ele.data.captchaLength,
|
|
|
+ // message: `请输入${ele.data.captchaLength}位验证码`,
|
|
|
+ // trigger: "blur",
|
|
|
+ // });
|
|
|
+ // picPath.value = ele.data.picPath;
|
|
|
+ // // loginFormData.captchaId = ele.data.captchaId;
|
|
|
+ // // loginFormData.openCaptcha = ele.data.openCaptcha;
|
|
|
+ // console.log();
|
|
|
+ // });
|
|
|
};
|
|
|
loginVerify();
|
|
|
|
|
|
@@ -224,23 +224,24 @@ const picPath = ref("");
|
|
|
const loginFormData = reactive({
|
|
|
username: "",
|
|
|
password: "",
|
|
|
- captcha: "",
|
|
|
- captchaId: "",
|
|
|
+ captcha: "443188",
|
|
|
+ captchaId: "0FZfnUtAOrdXvTETkJRc",
|
|
|
openCaptcha: false,
|
|
|
});
|
|
|
const rules = reactive({
|
|
|
username: [{ validator: checkUsername, trigger: "blur" }],
|
|
|
password: [{ validator: checkPassword, trigger: "blur" }],
|
|
|
- captcha: [
|
|
|
- {
|
|
|
- message: "验证码格式不正确",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
+ // captcha: [
|
|
|
+ // {
|
|
|
+ // message: "验证码格式不正确",
|
|
|
+ // trigger: "blur",
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
});
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
const login = async () => {
|
|
|
+ console.log(userStore);
|
|
|
return await userStore.LoginIn(loginFormData);
|
|
|
};
|
|
|
const submitForm = () => {
|