Merge branch 'master' of https://github.com/youlaitech/vue3-element-admin
Former-commit-id: 4d8668b047a3c92854a3b149933c3c2de59fc048
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { CaptchaResult, LoginData, LoginResult } from './types';
|
||||
import request from "@/utils/request";
|
||||
import { AxiosPromise } from "axios";
|
||||
import { CaptchaResult, LoginData, LoginResult } from "./types";
|
||||
|
||||
/**
|
||||
* 登录API
|
||||
@@ -9,10 +9,18 @@ import { CaptchaResult, LoginData, LoginResult } from './types';
|
||||
* @returns
|
||||
*/
|
||||
export function loginApi(data: LoginData): AxiosPromise<LoginResult> {
|
||||
const formData = new FormData();
|
||||
formData.append("username", data.username);
|
||||
formData.append("password", data.password);
|
||||
formData.append("verifyCodeKey", data.verifyCodeKey || "");
|
||||
formData.append("verifyCode", data.verifyCode || "");
|
||||
return request({
|
||||
url: '/api/v1/auth/login',
|
||||
method: 'post',
|
||||
params: data
|
||||
url: "/api/v1/auth/login",
|
||||
method: "post",
|
||||
data: formData,
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,19 +29,17 @@ export function loginApi(data: LoginData): AxiosPromise<LoginResult> {
|
||||
*/
|
||||
export function logoutApi() {
|
||||
return request({
|
||||
url: '/api/v1/auth/logout',
|
||||
method: 'delete'
|
||||
url: "/api/v1/auth/logout",
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
export function getCaptchaApi(): AxiosPromise<CaptchaResult> {
|
||||
return request({
|
||||
url: '/api/v1/auth/captcha',
|
||||
method: 'get'
|
||||
url: "/api/v1/auth/captcha",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ export interface LoginData {
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
username?: string;
|
||||
username: string;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
password?: string;
|
||||
password: string;
|
||||
|
||||
/**
|
||||
* 验证码缓存key
|
||||
@@ -57,4 +57,3 @@ export interface CaptchaResult {
|
||||
*/
|
||||
verifyCodeBase64: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ orderCount.value = 2000;
|
||||
</div>
|
||||
<div class="flex flex-col space-y-3">
|
||||
<div class="text-[var(--el-text-color-secondary)]">访问数</div>
|
||||
<div class="text-lg">
|
||||
<div class="text-lg text-right">
|
||||
{{ Math.round(visitCountOutput) }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -138,7 +138,7 @@ orderCount.value = 2000;
|
||||
</div>
|
||||
<div class="flex flex-col space-y-3">
|
||||
<div class="text-[var(--el-text-color-secondary)]">消息数</div>
|
||||
<div class="text-lg">
|
||||
<div class="text-lg text-right">
|
||||
{{ Math.round(messageCountOutput) }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -169,7 +169,7 @@ orderCount.value = 2000;
|
||||
</div>
|
||||
<div class="flex flex-col space-y-3">
|
||||
<div class="text-[var(--el-text-color-secondary)]">订单数</div>
|
||||
<div class="text-lg">
|
||||
<div class="text-lg text-right">
|
||||
{{ Math.round(orderCountOutput) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,6 +33,7 @@ watch(
|
||||
() => props.typeCode,
|
||||
(newVal: string) => {
|
||||
queryParams.typeCode = newVal;
|
||||
formData.typeCode = newVal;
|
||||
resetQuery();
|
||||
}
|
||||
);
|
||||
@@ -121,9 +122,9 @@ function openDialog(dictId?: number) {
|
||||
* 字典表单提交
|
||||
*/
|
||||
function handleSubmit() {
|
||||
loading.value = false;
|
||||
dataFormRef.value.validate((isValid: boolean) => {
|
||||
if (isValid) {
|
||||
loading.value = false;
|
||||
const dictId = formData.id;
|
||||
if (dictId) {
|
||||
updateDict(dictId, formData)
|
||||
|
||||
@@ -96,9 +96,9 @@ function openDialog(dicTypeId?: number) {
|
||||
* 字典类型表单提交
|
||||
*/
|
||||
function handleSubmit() {
|
||||
loading.value = false;
|
||||
dataFormRef.value.validate((isValid: boolean) => {
|
||||
if (isValid) {
|
||||
loading.value = false;
|
||||
const dictTypeId = formData.id;
|
||||
if (dictTypeId) {
|
||||
updateDictType(dictTypeId, formData)
|
||||
@@ -166,11 +166,10 @@ const dictDataDialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
});
|
||||
|
||||
// 当前选中的字典类型
|
||||
const selectedDictType = reactive({ typeCode: "", typeName: "" });
|
||||
const selectedDictType = reactive({ typeCode: "", typeName: "" }); // 当前选中的字典类型
|
||||
|
||||
/**
|
||||
* 打开字典弹窗
|
||||
* 打开字典数据弹窗
|
||||
*/
|
||||
function openDictDialog(row: DictTypePageVO) {
|
||||
dictDataDialog.visible = true;
|
||||
@@ -181,7 +180,7 @@ function openDictDialog(row: DictTypePageVO) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭字典弹窗
|
||||
* 关闭字典数据弹窗
|
||||
*/
|
||||
function closeDictDialog() {
|
||||
dictDataDialog.visible = false;
|
||||
|
||||
@@ -111,9 +111,9 @@ function openDialog(roleId?: number) {
|
||||
* 角色表单提交
|
||||
*/
|
||||
function handleSubmit() {
|
||||
loading.value = true;
|
||||
roleFormRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
const roleId = formData.id;
|
||||
if (roleId) {
|
||||
updateRole(roleId, formData)
|
||||
|
||||
Reference in New Issue
Block a user