You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
oldcac/src/api/login.js

52 lines
929 B
JavaScript

1 year ago
import request from "@/utils/request";
import { UPMS_SREVICE, AUTH_SREVICE, SJZD_SREVICE } from "@/api/module/urls";
1 year ago
1 year ago
const client_id = "web";
const client_secret = "123456";
const scope = "server";
1 year ago
// 登录方法
export function login(username, password, clienttype) {
return request({
1 year ago
url: "/user/login",
method: "post",
1 year ago
params: {
username,
password,
1 year ago
clienttype,
},
});
1 year ago
}
// 刷新方法
export function refreshToken() {
return request({
1 year ago
url: AUTH_SREVICE + "/auth/refresh",
method: "post",
});
1 year ago
}
// 获取用户详细信息
export function getInfo() {
return request({
1 year ago
url: UPMS_SREVICE + "/system/getInfo",
method: "get",
});
1 year ago
}
// 退出方法
export function logout() {
return request({
1 year ago
url: "/user/logout",
method: "post",
});
1 year ago
}
// 获取验证码
export function getCodeImg() {
return request({
1 year ago
url: "/code",
method: "get",
});
}