feat:增加 user 用户的分配角色、重置密码

This commit is contained in:
YunaiV
2025-04-04 10:44:40 +08:00
parent 4870bff2a0
commit 8fa52f0d30
8 changed files with 389 additions and 52 deletions

View File

@@ -8,8 +8,21 @@ import { useDictStore } from '#/store';
const dictStore = useDictStore();
/**
* 获取字典标签
*
* @param dictType 字典类型
* @param value 字典值
* @returns 字典标签
*/
function getDictLabel(dictType: string, value: any) {
const dictObj = dictStore.getDictData(dictType, value);
return isObject(dictObj)? dictObj.label : '';
}
/**
* 获取字典对象
*
* @param dictType 字典类型
* @param value 字典值
* @returns 字典对象
@@ -21,6 +34,7 @@ function getDictObj(dictType: string, value: any) {
/**
* 获取字典数组 用于select radio 等
*
* @param dictType 字典类型
* @returns 字典数组
*/
@@ -191,4 +205,4 @@ enum DICT_TYPE {
TRADE_ORDER_TYPE = 'trade_order_type', // 订单 - 类型
USER_TYPE = 'user_type',
}
export { DICT_TYPE, getDictObj, getDictOptions };
export { DICT_TYPE, getDictObj, getDictLabel, getDictOptions };