Modify login process

This commit is contained in:
simple321vip
2022-08-28 12:45:49 +08:00
parent e9c8cb9d33
commit c865fd1184
51 changed files with 207 additions and 162 deletions
+4 -11
View File
@@ -34,15 +34,15 @@
<script lang="ts" setup>
import { reactive, ref } from 'vue'
import type { FormInstance } from 'element-plus'
import { useUserStore } from '../../store/user'
import { useTenantStore } from '../../store/tenant'
import router from '../../router'
import baiduCloudImage from "../../assets/baiducloud.png"
import config from '../../const/config'
import { getQrCode } from '../../api/login'
let qrcode = config.BAIDU_CLOUD_URL + config.RESPONSE_TYPE + config.CLIENT_ID + config.REDIRECT_URI + config.SCOPE + config.DEVICE_ID + config.QR_CODE + config.DISPLAY
const user = useUserStore()
const tenant = useTenantStore()
const ruleFormRef = ref<FormInstance>()
const loginForm = reactive({
@@ -50,13 +50,6 @@ const loginForm = reactive({
password: ''
})
const loginWithBaiDu = () => {
window.open("", "11");
// getQrCode().then((response) => {
// })
}
const validateUserName = (rule: any, value: string, callback: Function) => {
if (!value) {
callback(new Error("请输入的用户名"))
@@ -83,7 +76,7 @@ const dologin = (form: any) => {
return
form.validate((valid: any) => {
if (valid) {
user.login(loginForm.user_id, loginForm.password).then(res => {
tenant.login(loginForm.user_id, loginForm.password).then(res => {
console.log(1)
router.push({
path: '/home'