123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- import request from '@/utils/request';
- import { AxiosPromise } from 'axios';
- // pc端固定客户端授权id
- const clientId = import.meta.env.VITE_APP_CLIENT_ID;
- export function login(data) {
- const params = {
- ...data,
- clientId: data.clientId || clientId,
- grantType: data.grantType || 'password'
- };
- return request({
- url: '/api/auth/login',
- headers: {
- isToken: false,
- isEncrypt: true,
- repeatSubmit: false
- },
- method: 'post',
- data: params
- });
- }
- /**
- * 注销
- */
- export function logout() {
- return request({
- url: '/api/auth/logout',
- method: 'post'
- });
- }
- /**
- * 获取验证码
- */
- export function getCodeImg() {
- return request({
- url: '/api/auth/code',
- headers: {
- isToken: false
- },
- method: 'get',
- timeout: 20000
- });
- }
- // 获取租户列表
- export function getTenantList() {
- return request({
- url: '/api/auth/tenant/list',
- headers: {
- isToken: false
- },
- method: 'get'
- });
- }
- // 获取用户详细信息
- export function getInfo() {
- return request({
- url: '/api/system/user/getInfo',
- method: 'get'
- });
- }
- /**
- * 粤政易登录
- */
- export function callback(data): AxiosPromise<any> {
- const LoginData = {
- ...data,
- clientId: clientId,
- grantType: 'social'
- };
- return request({
- url: '/auth/yzy/callback',
- headers: {
- isToken: false,
- isEncrypt: true,
- repeatSubmit: false
- },
- method: 'post',
- data: LoginData
- });
- }
|