去除调用若依获取用户信息接口

lijinlong
吕天方 1 year ago
parent 686c958ad1
commit 508d69b116

@ -19,20 +19,20 @@ export function login(username, password, code, uuid) {
} }
// 无需验证码登录方法 TODO:缺少无需验证码登录 // 无需验证码登录方法 TODO:缺少无需验证码登录
export function noCodeLogin(username, password) { // export function noCodeLogin(username, password) {
const data = { // const data = {
username, // username,
password, // password,
} // }
return request({ // return request({
url: '/login', // url: '/login',
headers: { // headers: {
isToken: false // isToken: false
}, // },
method: 'post', // method: 'post',
data: data // data: data
}) // })
} // }
// 注册方法 // 注册方法
export function register(data) { export function register(data) {

@ -1,4 +1,4 @@
import { login, logout, getInfo, noCodeLogin } from '@/api/login' import { login, logout, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth' import { getToken, setToken, removeToken } from '@/utils/auth'
const user = { const user = {
@ -45,19 +45,19 @@ const user = {
}) })
}) })
}, },
NoCodeLogin({ commit }, userInfo){ // NoCodeLogin({ commit }, userInfo){
const username = userInfo.username.trim() // const username = userInfo.username.trim()
const password = userInfo.password // const password = userInfo.password
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
noCodeLogin(username, password).then(res => { // noCodeLogin(username, password).then(res => {
setToken(res.token) // setToken(res.token)
commit('SET_TOKEN', res.token) // commit('SET_TOKEN', res.token)
resolve() // resolve()
}).catch(error => { // }).catch(error => {
reject(error) // reject(error)
}) // })
}) // })
}, // },
// 获取用户信息 // 获取用户信息
GetInfo({ commit, state }) { GetInfo({ commit, state }) {

@ -97,7 +97,7 @@ service.interceptors.response.use(res => {
// username: "admin", // username: "admin",
// password: "admin123", // password: "admin123",
// } // }
// store.dispatch("Login", loginForm).then(() => { // store.dispatch("NoCodeLogin", loginForm).then(() => {
// isRelogin.show = false; // isRelogin.show = false;
// res.headers.Authorization = getToken(); // res.headers.Authorization = getToken();
// requests.forEach((cb) => cb(getToken())) // requests.forEach((cb) => cb(getToken()))

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-08-14 14:40:02 * @Date: 2023-08-14 14:40:02
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-12-18 09:53:52 * @LastEditTime: 2023-12-20 10:36:23
--> -->
<template> <template>
<div class="pc-container"> <div class="pc-container">
@ -95,11 +95,11 @@ export default {
rightAnimationAction() { rightAnimationAction() {
this.rightAnimation = !this.rightAnimation; this.rightAnimation = !this.rightAnimation;
}, },
getcodeImg(){ // getcodeImg(){
getInfo().then(res => { // getInfo().then(res => {
console.log(res,'codeImgres'); // console.log(res,'codeImgres');
}) // })
} // }
}, },
components: { myMap }, components: { myMap },
// computed: { // computed: {

Loading…
Cancel
Save