From 2801f5c8ceb1b7ddb77e79d757160c5cb89ff067 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期一, 04 八月 2025 17:11:39 +0800 Subject: [PATCH] 个人资料更改 --- src/utils/auth.ts | 131 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 128 insertions(+), 3 deletions(-) diff --git a/src/utils/auth.ts b/src/utils/auth.ts index bf688e0..d4646a5 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -1,6 +1,7 @@ import Cookies from "js-cookie"; import { useUserStoreHook } from "@/store/modules/user"; import { storageLocal, isString, isIncludeAllChildren } from "@pureadmin/utils"; +import type { nowRoleType } from "@/store/types"; export interface DataInfo<T> { /** token */ @@ -19,6 +20,130 @@ exRoles?: Array<string>; /** 褰撳墠鐧诲綍鐢ㄦ埛鐨勬寜閽骇鍒潈闄� */ permissions?: Array<string>; +} +/** + * AdminResult_CusExtendDto锛屽叏灞�杩斿洖缁撴灉 + */ +export interface ResponseEnterprise { + /** + * 鐘舵�佺爜 + */ + code?: number; + /** + * 闄勫姞鏁版嵁 + */ + extras?: null; + /** + * 閿欒淇℃伅 + */ + message?: null | string; + result?: CusExtendDto; + /** + * 鏃堕棿 + */ + time?: Date; + /** + * 绫诲瀷success銆亀arning銆乪rror + */ + type?: null | string; +} + +/** + * CusExtendDto锛岀敤鎴疯鑹茶祫鏂� + */ +export interface CusExtendDto { + /** + * 浼佷笟閾惰璐﹀彿 + */ + bankAccount?: null | string; + /** + * 浼佷笟寮�鎴疯 + */ + bankName?: null | string; + /** + * 钀ヤ笟鎵х収鏂囦欢璺緞 + */ + businessLicense?: null | string; + /** + * 浼佷笟閭 + */ + enterpriseEmail?: null | string; + /** + * 浼佷笟鍚嶇О + */ + enterpriseName?: null | string; + /** + * 浼佷笟鑱旂郴鐢佃瘽 + */ + enterprisePhone?: null | string; + /** + * 浼佷笟绫诲瀷 浠庝紒涓氱被鍨嬩腑閫夋嫨 鏉ユ簮浼佷笟绫诲瀷 + */ + enterpriseType?: null | string; + /** + * 浼佷笟鎴愮珛鏃堕棿 + */ + establishmentTime?: Date; + /** + * 涓婚敭 + */ + id?: number | null; + /** + * 娉曞畾浠h〃浜鸿韩浠借瘉鏂囦欢璺緞 + */ + legalRepresentativeIdCard?: null | string; + /** + * 娉曞畾浠h〃浜鸿韩浠借瘉鍙风爜 + */ + legalRepresentativeIdNumber?: null | string; + /** + * 娉曞畾浠h〃浜哄鍚� + */ + legalRepresentativeName?: null | string; + /** + * 娉曞畾浠h〃浜鸿仈绯荤數璇� + */ + legalRepresentativePhone?: null | string; + /** + * 浼佷笟涓昏惀涓氬姟 + */ + mainBusiness?: null | string; + /** + * 涓氬姟缁忓姙浜鸿韩浠借瘉鏂囦欢璺緞鎴栨爣璇嗭紙涓婁紶鍚庡瓨鍌ㄤ俊鎭級 + */ + operatorIdCard?: null | string; + /** + * 涓氬姟缁忓姙浜鸿韩浠借瘉鍙风爜 + */ + operatorIdNumber?: null | string; + /** + * 涓氬姟缁忓姙浜哄鍚� + */ + operatorName?: null | string; + /** + * 涓氬姟缁忓姙浜鸿仈绯荤數璇� + */ + operatorPhone?: null | string; + /** + * 娉ㄥ唽璧勯噾锛堝崟浣嶏細涓囧厓 锛� + */ + registeredCapital?: null | string; + /** + * 浼佷笟浣忔墍锛堜笅鎷夐�夋嫨锛岄渶缁撳悎瀹為檯鍙�夊�硷紝鍏堝瓧绗︿覆鎺ユ敹 锛� + */ + residence?: null | string; + /** + * 浜ゆ槗涓讳綋 浠g爜 鍚岃鑹蹭唬鐮� + */ + transactionCode: string; + /** + * 浜ゆ槗涓讳綋鍚嶇О + */ + transactionName?: null | string; + /** + * 缁熶竴绀句細淇$敤浠g爜 + */ + unifiedSocialCreditCode?: null | string; } export const userKey = "user-info"; @@ -115,7 +240,7 @@ } } -export function setEnterpriseInfo(data: DataInfo<Date>) { +export function setEnterpriseInfo(data: CusExtendDto) { useUserStoreHook().SET_ENTERPRISEINFO(data); useUserStoreHook().SET_USERNAME(data.enterpriseName); storageLocal().setItem("enterpriseInfo", data); @@ -124,12 +249,12 @@ storageLocal().setItem(userKey, obj); } -export function setRoleListInfo(data: DataInfo<Date>) { +export function setRoleListInfo(data: DataInfo<string>) { useUserStoreHook().SET_ROLES_LIST(data); storageLocal().setItem("rolesList", data); } -export function setNowRole(data: DataInfo<Date>) { +export function setNowRole(data: nowRoleType) { const list = storageLocal().getItem<DataInfo<number>>(userKey)?.exRoles ?? []; if (list.length > 0) { const obj = list.find(item => { -- Gitblit v1.9.1