1个文件已删除
5个文件已添加
1 文件已重命名
18个文件已修改
| | |
| | | "pinia": "^2.1.6", |
| | | "qs": "^6.11.1", |
| | | "senin-mini": "^1.0.12", |
| | | "senior-request": "^1.0.3", |
| | | "senior-request": "^1.0.10", |
| | | "taro-plugin-pinia": "^1.0.0", |
| | | "vconsole": "^3.15.1", |
| | | "vue": "3.5.12", |
| | |
| | | |
| | | import '@nutui/nutui-taro/dist/style.css'; |
| | | import './app.scss'; |
| | | |
| | | import '@/utils/setConfig'; |
| | | import { setupStore } from '@/stores'; |
| | | |
| | | import { useSystemStore } from '@/stores/modules/system'; |
| | |
| | | import qs from 'qs'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { getToken } from '@/utils'; |
| | | import { tokenIsExpired, Message, SensitiveManage } from '@12333/utils'; |
| | | import { tokenIsExpired, Message, SensitiveManage, httpLoggerRecord } from '@12333/utils'; |
| | | import { useUserStoreWithOut } from '@/stores/modules/user'; |
| | | |
| | | const RefreshTokenUrl = '/gettokenbyrefreshtoken'; |
| | |
| | | */ |
| | | msg?: string; |
| | | showType?: ErrorShowType; |
| | | traceId?: string; |
| | | } |
| | | |
| | | interface ErrorResponse { |
| | |
| | | // 错误接收及处理 |
| | | errorHandler: (error, opts) => { |
| | | console.log('error: ', error); |
| | | |
| | | const url = opts.url ?? ''; |
| | | httpLoggerRecord.error({ |
| | | message: `[${url}] 请求错误`, |
| | | httpParams: { |
| | | url: url, |
| | | //@ts-ignore |
| | | traceId: error?.info?.traceId, |
| | | stackTrace: error.stack, |
| | | }, |
| | | args: [{ data: opts.data, params: opts.params, headers: opts.headers }], |
| | | }); |
| | | |
| | | if (opts?.skipErrorHandler) throw error; |
| | | |
| | | if (opts?.customErrorHandler) { |
| | |
| | | (config) => { |
| | | const $config = config; |
| | | |
| | | httpLoggerRecord.info({ |
| | | message: `[${$config.url}] 请求开始`, |
| | | httpParams: { |
| | | url: $config.url, |
| | | }, |
| | | args: [{ data: $config.data, params: $config.params, headers: $config.headers }], |
| | | }); |
| | | |
| | | const token = getToken(); |
| | | |
| | | const userStore = useUserStoreWithOut(); |
| | |
| | | (response) => { |
| | | const $config = response.config as IRequestOptions; |
| | | |
| | | httpLoggerRecord.info({ |
| | | message: `[${$config.url}] 请求结束`, |
| | | httpParams: { |
| | | url: $config.url, |
| | | traceId: response.data?.traceId, |
| | | }, |
| | | args: [{ data: $config.data, params: $config.params, headers: $config.headers }], |
| | | }); |
| | | |
| | | const { needNProcess, getResponse = false } = $config; |
| | | |
| | | const userStore = useUserStoreWithOut(); |
New file |
| | |
| | | import { setUtilsConfig } from '@12333/utils/config'; |
| | | |
| | | setUtilsConfig({ |
| | | appName: '灵工达小程序', |
| | | }); |
| | |
| | | import { storageLocal } from './storage'; |
| | | import { storageLocal } from '@12333/utils'; |
| | | import { useUserStoreWithOut } from '@/stores/modules/user'; |
| | | |
| | | const StorageKey = { |
| | |
| | | export * from './storage'; |
| | | export * from './auth'; |
| | |
| | | "pinia": "^2.1.6", |
| | | "qs": "^6.11.1", |
| | | "senin-mini": "^1.0.12", |
| | | "senior-request": "^1.0.3", |
| | | "senior-request": "^1.0.10", |
| | | "taro-plugin-pinia": "^1.0.0", |
| | | "vconsole": "^3.15.1", |
| | | "vue": "3.5.12", |
| | |
| | | "description": "", |
| | | "setting": { |
| | | "urlCheck": false, |
| | | "es6": true, |
| | | "enhance": true, |
| | | "es6": false, |
| | | "enhance": false, |
| | | "postcss": false, |
| | | "preloadBackgroundData": false, |
| | | "minified": false, |
| | |
| | | |
| | | import '@nutui/nutui-taro/dist/style.css'; |
| | | import './app.scss'; |
| | | |
| | | import '@/utils/setConfig'; |
| | | import { setupStore } from '@/stores'; |
| | | |
| | | import { useSystemStore } from '@/stores/modules/system'; |
| | |
| | | import qs from 'qs'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { getToken } from '@/utils'; |
| | | import { tokenIsExpired, Message, SensitiveManage } from '@12333/utils'; |
| | | import { tokenIsExpired, Message, SensitiveManage, httpLoggerRecord } from '@12333/utils'; |
| | | import { useUserStoreWithOut } from '@/stores/modules/user'; |
| | | |
| | | const RefreshTokenUrl = '/gettokenbyrefreshtoken'; |
| | |
| | | */ |
| | | msg?: string; |
| | | showType?: ErrorShowType; |
| | | traceId?: string; |
| | | } |
| | | |
| | | interface ErrorResponse { |
| | |
| | | // 错误接收及处理 |
| | | errorHandler: (error, opts) => { |
| | | console.log('error: ', error); |
| | | |
| | | const url = opts.url ?? ''; |
| | | httpLoggerRecord.error({ |
| | | message: `[${url}] 请求错误`, |
| | | httpParams: { |
| | | url: url, |
| | | //@ts-ignore |
| | | traceId: error?.info?.traceId, |
| | | stackTrace: error.stack, |
| | | }, |
| | | args: [{ data: opts.data, params: opts.params, headers: opts.headers }], |
| | | }); |
| | | |
| | | if (opts?.skipErrorHandler) throw error; |
| | | |
| | | if (opts?.customErrorHandler) { |
| | |
| | | (config) => { |
| | | const $config = config; |
| | | |
| | | httpLoggerRecord.info({ |
| | | message: `[${$config.url}] 请求开始`, |
| | | httpParams: { |
| | | url: $config.url, |
| | | }, |
| | | args: [{ data: $config.data, params: $config.params, headers: $config.headers }], |
| | | }); |
| | | |
| | | const token = getToken(); |
| | | |
| | | const userStore = useUserStoreWithOut(); |
| | |
| | | (response) => { |
| | | const $config = response.config as IRequestOptions; |
| | | |
| | | httpLoggerRecord.info({ |
| | | message: `[${$config.url}] 请求结束`, |
| | | httpParams: { |
| | | url: $config.url, |
| | | traceId: response.data?.traceId, |
| | | }, |
| | | args: [{ data: $config.data, params: $config.params, headers: $config.headers }], |
| | | }); |
| | | |
| | | const { needNProcess, getResponse = false } = $config; |
| | | |
| | | const userStore = useUserStoreWithOut(); |
New file |
| | |
| | | import { setUtilsConfig } from '@12333/utils/config'; |
| | | |
| | | setUtilsConfig({ |
| | | appName: '工易赚小程序', |
| | | }); |
| | |
| | | import { storageLocal } from './storage'; |
| | | import { storageLocal } from '@12333/utils'; |
| | | import { useUserStoreWithOut } from '@/stores/modules/user'; |
| | | |
| | | const StorageKey = { |
| | |
| | | export * from './storage'; |
| | | export * from './auth'; |
| | |
| | | ElectronSignUrl = 10, |
| | | } |
| | | |
| | | /** 控制台日志通道 */ |
| | | export enum EnumConsoleLogAccess { |
| | | /**后端 */ |
| | | Back = 10, |
| | | /**前端 */ |
| | | Front = 20, |
| | | } |
| | | |
| | | /** 合同制版状态 */ |
| | | export enum EnumContractTemplateStatus { |
| | | /**待制版 */ |
| | |
| | | Pass = 30, |
| | | } |
| | | |
| | | /** 日志级别 */ |
| | | export enum EnumLogLevel { |
| | | /**跟踪 */ |
| | | Trace = 10, |
| | | /**调试 */ |
| | | Debug = 20, |
| | | /**信息 */ |
| | | Information = 30, |
| | | /**警告 */ |
| | | Warning = 40, |
| | | /**错误 */ |
| | | Error = 50, |
| | | /**严重 */ |
| | | Critical = 60, |
| | | } |
| | | |
| | | /** 菜单类型 */ |
| | | export enum EnumMenuType { |
| | | /**菜单 */ |
| | |
| | | CommonServerLogRecords = 7, |
| | | /**同步数据库 */ |
| | | CommonServerSyncDatabase = 8, |
| | | /**短信工具 */ |
| | | CommonServerSmsUtils = 9, |
| | | /**用户认证 */ |
| | | UserServerAuth = 9, |
| | | UserServerAuth = 10, |
| | | /**用户菜单 */ |
| | | UserServerMenu = 10, |
| | | UserServerMenu = 11, |
| | | /**用户资源 */ |
| | | UserServerResource = 11, |
| | | UserServerResource = 12, |
| | | /**用户角色 */ |
| | | UserServerRole = 12, |
| | | UserServerRole = 13, |
| | | /**用户信息 */ |
| | | UserServerUser = 13, |
| | | UserServerUser = 14, |
| | | /**电子签 */ |
| | | UserServerElectronSign = 14, |
| | | UserServerElectronSign = 15, |
| | | /**用户简历 */ |
| | | UserServerUserResume = 15, |
| | | UserServerUserResume = 16, |
| | | /**企业信息 */ |
| | | UserServerEnterprise = 16, |
| | | UserServerEnterprise = 17, |
| | | /**企业钱包 */ |
| | | UserServerEnterpriseWallet = 17, |
| | | UserServerEnterpriseWallet = 18, |
| | | /**灵工信息 */ |
| | | UserServerEnterpriseEmployee = 18, |
| | | UserServerEnterpriseEmployee = 19, |
| | | /**电子签 */ |
| | | ElectronSignServerElectronSign = 19, |
| | | ElectronSignServerElectronSign = 20, |
| | | } |
| | | |
| | | /** 资源请求方式 */ |
| | |
| | | AliyunSms = 10, |
| | | } |
| | | |
| | | /** 短信状态 */ |
| | | export enum EnumSmsStatus { |
| | | /**待发送 */ |
| | | Wait = 0, |
| | | /**发送中 */ |
| | | InProcess = 10, |
| | | /**发送成功 */ |
| | | Success = 20, |
| | | /**发送失败 */ |
| | | Fail = 30, |
| | | } |
| | | |
| | | /** 任务结算状态 */ |
| | | export enum EnumTaskCheckReceiveStatus { |
| | | /**待提交 */ |
| | |
| | | import * as enterpriseEmployee from './enterpriseEmployee'; |
| | | import * as user from './user'; |
| | | import * as role from './role'; |
| | | import * as sms from './sms'; |
| | | import * as ocrUtils from './ocrUtils'; |
| | | import * as task from './task'; |
| | | import * as enterprise from './enterprise'; |
| | |
| | | enterpriseEmployee, |
| | | user, |
| | | role, |
| | | sms, |
| | | ocrUtils, |
| | | task, |
| | | enterprise, |
| | |
| | | // @ts-ignore |
| | | import { request } from '@/utils/request'; |
| | | |
| | | /** 控制台日志分页列表查询 POST /api/common/logRecords/getConsoleLogs */ |
| | | export async function getConsoleLogs(body: API.GetConsoleLogsQuery, options?: API.RequestConfig) { |
| | | return request<API.GetConsoleLogsQueryResult>('/api/common/logRecords/getConsoleLogs', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 查询数据库审计日志分页列表 POST /api/common/logRecords/getDbAuditLogs */ |
| | | export async function getDbAuditLogs(body: API.GetDbAuditLogsQuery, options?: API.RequestConfig) { |
| | | return request<API.GetDbAuditLogsQueryResult>('/api/common/logRecords/getDbAuditLogs', { |
| | |
| | | /** 资源日志分页列表查询 POST /api/common/logRecords/getResourceLogs */ |
| | | export async function getResourceLogs(body: API.GetResourceLogsQuery, options?: API.RequestConfig) { |
| | | return request<API.GetResourceLogsQueryResult>('/api/common/logRecords/getResourceLogs', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 查询短信日志 POST /api/common/logRecords/getSmsLogs */ |
| | | export async function getSmsLogs(body: API.GetSmsLogsQuery, options?: API.RequestConfig) { |
| | | return request<API.GetSmsLogsQueryResult>('/api/common/logRecords/getSmsLogs', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 保存前端日志 POST /api/common/logRecords/saveFrontConsoleLog */ |
| | | export async function saveFrontConsoleLog( |
| | | body: API.SaveFrontConsoleLogCommand, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<string>('/api/common/logRecords/saveFrontConsoleLog', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
New file |
| | |
| | | /* eslint-disable */ |
| | | // @ts-ignore |
| | | import { request } from '@/utils/request'; |
| | | |
| | | /** 查询短信配置 POST /api/common/sms/getSmsSetting */ |
| | | export async function getSmsSetting(body: API.GetSmsSettingQuery, options?: API.RequestConfig) { |
| | | return request<API.GetSmsSettingQueryResult>('/api/common/sms/getSmsSetting', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 保存短信配置 POST /api/common/sms/saveSmsSetting */ |
| | | export async function saveSmsSetting(body: API.SaveSmsSettingCommand, options?: API.RequestConfig) { |
| | | return request<string>('/api/common/sms/saveSmsSetting', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 诚立业短信平台回传通知 POST /api/common/sms/smsChengLiYeNotify */ |
| | | export async function smsChengLiYeNotify( |
| | | body: API.SmsChengLiYeNotifyCommand, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<boolean>('/api/common/sms/smsChengLiYeNotify', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | |
| | | ElectronSignUrl = 10, |
| | | } |
| | | |
| | | enum EnumConsoleLogAccess { |
| | | /**后端 */ |
| | | Back = 10, |
| | | /**前端 */ |
| | | Front = 20, |
| | | } |
| | | |
| | | enum EnumContractTemplateStatus { |
| | | /**待制版 */ |
| | | Wait = 10, |
| | |
| | | Pass = 30, |
| | | } |
| | | |
| | | enum EnumLogLevel { |
| | | /**跟踪 */ |
| | | Trace = 10, |
| | | /**调试 */ |
| | | Debug = 20, |
| | | /**信息 */ |
| | | Information = 30, |
| | | /**警告 */ |
| | | Warning = 40, |
| | | /**错误 */ |
| | | Error = 50, |
| | | /**严重 */ |
| | | Critical = 60, |
| | | } |
| | | |
| | | enum EnumMenuType { |
| | | /**菜单 */ |
| | | Menu = 10, |
| | |
| | | CommonServerLogRecords = 7, |
| | | /**同步数据库 */ |
| | | CommonServerSyncDatabase = 8, |
| | | /**短信工具 */ |
| | | CommonServerSmsUtils = 9, |
| | | /**用户认证 */ |
| | | UserServerAuth = 9, |
| | | UserServerAuth = 10, |
| | | /**用户菜单 */ |
| | | UserServerMenu = 10, |
| | | UserServerMenu = 11, |
| | | /**用户资源 */ |
| | | UserServerResource = 11, |
| | | UserServerResource = 12, |
| | | /**用户角色 */ |
| | | UserServerRole = 12, |
| | | UserServerRole = 13, |
| | | /**用户信息 */ |
| | | UserServerUser = 13, |
| | | UserServerUser = 14, |
| | | /**电子签 */ |
| | | UserServerElectronSign = 14, |
| | | UserServerElectronSign = 15, |
| | | /**用户简历 */ |
| | | UserServerUserResume = 15, |
| | | UserServerUserResume = 16, |
| | | /**企业信息 */ |
| | | UserServerEnterprise = 16, |
| | | UserServerEnterprise = 17, |
| | | /**企业钱包 */ |
| | | UserServerEnterpriseWallet = 17, |
| | | UserServerEnterpriseWallet = 18, |
| | | /**灵工信息 */ |
| | | UserServerEnterpriseEmployee = 18, |
| | | UserServerEnterpriseEmployee = 19, |
| | | /**电子签 */ |
| | | ElectronSignServerElectronSign = 19, |
| | | ElectronSignServerElectronSign = 20, |
| | | } |
| | | |
| | | enum EnumResourceMethod { |
| | |
| | | enum EnumSmsAccess { |
| | | /**阿里云短信 */ |
| | | AliyunSms = 10, |
| | | } |
| | | |
| | | enum EnumSmsStatus { |
| | | /**待发送 */ |
| | | Wait = 0, |
| | | /**发送中 */ |
| | | InProcess = 10, |
| | | /**发送成功 */ |
| | | Success = 20, |
| | | /**发送失败 */ |
| | | Fail = 30, |
| | | } |
| | | |
| | | enum EnumTaskCheckReceiveStatus { |
| | |
| | | /** 错误码 */ |
| | | errorCode?: string; |
| | | data?: GetCodeUrlQueryResult; |
| | | /** 执行成功 */ |
| | | success?: boolean; |
| | | /** 错误信息 */ |
| | | msg?: any; |
| | | /** 附加数据 */ |
| | | extras?: any; |
| | | /** 时间戳 */ |
| | | timestamp?: number; |
| | | } |
| | | |
| | | interface FriendlyResultGetConsoleLogsQueryResult { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 状态码 */ |
| | | code?: number; |
| | | /** 错误码 */ |
| | | errorCode?: string; |
| | | data?: GetConsoleLogsQueryResult; |
| | | /** 执行成功 */ |
| | | success?: boolean; |
| | | /** 错误信息 */ |
| | |
| | | /** 错误码 */ |
| | | errorCode?: string; |
| | | data?: GetSettlementTaskUsersQueryResult; |
| | | /** 执行成功 */ |
| | | success?: boolean; |
| | | /** 错误信息 */ |
| | | msg?: any; |
| | | /** 附加数据 */ |
| | | extras?: any; |
| | | /** 时间戳 */ |
| | | timestamp?: number; |
| | | } |
| | | |
| | | interface FriendlyResultGetSmsLogsQueryResult { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 状态码 */ |
| | | code?: number; |
| | | /** 错误码 */ |
| | | errorCode?: string; |
| | | data?: GetSmsLogsQueryResult; |
| | | /** 执行成功 */ |
| | | success?: boolean; |
| | | /** 错误信息 */ |
| | | msg?: any; |
| | | /** 附加数据 */ |
| | | extras?: any; |
| | | /** 时间戳 */ |
| | | timestamp?: number; |
| | | } |
| | | |
| | | interface FriendlyResultGetSmsSettingQueryResult { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 状态码 */ |
| | | code?: number; |
| | | /** 错误码 */ |
| | | errorCode?: string; |
| | | data?: GetSmsSettingQueryResult; |
| | | /** 执行成功 */ |
| | | success?: boolean; |
| | | /** 错误信息 */ |
| | |
| | | paramValue5?: string; |
| | | } |
| | | |
| | | interface GetConsoleLogsQuery { |
| | | access?: EnumConsoleLogAccess; |
| | | level?: EnumLogLevel; |
| | | /** 创建时间-起始 */ |
| | | createdTimeBegin?: string; |
| | | /** 创建时间-截止 */ |
| | | createdTimeEnd?: string; |
| | | /** 操作人 */ |
| | | createdUser?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 内容 */ |
| | | content?: string; |
| | | /** 链接地址 */ |
| | | url?: string; |
| | | /** 传参 */ |
| | | request?: string; |
| | | /** 扩展 */ |
| | | ext?: string; |
| | | pageModel?: PagedListQueryPageModel; |
| | | } |
| | | |
| | | interface GetConsoleLogsQueryResult { |
| | | pageModel?: PagedListQueryResultPageModel; |
| | | /** 数据 */ |
| | | data?: GetConsoleLogsQueryResultItem[]; |
| | | } |
| | | |
| | | interface GetConsoleLogsQueryResultItem { |
| | | /** Id */ |
| | | id?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | access?: EnumConsoleLogAccess; |
| | | level?: EnumLogLevel; |
| | | /** 内容 */ |
| | | content: string; |
| | | /** 堆栈跟踪 */ |
| | | stackTrace?: string; |
| | | /** 链接地址 */ |
| | | url?: string; |
| | | /** 传参 */ |
| | | request?: string; |
| | | /** 扩展 */ |
| | | ext?: string; |
| | | /** 客户IP地址 */ |
| | | clientIpAddress?: string; |
| | | createdUser?: GetLogsQueryResultItemCreatedUser; |
| | | /** 创建时间 */ |
| | | createdTime?: string; |
| | | } |
| | | |
| | | interface GetContractTemplateEnterprisesQuery { |
| | | /** 关键字 */ |
| | | keywords?: string; |
| | |
| | | type GetCurrentLogierMenusQuery = Record<string, any>; |
| | | |
| | | interface GetDbAuditLogsQuery { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 关键字 */ |
| | | keywords?: string; |
| | | /** 创建时间-起始 */ |
| | | createdTimeBegin?: string; |
| | | /** 创建时间-截止 */ |
| | | createdTimeEnd?: string; |
| | | /** 操作人 */ |
| | | createdUser?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 表名 */ |
| | | tableName?: string; |
| | | /** 主键 */ |
| | | primaryKey?: string; |
| | | operate?: EnumDbAuditOperate; |
| | | /** 旧值 */ |
| | | oldValues?: string; |
| | | /** 新值 */ |
| | | newValues?: string; |
| | | pageModel?: PagedListQueryPageModel; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | interface GetDbAuditLogsQueryResultItem { |
| | | /** Id */ |
| | | id?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 表名 */ |
| | | tableName?: string; |
| | | /** 主键 */ |
| | |
| | | oldValues?: string; |
| | | /** 新值 */ |
| | | newValues?: string; |
| | | createdUser?: GetResourceLogsQueryResultItemCreatedUser; |
| | | createdUser?: GetLogsQueryResultItemCreatedUser; |
| | | /** 创建时间 */ |
| | | createdTime?: string; |
| | | } |
| | |
| | | } |
| | | |
| | | interface GetExceptionLogsQuery { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 关键字 */ |
| | | keywords?: string; |
| | | /** 创建时间-起始 */ |
| | | createdTimeBegin?: string; |
| | | /** 创建时间-截止 */ |
| | | createdTimeEnd?: string; |
| | | /** 操作人 */ |
| | | createdUser?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 类型 */ |
| | | type?: string; |
| | | /** 代码 */ |
| | | code?: string; |
| | | /** 消息 */ |
| | | message?: string; |
| | | pageModel?: PagedListQueryPageModel; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | interface GetExceptionLogsQueryResultItem { |
| | | /** Id */ |
| | | id?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 类型 */ |
| | | type?: string; |
| | | /** 代码 */ |
| | |
| | | message?: string; |
| | | /** 堆栈跟踪 */ |
| | | stackTrace?: string; |
| | | createdUser?: GetResourceLogsQueryResultItemCreatedUser; |
| | | createdUser?: GetLogsQueryResultItemCreatedUser; |
| | | /** 创建时间 */ |
| | | createdTime?: string; |
| | | } |
| | |
| | | /** 地址 */ |
| | | url?: string; |
| | | model?: BaiduOcrBusinessLicenseResultModel; |
| | | } |
| | | |
| | | interface GetLogsQueryResultItemCreatedUser { |
| | | /** Id */ |
| | | id?: string; |
| | | type?: EnumUserType; |
| | | /** 姓名 */ |
| | | name?: string; |
| | | /** 用户名 */ |
| | | userName?: string; |
| | | /** 企业Id */ |
| | | enterpriseId?: string; |
| | | /** 企业全称 */ |
| | | enterpriseName?: string; |
| | | } |
| | | |
| | | interface GetMenuQueryResult { |
| | |
| | | } |
| | | |
| | | interface GetResourceLogsQuery { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 关键字 */ |
| | | keywords?: string; |
| | | /** 创建时间-起始 */ |
| | | createdTimeBegin?: string; |
| | | /** 创建时间-截止 */ |
| | | createdTimeEnd?: string; |
| | | /** 操作人 */ |
| | | createdUser?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | method?: EnumResourceMethod; |
| | | /** 域名 */ |
| | | domain?: string; |
| | | /** 地址 */ |
| | | path?: string; |
| | | /** 请求参数 */ |
| | | request?: string; |
| | | /** 响应结果 */ |
| | | response?: string; |
| | | /** 是否成功 */ |
| | | isSuccess?: boolean; |
| | | /** 客户端IP地址 */ |
| | | clientIpAddress?: string; |
| | | /** 最小耗时毫秒数 */ |
| | | elapsedMillisecondsMin?: number; |
| | | pageModel?: PagedListQueryPageModel; |
| | | } |
| | | |
| | |
| | | interface GetResourceLogsQueryResultItem { |
| | | /** Id */ |
| | | id?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | method?: EnumResourceMethod; |
| | | /** 域名 */ |
| | | domain?: string; |
| | |
| | | consoleLogs?: string; |
| | | /** 耗时毫秒数 */ |
| | | elapsedMilliseconds?: number; |
| | | createdUser?: GetResourceLogsQueryResultItemCreatedUser; |
| | | createdUser?: GetLogsQueryResultItemCreatedUser; |
| | | /** 创建时间 */ |
| | | createdTime?: string; |
| | | } |
| | | |
| | | interface GetResourceLogsQueryResultItemCreatedUser { |
| | | /** Id */ |
| | | id?: string; |
| | | type?: EnumUserType; |
| | | /** 姓名 */ |
| | | name?: string; |
| | | /** 用户名 */ |
| | | userName?: string; |
| | | /** 企业Id */ |
| | | enterpriseId?: string; |
| | | /** 企业全称 */ |
| | | enterpriseName?: string; |
| | | } |
| | | |
| | | interface GetResourcesQueryResultItem { |
| | |
| | | createdTime?: string; |
| | | /** 电子收据下载链接 */ |
| | | ereceiptDownloadOssUrl?: string; |
| | | } |
| | | |
| | | interface GetSmsLogsQuery { |
| | | /** 创建时间-起始 */ |
| | | createdTimeBegin?: string; |
| | | /** 创建时间-截止 */ |
| | | createdTimeEnd?: string; |
| | | /** 操作人 */ |
| | | createdUser?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | access?: EnumSmsAccess; |
| | | /** 手机号码 */ |
| | | phoneNumber?: string; |
| | | /** 模板代码 */ |
| | | templateCode?: string; |
| | | /** 模板参数 */ |
| | | templateParam?: string; |
| | | /** 是否使用 */ |
| | | isUsed?: boolean; |
| | | status?: EnumSmsStatus; |
| | | pageModel?: PagedListQueryPageModel; |
| | | } |
| | | |
| | | interface GetSmsLogsQueryResult { |
| | | pageModel?: PagedListQueryResultPageModel; |
| | | /** 数据 */ |
| | | data?: GetSmsLogsQueryResultItem[]; |
| | | } |
| | | |
| | | interface GetSmsLogsQueryResultItem { |
| | | /** Id */ |
| | | id?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | access?: EnumSmsAccess; |
| | | /** 手机号码 */ |
| | | phoneNumber?: string; |
| | | /** 模板代码 */ |
| | | templateCode?: string; |
| | | /** 模板参数 */ |
| | | templateParam?: string; |
| | | /** 有效期 */ |
| | | expiry?: string; |
| | | /** 是否使用 */ |
| | | isUsed?: boolean; |
| | | status?: EnumSmsStatus; |
| | | /** 请求Id */ |
| | | requestId?: string; |
| | | /** 回传代码 */ |
| | | code?: string; |
| | | /** 回传消息 */ |
| | | message?: string; |
| | | /** 操作人Id */ |
| | | createdUserId?: string; |
| | | createdUser?: GetLogsQueryResultItemCreatedUser; |
| | | /** 创建时间 */ |
| | | createdTime?: string; |
| | | } |
| | | |
| | | type GetSmsSettingQuery = Record<string, any>; |
| | | |
| | | interface GetSmsSettingQueryResult { |
| | | /** 是否禁用 */ |
| | | isDisabled?: boolean; |
| | | /** 带出参数 */ |
| | | withoutParams?: boolean; |
| | | /** 每分钟最大数量 */ |
| | | minutelyMaxCount?: number; |
| | | /** 每小时最大数量 */ |
| | | hourlyMaxCount?: number; |
| | | /** 每天最大数量 */ |
| | | dailyMaxCount?: number; |
| | | /** 通道配置 */ |
| | | accesses?: GetSmsSettingQueryResultAccess[]; |
| | | } |
| | | |
| | | interface GetSmsSettingQueryResultAccess { |
| | | access?: EnumSmsAccess; |
| | | /** 是否禁用 */ |
| | | isDisabled?: boolean; |
| | | /** 排序 */ |
| | | sort?: number; |
| | | } |
| | | |
| | | interface GetTaskEnterpriseQueryResult { |
| | |
| | | } |
| | | |
| | | interface GetThreeResourceLogsQuery { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 关键字 */ |
| | | keywords?: string; |
| | | /** 创建时间-起始 */ |
| | | createdTimeBegin?: string; |
| | | /** 创建时间-截止 */ |
| | | createdTimeEnd?: string; |
| | | /** 操作人 */ |
| | | createdUser?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | method?: EnumResourceMethod; |
| | | /** 域名 */ |
| | | domain?: string; |
| | | /** 地址 */ |
| | | path?: string; |
| | | /** 请求参数 */ |
| | | request?: string; |
| | | /** 响应结果 */ |
| | | response?: string; |
| | | /** 是否成功 */ |
| | | isSuccess?: boolean; |
| | | /** 客户端IP地址 */ |
| | | clientIpAddress?: string; |
| | | /** 最小耗时毫秒数 */ |
| | | elapsedMillisecondsMin?: number; |
| | | pageModel?: PagedListQueryPageModel; |
| | | } |
| | | |
| | |
| | | interface GetThreeResourceLogsQueryResultItem { |
| | | /** Id */ |
| | | id?: string; |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | method?: EnumResourceMethod; |
| | | /** 域名 */ |
| | | domain?: string; |
| | |
| | | isSuccess?: boolean; |
| | | /** 耗时毫秒数 */ |
| | | elapsedMilliseconds?: number; |
| | | createdUser?: GetThreeResourceLogsQueryResultItemCreatedUser; |
| | | createdUser?: GetLogsQueryResultItemCreatedUser; |
| | | /** 创建时间 */ |
| | | createdTime?: string; |
| | | } |
| | | |
| | | interface GetThreeResourceLogsQueryResultItemCreatedUser { |
| | | /** Id */ |
| | | id?: string; |
| | | type?: EnumUserType; |
| | | /** 姓名 */ |
| | | name?: string; |
| | | /** 用户名 */ |
| | | userName?: string; |
| | | /** 企业Id */ |
| | | enterpriseId?: string; |
| | | /** 企业全称 */ |
| | | enterpriseName?: string; |
| | | } |
| | | |
| | | interface GetTraceIdLogQueryResult { |
| | |
| | | exceptionLogs?: GetExceptionLogsQueryResultItem[]; |
| | | /** 数据库审计日志 */ |
| | | dbAuditLogs?: GetDbAuditLogsQueryResultItem[]; |
| | | /** 控制台日志 */ |
| | | consoleLogs?: GetConsoleLogsQueryResultItem[]; |
| | | } |
| | | |
| | | interface GetUserInfoRolesQueryResultItem { |
| | |
| | | } |
| | | |
| | | interface PersonalUserElectronSignCommandResult { |
| | | userSignContractStatus?: EnumTaskUserSignContractStatus; |
| | | /** 签署合同短链接 */ |
| | | signContractShortUrl?: string; |
| | | /** 签署合同长链接 */ |
| | |
| | | isReal?: boolean; |
| | | realMethod?: EnumUserRealMethod; |
| | | realStatus?: EnumPersonalUserRealStatus; |
| | | /** 是否绑定银行卡 */ |
| | | isBindBankCard?: boolean; |
| | | /** 人脸识别地址 */ |
| | | faceUrl?: string; |
| | | } |
| | |
| | | status?: EnumEnterpriseCostStatus; |
| | | } |
| | | |
| | | interface SaveFrontConsoleLogCommand { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | level?: EnumLogLevel; |
| | | /** 内容 */ |
| | | content: string; |
| | | /** 堆栈跟踪 */ |
| | | stackTrace?: string; |
| | | /** 链接地址 */ |
| | | url?: string; |
| | | /** 传参 */ |
| | | request?: string; |
| | | /** 扩展 */ |
| | | ext?: string; |
| | | } |
| | | |
| | | interface SaveMenuButtonCommand { |
| | | /** 菜单Id */ |
| | | parentId?: string; |
| | |
| | | menuIds?: string[]; |
| | | /** 资源 */ |
| | | resources?: GetRoleQueryResultResource[]; |
| | | } |
| | | |
| | | interface SaveSmsSettingCommand { |
| | | /** 是否禁用 */ |
| | | isDisabled?: boolean; |
| | | /** 带出参数 */ |
| | | withoutParams?: boolean; |
| | | /** 每分钟最大数量 */ |
| | | minutelyMaxCount?: number; |
| | | /** 每小时最大数量 */ |
| | | hourlyMaxCount?: number; |
| | | /** 每天最大数量 */ |
| | | dailyMaxCount?: number; |
| | | /** 通道配置 */ |
| | | accesses?: SaveSmsSettingCommandAccess[]; |
| | | } |
| | | |
| | | interface SaveSmsSettingCommandAccess { |
| | | access?: EnumSmsAccess; |
| | | /** 是否禁用 */ |
| | | isDisabled?: boolean; |
| | | /** 排序 */ |
| | | sort?: number; |
| | | } |
| | | |
| | | interface SaveTaskInfoCommand { |
| | |
| | | status?: EnumUserStatus; |
| | | } |
| | | |
| | | type SmsChengLiYeNotifyCommand = Record<string, any>; |
| | | |
| | | interface SmsLoginCommand { |
| | | /** 手机号码 */ |
| | | phoneNumber?: string; |
New file |
| | |
| | | import * as logRecordsServices from '@12333/services/apiV2/logRecords'; |
| | | import { LoggerRecord, LogOptions, LoggerRecordOptions, LoggerRecordLevel } from 'senior-request'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { EnumLogLevel } from '@12333/constants'; |
| | | import { storageLocal } from '../storage'; |
| | | import { getUtilsConfig } from '../config'; |
| | | |
| | | type HttpLogOptions = { |
| | | httpParams?: Omit<API.SaveFrontConsoleLogCommand, 'level' | 'content'>; |
| | | } & LogOptions; |
| | | |
| | | class HttpLoggerRecord extends LoggerRecord<HttpLogOptions> { |
| | | constructor(options: LoggerRecordOptions = {}) { |
| | | super(options); |
| | | } |
| | | |
| | | convertLogLevel(level: LoggerRecordLevel): EnumLogLevel { |
| | | switch (level) { |
| | | case 'debug': |
| | | return EnumLogLevel.Debug; |
| | | case 'info': |
| | | return EnumLogLevel.Information; |
| | | case 'warn': |
| | | return EnumLogLevel.Warning; |
| | | case 'error': |
| | | return EnumLogLevel.Error; |
| | | case 'log': |
| | | return EnumLogLevel.Trace; |
| | | default: |
| | | return EnumLogLevel.Debug; |
| | | } |
| | | } |
| | | |
| | | log(level: LoggerRecordLevel, options: HttpLogOptions): void { |
| | | const httpUrl = options?.httpParams?.url ?? ''; |
| | | if (httpUrl.toLowerCase().includes('saveFrontConsoleLog'.toLowerCase())) return; |
| | | const args = [...(options.args || []), options.httpParams].filter(Boolean); |
| | | super.log(level, { |
| | | ...options, |
| | | args: args, |
| | | }); |
| | | let params: API.SaveFrontConsoleLogCommand = { |
| | | /** 跟踪Id */ |
| | | traceId: options.httpParams?.traceId, |
| | | level: this.convertLogLevel(level), |
| | | /** 内容 */ |
| | | content: `[${this.config.moduleName}] ${options.message}`, |
| | | /** 堆栈跟踪 */ |
| | | stackTrace: options.httpParams?.stackTrace, |
| | | /** 链接地址 */ |
| | | url: options.httpParams?.url, |
| | | ext: JSON.stringify(args), |
| | | }; |
| | | logRecordsServices.saveFrontConsoleLog(params, { showLoading: false, skipErrorHandler: true }); |
| | | } |
| | | } |
| | | |
| | | export const httpLoggerRecord = new HttpLoggerRecord({ |
| | | moduleName: getUtilsConfig().appName, |
| | | enableStorage: true, |
| | | loggerStorageAdapter() { |
| | | return { |
| | | setItem(key: string, data: any) { |
| | | return Promise.resolve(storageLocal.setItem(key, data)); |
| | | }, |
| | | getItem(key: string) { |
| | | return Promise.resolve(storageLocal.getItem(key)); |
| | | }, |
| | | }; |
| | | }, |
| | | getPageUrl() { |
| | | return Taro.getCurrentInstance().router.path; |
| | | }, |
| | | }); |
New file |
| | |
| | | export let utilsConfig = { |
| | | appName: '', |
| | | }; |
| | | |
| | | export function setUtilsConfig(config: Partial<typeof utilsConfig>) { |
| | | utilsConfig = { ...utilsConfig, ...config }; |
| | | } |
| | | |
| | | export function getUtilsConfig() { |
| | | return { ...utilsConfig }; |
| | | } |
| | |
| | | export * from './encrypt'; |
| | | export * from './task'; |
| | | export * from './developing'; |
| | | export * from './LoggerRecord'; |
| | | export * from './storage'; |
| | |
| | | "version": "0.0.1", |
| | | "dependencies": { |
| | | "@12333/constants": "workspace:^", |
| | | "@12333/services": "workspace:^" |
| | | "@12333/services": "workspace:^", |
| | | "senior-request": "^1.0.10" |
| | | } |
| | | } |
File was renamed from apps/bMiniApp/src/utils/storage/storage.ts |
| | |
| | | /* eslint-disable @typescript-eslint/no-explicit-any */ |
| | | import Taro from '@tarojs/taro'; |
| | | |
| | | type Nullable<T> = T | null; |
| | | |
| | | //sessionStorage operate |
| | | class localStorageProxy { |
| | | constructor() {} |
| | |
| | | specifier: ^1.0.12 |
| | | version: 1.0.12(@nutui/icons-vue-taro@0.0.9)(@nutui/nutui-taro@4.3.13)(@tanstack/vue-query@4.35.3)(@tarojs/components@3.6.20)(@tarojs/taro@3.6.20)(axios@1.4.0)(dayjs@1.11.6)(lodash@4.17.21)(vue@3.5.12) |
| | | senior-request: |
| | | specifier: ^1.0.3 |
| | | version: 1.0.3(axios@1.4.0) |
| | | specifier: ^1.0.10 |
| | | version: 1.0.10(axios@1.4.0) |
| | | taro-plugin-pinia: |
| | | specifier: ^1.0.0 |
| | | version: 1.0.0 |
| | |
| | | specifier: ^1.0.12 |
| | | version: 1.0.12(@nutui/icons-vue-taro@0.0.9)(@nutui/nutui-taro@4.3.13)(@tanstack/vue-query@4.35.3)(@tarojs/components@3.6.20)(@tarojs/taro@3.6.20)(axios@1.4.0)(dayjs@1.11.6)(lodash@4.17.21)(vue@3.5.12) |
| | | senior-request: |
| | | specifier: ^1.0.3 |
| | | version: 1.0.3(axios@1.4.0) |
| | | specifier: ^1.0.10 |
| | | version: 1.0.10(axios@1.4.0) |
| | | taro-plugin-pinia: |
| | | specifier: ^1.0.0 |
| | | version: 1.0.0 |
| | |
| | | '@12333/services': |
| | | specifier: workspace:^ |
| | | version: link:../services |
| | | senior-request: |
| | | specifier: ^1.0.10 |
| | | version: 1.0.10(axios@1.4.0) |
| | | |
| | | packages: |
| | | |
| | |
| | | /@tencentcloud/call-engine-js@3.3.0: |
| | | resolution: {integrity: sha512-li4i97RSMM0ZlkK+1x1veRp1sy1YLV/rUNQ1iG8TodHZ4kwA97NnLNBTfvXro3rpJtPVuKIZV6Gp4N+kXy4rOg==} |
| | | dependencies: |
| | | '@tencentcloud/chat': 3.5.7 |
| | | '@tencentcloud/chat': 3.5.9 |
| | | core-js: 3.38.1 |
| | | eventemitter3: 4.0.7 |
| | | rtc-detect: 0.0.5 |
| | |
| | | /@tencentcloud/call-engine-wx@3.3.0: |
| | | resolution: {integrity: sha512-4oXRQhcWiVLX1PxcjCFjnEm53u3oguKsjas7zMvvvgh1UxsA9aiCl6xXIcGZ230w0rP4cQ6hA45S+EZrCIFP1g==} |
| | | dependencies: |
| | | '@tencentcloud/chat': 3.5.7 |
| | | '@tencentcloud/chat': 3.5.9 |
| | | '@tencentcloud/trtc-component-wx': 1.0.6 |
| | | eventemitter3: 4.0.7 |
| | | dev: false |
| | |
| | | resolution: {integrity: sha512-XpB8eZriaKDygAvSN3tae2bzD/coQ2u31DyXcAt5VWcATQ1Cf410qZ0ZAa2yf08mhqHcfQtMT0hzi4etZxbZuw==} |
| | | dependencies: |
| | | '@tencentcloud/call-engine-wx': 3.3.0 |
| | | '@tencentcloud/chat': 3.5.7 |
| | | '@tencentcloud/chat': 3.5.9 |
| | | '@tencentcloud/tui-core': 2.5.1 |
| | | '@vue/composition-api': 1.7.2(vue@3.5.12) |
| | | transitivePeerDependencies: |
| | |
| | | resolution: {integrity: sha512-TcbdRiTgeMVHqH6NS/EW0iyJkaIZxgjU3H/11fxNUjrMQsPyggRjtvCpy0nEfmpGpPDd1zp/d5u0f3O8Hj56rg==} |
| | | dependencies: |
| | | '@tencentcloud/call-engine-js': 3.3.0 |
| | | '@tencentcloud/chat': 3.5.7 |
| | | '@tencentcloud/chat': 3.5.9 |
| | | '@tencentcloud/tui-core': 2.5.1 |
| | | dev: false |
| | | |
| | |
| | | tim-upload-plugin: 1.4.3 |
| | | dev: false |
| | | |
| | | /@tencentcloud/chat-uikit-engine@2.5.5: |
| | | resolution: {integrity: sha512-WWFmtpRwNXgtRXWgb0mhzeigFGZimMbgvi1fVmu9sY5+RtF9RiayC/ESokaMVs591l7mcZf4/BXCQNtUi3eZiQ==} |
| | | /@tencentcloud/chat-uikit-engine@2.5.6: |
| | | resolution: {integrity: sha512-hzGkruR3j5S/9hx7HfGBWvHAZ7FZqpkl5LEz0z9sVm3faG/IaBkeTCjPmvN9kGIdDIan8Jn6mhVW57EEx7E8UQ==} |
| | | dependencies: |
| | | '@tencentcloud/chat': 3.5.9 |
| | | tim-profanity-filter-plugin: 1.1.0 |
| | |
| | | '@tencentcloud/call-uikit-vue': 4.0.9 |
| | | '@tencentcloud/call-uikit-vue2.6': 4.0.9(vue@3.5.12) |
| | | '@tencentcloud/call-uikit-wechat': 3.3.9 |
| | | '@tencentcloud/chat-uikit-engine': 2.5.5 |
| | | '@tencentcloud/chat-uikit-engine': 2.5.6 |
| | | '@tencentcloud/tui-core': 2.5.1 |
| | | '@tencentcloud/tui-customer-service-plugin': 2.2.6(@tencentcloud/tui-core@2.5.1)(@vue/composition-api@1.7.2)(vue@3.5.12) |
| | | '@types/lodash': 4.17.7 |
| | |
| | | - vue |
| | | - webpack |
| | | - webpack-sources |
| | | dev: false |
| | | |
| | | /@tencentcloud/chat@3.5.7: |
| | | resolution: {integrity: sha512-uxACmaFPqV8jXcORBwVSHc0qgKvnHzRg9kC8kHAqCGbsnsm8525JwFzU6ByckGCNqNWUx/5W70EISYAboLuTvQ==} |
| | | dev: false |
| | | |
| | | /@tencentcloud/chat@3.5.9: |
| | |
| | | axios: 1.4.0 |
| | | dev: false |
| | | |
| | | /senior-request@1.0.3(axios@1.4.0): |
| | | resolution: {integrity: sha512-suWkqlC0qYPRIVUvg5hRf6fXJpWOwkVfiXugzJO4ueDD+799nEQCBUQB4U68mjK9UVhyTY5oK/1Qx83alMqntA==} |
| | | /senior-request@1.0.10(axios@1.4.0): |
| | | resolution: {integrity: sha512-qHJaP7SrxK+YpiThJII2QXy+nXcjC5liNJizFsAEoFoLQ+eVBSA4hTC/nIC+WD7PEuboFOZCiriCm6KKJbMQBA==} |
| | | peerDependencies: |
| | | axios: '*' |
| | | dependencies: |