登录页面init

This commit is contained in:
2024-08-19 14:01:14 +08:00
parent 74bd16dc51
commit 41babdfa5c
22 changed files with 244 additions and 139 deletions

View File

@@ -1,4 +1,4 @@
import request from '@/utils/http'
import createAxios from '@/utils/http'
import { useUserInfoStore } from '@/stores/user'
import { sm3Digest } from '@/assets/commjs/sm3.js'
import { sm2, encrypt } from '@/assets/commjs/sm2.js'
@@ -11,7 +11,7 @@ export const publicKey = (params?: any) => {
loginName: encrypt(userInfo.loginName),
}
}
return request({
return createAxios({
url: '/user/generateSm2Key',
method: 'get',
params,
@@ -30,7 +30,7 @@ export const pwdSm3 = async (pwd: any, loginName?: string) => {
export const login = async (params: any) => {
params.password = await pwdSm3(params.password, params.username)
params.username = encrypt(params.username)
return request({
return createAxios({
url: '/pqs-auth/oauth/token',
method: 'post',
params,
@@ -40,7 +40,7 @@ export const login = async (params: any) => {
//获取用户信息
export const getUserById = () => {
const userInfo = useUserInfoStore()
return request({
return createAxios({
url: '/user-boot/user/getUserById?id=' + userInfo.userIndex,
method: 'get',
})