Modify login process
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user