diff --git a/src/service/api/ai.ts b/src/service/api/ai.ts index 460d5d8..539c47a 100644 --- a/src/service/api/ai.ts +++ b/src/service/api/ai.ts @@ -8,7 +8,6 @@ */ /** ai-server 统一响应 */ -import { request } from '../request/ai'; interface AiResp { code: number; message: string; @@ -181,22 +180,13 @@ export interface RecognizeResult { materials_suggest: string[]; } -export function aiRecognize(content: string, deviceTags: string[] = []){ - return request({ - url: '/open/v1/moc/change/recognize', - method: 'post', - params: { - request_id: nextRequestId('rec'), - content, - device_tags: deviceTags - } +export function aiRecognize(content: string, deviceTags: string[] = []) { + return aiFetch('/open/v1/moc/change/recognize', { + request_id: nextRequestId('rec'), + content, + device_tags: deviceTags }); } - // aiFetch('/open/v1/moc/change/recognize', { - // request_id: nextRequestId('rec'), - // content, - // device_tags: deviceTags - // }); diff --git a/src/service/api/change.ts b/src/service/api/change.ts index aef4282..a062a7a 100644 --- a/src/service/api/change.ts +++ b/src/service/api/change.ts @@ -1,68 +1,68 @@ -import { request } from '../request'; - -/** 变更预识别查询 - * - */ -export function precheckApi(id: number) { - return request({ - url: `/api/changes/${id}/precheck`, - method: 'get', - }); -} -/** - * 变更预识别保存 - * - */ -export function precheckSaveApi(params: { - change_id: number, - title: string, - description: string, - severity: string, - probability: string, - protection: string, - compare_rows: {item: string, before_text: string, after_text: string}[] -}) { - return request({ - url: '/api/changes/precheck', - method: 'post', - data: params - }); -} - -/** 变更申请表查询 - * - */ -export function applicationApi(id: number) { - return request({ - url: `/api/changes/${id}/apply-form`, - method: 'get', - }); -} -/** - * 变更申请表保存 - * - */ -export function applicationSaveApi(id: number, params: { - change_type: number, - change_level: number, - duration_type: number, - restore_deadline: string, - org_id: number, - urgent: number, - purposes: string[], - effect: string, - main_changes: string[], - related_changes: string[], - materials: string, - update_docs: string[], - disciplines: string[], - manage_dept: string, - plan_use_date: string, - risk_tools: string[], -}) { - return request({ - url: `/api/changes/${id}/apply-form`, - method: 'post', - data: params - }); -} +import { request } from '../request'; + +/** 变更预识别查询 + * + */ +export function precheckApi(id: number) { + return request({ + url: `/api/changes/${id}/precheck`, + method: 'get', + }); +} +/** + * 变更预识别保存 + * + */ +export function precheckSaveApi(params: { + change_id: number, + title: string, + description: string, + severity: string, + probability: string, + protection: string, + compare_rows: {item: string, before_text: string, after_text: string}[] +}) { + return request({ + url: '/api/changes/precheck', + method: 'post', + data: params + }); +} + +/** 变更申请表查询 + * + */ +export function applicationApi(id: number) { + return request({ + url: `/api/changes/${id}/apply-form`, + method: 'get', + }); +} +/** + * 变更申请表保存 + * + */ +export function applicationSaveApi(id: number, params: { + change_type: number, + change_level: number, + duration_type: number, + restore_deadline: string, + org_id: number, + urgent: number, + purposes: string[], + effect: string, + main_changes: string[], + related_changes: string[], + materials: string, + update_docs: string[], + disciplines: string[], + manage_dept: string, + plan_use_date: string, + risk_tools: string[], +}) { + return request({ + url: `/api/changes/${id}/apply-form`, + method: 'post', + data: params + }); +} diff --git a/src/service/api/system.ts b/src/service/api/system.ts index 0c61c9a..f4f3048 100644 --- a/src/service/api/system.ts +++ b/src/service/api/system.ts @@ -1,96 +1,96 @@ -import { request } from '../request'; - -// 获取配置 -export function systemConfigApi() { - return request({ - url: '/api/system-config', - method: 'get', - }); -} -// 添加配置项 -export function addSystemConfigApi(data:{group_key:string, label:string,color:string,remark?:string,value:string}) { - return request({ - url: '/api/system-config', - method: 'post', - data, - }); -} -// 编辑配置项 -export function editSystemConfigApi(id:number, data:{group_key:string, label:string,color:string,remark?:string,value:string}) { - return request({ - url: `/api/system-config/${id}`, - method: 'put', - data, - }); -} -// 批量修改ai配置项和变更编号规则 -export function updateConfigApi(data:{items:any[]}) { - return request({ - url: '/api/system-config/batch', - method: 'put', - data, - }); -} -// 删除配置项 -export function deleteSystemConfigApi(id:number) { - return request({ - url: `/api/system-config/${id}`, - method: 'delete', - }); -} - -// 审批模板列表 -export function templateListApi() { - return request({ - url: '/api/approval-templates', - method: 'get', - }); -} -// 审批用户列表 -export function peopleListApi() { - return request({ - url: '/api/approval-flow/users', - method: 'get', - }); -} -// 新增审批模板 -export function addTemplateApi(data:any) { - return request({ - url: '/api/approval-templates', - method: 'post', - data, - }); -} -// 编辑审批模板 -export function editTemplateApi(id:number,data:any) { - return request({ - url: `/api/approval-templates/${id}`, - method: 'put', - data, - }); -} -// 删除审批模板 -export function deleteTemplateApi(id:number) { - return request({ - url: `/api/approval-templates/${id}`, - method: 'delete', - }); -} - -// 获取风险矩阵配置 -export function matrixConfigApi(bizType:string) { - return request({ - url: `/api/risk-matrix/${bizType}`, - method: 'get', - }); -} -// 保存风险矩阵配置 -export function saveMatrixConfigApi(bizType:string,data:any) { - return request({ - url: `/api/risk-matrix/${bizType}`, - method: 'put', - data, - }); -} - - +import { request } from '../request'; + +// 获取配置 +export function systemConfigApi() { + return request({ + url: '/api/system-config', + method: 'get', + }); +} +// 添加配置项 +export function addSystemConfigApi(data:{group_key:string, label:string,color:string,remark?:string,value:string}) { + return request({ + url: '/api/system-config', + method: 'post', + data, + }); +} +// 编辑配置项 +export function editSystemConfigApi(id:number, data:{group_key:string, label:string,color:string,remark?:string,value:string}) { + return request({ + url: `/api/system-config/${id}`, + method: 'put', + data, + }); +} +// 批量修改ai配置项和变更编号规则 +export function updateConfigApi(data:{items:any[]}) { + return request({ + url: '/api/system-config/batch', + method: 'put', + data, + }); +} +// 删除配置项 +export function deleteSystemConfigApi(id:number) { + return request({ + url: `/api/system-config/${id}`, + method: 'delete', + }); +} + +// 审批模板列表 +export function templateListApi() { + return request({ + url: '/api/approval-templates', + method: 'get', + }); +} +// 审批用户列表 +export function peopleListApi() { + return request({ + url: '/api/approval-flow/users', + method: 'get', + }); +} +// 新增审批模板 +export function addTemplateApi(data:any) { + return request({ + url: '/api/approval-templates', + method: 'post', + data, + }); +} +// 编辑审批模板 +export function editTemplateApi(id:number,data:any) { + return request({ + url: `/api/approval-templates/${id}`, + method: 'put', + data, + }); +} +// 删除审批模板 +export function deleteTemplateApi(id:number) { + return request({ + url: `/api/approval-templates/${id}`, + method: 'delete', + }); +} + +// 获取风险矩阵配置 +export function matrixConfigApi(bizType:string) { + return request({ + url: `/api/risk-matrix/${bizType}`, + method: 'get', + }); +} +// 保存风险矩阵配置 +export function saveMatrixConfigApi(bizType:string,data:any) { + return request({ + url: `/api/risk-matrix/${bizType}`, + method: 'put', + data, + }); +} + + diff --git a/src/service/api/user.ts b/src/service/api/user.ts index e9ceacb..15a95ce 100644 --- a/src/service/api/user.ts +++ b/src/service/api/user.ts @@ -1,111 +1,111 @@ -import { request } from '../request'; - -// 组织列表 -export function orgListApi() { - return request({ - url: '/api/organization/tree', - method: 'get', - }); -} -// 新增组织 -export function addOrgApi(params: { label: string, parent_id: number, sort: number, is_bottom: number, org_code: string }) { - return request({ - url: '/api/organization', - method: 'post', - data: params - }); -} -// 编辑组织 -export function editOrgApi(id: number, params: { label: string, parent_id: number, sort: number, is_bottom: number, org_code: string }) { - return request({ - url: `/api/organization/${id}`, - method: 'put', - data: params - }); -} -// 删除组织 -export function deleteOrgApi(id: number) { - return request({ - url: `/api/organization/${id}`, - method: 'delete', - }); -} - -// 获取用户列表 -export function userListApi(params: {org_id: number, keyword: string, page: number, limit: number }) { - return request({ - url: '/api/user', - method: 'get', - params - }); -} - -// 新增用户 -export function addUserApi(params: { real_name: string, username: string, gender: number, mobile?: string, email?: string, dept_ids: number[], role_id: number | null, org_ids: number[], enabled: boolean }) { - return request({ - url: '/api/user', - method: 'post', - data: params - }); -} - -// 编辑用户 -export function editUserApi(id: number, params: { real_name: string, username: string, gender: number, mobile?: string, email?: string, dept_ids: number[], role_id: number | null, org_ids: number[], enabled: boolean }) { - return request({ - url: `/api/user/${id}`, - method: 'put', - data: params - }); -} - -// 删除用户 -export function deleteUserApi(params: { id: number, type: number }) { - return request({ - url: '/api/user/operation', - method: 'post', - data: params - }); -} - -// 重置数据权限 -export function resetDataApi() { - return request({ - url: `/api/user/reset-data-permission`, - method: 'post', - }); -} - -// 下载用户导入模板 -export function downloadTemplateApi() { - return request({ - url: `/api/user/template`, - method: 'get', - responseType: 'blob', - }); -} - -// 导入用户 -export function importUserApi(params: FormData) { - return request({ - url: `/api/user/import`, - method: 'post', - data: params - }); -} -// 重置用户密码 -export function resetPasswordApi(id: number) { - return request({ - url: `/api/user/${id}/reset-password`, - method: 'post', - }); -} - -// 修改用户密码 -export function changePasswordApi(params: { oldPassword: string, password: string }) { - return request({ - url: `/api/user/change-password`, - method: 'post', - data: params - }); -} - +import { request } from '../request'; + +// 组织列表 +export function orgListApi() { + return request({ + url: '/api/organization/tree', + method: 'get', + }); +} +// 新增组织 +export function addOrgApi(params: { label: string, parent_id: number, sort: number, is_bottom: number, org_code: string }) { + return request({ + url: '/api/organization', + method: 'post', + data: params + }); +} +// 编辑组织 +export function editOrgApi(id: number, params: { label: string, parent_id: number, sort: number, is_bottom: number, org_code: string }) { + return request({ + url: `/api/organization/${id}`, + method: 'put', + data: params + }); +} +// 删除组织 +export function deleteOrgApi(id: number) { + return request({ + url: `/api/organization/${id}`, + method: 'delete', + }); +} + +// 获取用户列表 +export function userListApi(params: {org_id: number, keyword: string, page: number, limit: number }) { + return request({ + url: '/api/user', + method: 'get', + params + }); +} + +// 新增用户 +export function addUserApi(params: { real_name: string, username: string, gender: number, mobile?: string, email?: string, dept_ids: number[], role_id: number | null, org_ids: number[], enabled: boolean }) { + return request({ + url: '/api/user', + method: 'post', + data: params + }); +} + +// 编辑用户 +export function editUserApi(id: number, params: { real_name: string, username: string, gender: number, mobile?: string, email?: string, dept_ids: number[], role_id: number | null, org_ids: number[], enabled: boolean }) { + return request({ + url: `/api/user/${id}`, + method: 'put', + data: params + }); +} + +// 删除用户 +export function deleteUserApi(params: { id: number, type: number }) { + return request({ + url: '/api/user/operation', + method: 'post', + data: params + }); +} + +// 重置数据权限 +export function resetDataApi() { + return request({ + url: `/api/user/reset-data-permission`, + method: 'post', + }); +} + +// 下载用户导入模板 +export function downloadTemplateApi() { + return request({ + url: `/api/user/template`, + method: 'get', + responseType: 'blob', + }); +} + +// 导入用户 +export function importUserApi(params: FormData) { + return request({ + url: `/api/user/import`, + method: 'post', + data: params + }); +} +// 重置用户密码 +export function resetPasswordApi(id: number) { + return request({ + url: `/api/user/${id}/reset-password`, + method: 'post', + }); +} + +// 修改用户密码 +export function changePasswordApi(params: { oldPassword: string, password: string }) { + return request({ + url: `/api/user/change-password`, + method: 'post', + data: params + }); +} + diff --git a/src/service/request/ai.ts b/src/service/request/ai.ts index e6cb89a..08dddc8 100644 --- a/src/service/request/ai.ts +++ b/src/service/request/ai.ts @@ -1,124 +1,124 @@ -import type { AxiosResponse } from 'axios'; -import { BACKEND_ERROR_CODE, createFlatRequest } from '@sa/axios'; -import { useAuthStore } from '@/store/modules/auth'; -import { getServiceAiURL } from '@/utils/service'; -import { $t } from '@/locales'; -import { getAiAuthorization, handleExpiredRequest, showErrorMsg } from './shared'; -import type { RequestInstanceState } from './type'; - -const isHttpProxy = import.meta.env.DEV && import.meta.env.VITE_HTTP_PROXY === 'Y'; -const { baseURL } = getServiceAiURL(import.meta.env, isHttpProxy); - -export const request = createFlatRequest( - { - baseURL, - headers: {} - }, - { - defaultState: { - errMsgStack: [], - refreshTokenPromise: null - } as RequestInstanceState, - transform(response: AxiosResponse>) { - return response.data.data; - }, - async onRequest(config) { - const Authorization = getAiAuthorization(); - Object.assign(config.headers, { Authorization }); - - return config; - }, - isBackendSuccess(response) { - // when the backend response code is "0000"(default), it means the request is success - // to change this logic by yourself, you can modify the `VITE_SERVICE_SUCCESS_CODE` in `.env` file - return String(response.data.code) === import.meta.env.VITE_SERVICE_SUCCESS_CODE; - }, - async onBackendFail(response, instance) { - const authStore = useAuthStore(); - const responseCode = String(response.data.code); - - function handleLogout() { - authStore.resetStore(); - } - - function logoutAndCleanup() { - handleLogout(); - window.removeEventListener('beforeunload', handleLogout); - - request.state.errMsgStack = request.state.errMsgStack.filter(msg => msg !== response.data.msg); - } - - // when the backend response code is in `logoutCodes`, it means the user will be logged out and redirected to login page - const logoutCodes = import.meta.env.VITE_SERVICE_LOGOUT_CODES?.split(',') || []; - if (logoutCodes.includes(responseCode)) { - handleLogout(); - return null; - } - - // when the backend response code is in `modalLogoutCodes`, it means the user will be logged out by displaying a modal - const modalLogoutCodes = import.meta.env.VITE_SERVICE_MODAL_LOGOUT_CODES?.split(',') || []; - if (modalLogoutCodes.includes(responseCode) && !request.state.errMsgStack?.includes(response.data.msg)) { - request.state.errMsgStack = [...(request.state.errMsgStack || []), response.data.msg]; - - // prevent the user from refreshing the page - window.addEventListener('beforeunload', handleLogout); - - window.$dialog?.error({ - title: $t('common.error'), - content: response.data.msg, - positiveText: $t('common.confirm'), - maskClosable: false, - closeOnEsc: false, - onPositiveClick() { - logoutAndCleanup(); - }, - onClose() { - logoutAndCleanup(); - } - }); - - return null; - } - - // when the backend response code is in `expiredTokenCodes`, it means the token is expired, and refresh token - // the api `refreshToken` can not return error code in `expiredTokenCodes`, otherwise it will be a dead loop, should return `logoutCodes` or `modalLogoutCodes` - const expiredTokenCodes = import.meta.env.VITE_SERVICE_EXPIRED_TOKEN_CODES?.split(',') || []; - if (expiredTokenCodes.includes(responseCode)) { - const success = await handleExpiredRequest(request.state); - if (success) { - const Authorization = getAuthorization(); - Object.assign(response.config.headers, { Authorization }); - - return instance.request(response.config) as Promise; - } - } - - return null; - }, - onError(error) { - // when the request is fail, you can show error message - let message = error.message; - let backendErrorCode = ''; - - // get backend error message and code - if (error.code === BACKEND_ERROR_CODE) { - message = error.response?.data?.message || message; - backendErrorCode = String(error.response?.data?.code || ''); - } - - // the error message is displayed in the modal - const modalLogoutCodes = import.meta.env.VITE_SERVICE_MODAL_LOGOUT_CODES?.split(',') || []; - if (modalLogoutCodes.includes(backendErrorCode)) { - return; - } - - // when the token is expired, refresh token and retry request, so no need to show error message - const expiredTokenCodes = import.meta.env.VITE_SERVICE_EXPIRED_TOKEN_CODES?.split(',') || []; - if (expiredTokenCodes.includes(backendErrorCode)) { - return; - } - - showErrorMsg(request.state, message); - } - } -); +import type { AxiosResponse } from 'axios'; +import { BACKEND_ERROR_CODE, createFlatRequest } from '@sa/axios'; +import { useAuthStore } from '@/store/modules/auth'; +import { getServiceAiURL } from '@/utils/service'; +import { $t } from '@/locales'; +import { getAiAuthorization, handleExpiredRequest, showErrorMsg } from './shared'; +import type { RequestInstanceState } from './type'; + +const isHttpProxy = import.meta.env.DEV && import.meta.env.VITE_HTTP_PROXY === 'Y'; +const { baseURL } = getServiceAiURL(import.meta.env, isHttpProxy); + +export const request = createFlatRequest( + { + baseURL, + headers: {} + }, + { + defaultState: { + errMsgStack: [], + refreshTokenPromise: null + } as RequestInstanceState, + transform(response: AxiosResponse>) { + return response.data.data; + }, + async onRequest(config) { + const Authorization = getAiAuthorization(); + Object.assign(config.headers, { Authorization }); + + return config; + }, + isBackendSuccess(response) { + // when the backend response code is "0000"(default), it means the request is success + // to change this logic by yourself, you can modify the `VITE_SERVICE_SUCCESS_CODE` in `.env` file + return String(response.data.code) === import.meta.env.VITE_SERVICE_SUCCESS_CODE; + }, + async onBackendFail(response, instance) { + const authStore = useAuthStore(); + const responseCode = String(response.data.code); + + function handleLogout() { + authStore.resetStore(); + } + + function logoutAndCleanup() { + handleLogout(); + window.removeEventListener('beforeunload', handleLogout); + + request.state.errMsgStack = request.state.errMsgStack.filter(msg => msg !== response.data.msg); + } + + // when the backend response code is in `logoutCodes`, it means the user will be logged out and redirected to login page + const logoutCodes = import.meta.env.VITE_SERVICE_LOGOUT_CODES?.split(',') || []; + if (logoutCodes.includes(responseCode)) { + handleLogout(); + return null; + } + + // when the backend response code is in `modalLogoutCodes`, it means the user will be logged out by displaying a modal + const modalLogoutCodes = import.meta.env.VITE_SERVICE_MODAL_LOGOUT_CODES?.split(',') || []; + if (modalLogoutCodes.includes(responseCode) && !request.state.errMsgStack?.includes(response.data.msg)) { + request.state.errMsgStack = [...(request.state.errMsgStack || []), response.data.msg]; + + // prevent the user from refreshing the page + window.addEventListener('beforeunload', handleLogout); + + window.$dialog?.error({ + title: $t('common.error'), + content: response.data.msg, + positiveText: $t('common.confirm'), + maskClosable: false, + closeOnEsc: false, + onPositiveClick() { + logoutAndCleanup(); + }, + onClose() { + logoutAndCleanup(); + } + }); + + return null; + } + + // when the backend response code is in `expiredTokenCodes`, it means the token is expired, and refresh token + // the api `refreshToken` can not return error code in `expiredTokenCodes`, otherwise it will be a dead loop, should return `logoutCodes` or `modalLogoutCodes` + const expiredTokenCodes = import.meta.env.VITE_SERVICE_EXPIRED_TOKEN_CODES?.split(',') || []; + if (expiredTokenCodes.includes(responseCode)) { + const success = await handleExpiredRequest(request.state); + if (success) { + const Authorization = getAuthorization(); + Object.assign(response.config.headers, { Authorization }); + + return instance.request(response.config) as Promise; + } + } + + return null; + }, + onError(error) { + // when the request is fail, you can show error message + let message = error.message; + let backendErrorCode = ''; + + // get backend error message and code + if (error.code === BACKEND_ERROR_CODE) { + message = error.response?.data?.message || message; + backendErrorCode = String(error.response?.data?.code || ''); + } + + // the error message is displayed in the modal + const modalLogoutCodes = import.meta.env.VITE_SERVICE_MODAL_LOGOUT_CODES?.split(',') || []; + if (modalLogoutCodes.includes(backendErrorCode)) { + return; + } + + // when the token is expired, refresh token and retry request, so no need to show error message + const expiredTokenCodes = import.meta.env.VITE_SERVICE_EXPIRED_TOKEN_CODES?.split(',') || []; + if (expiredTokenCodes.includes(backendErrorCode)) { + return; + } + + showErrorMsg(request.state, message); + } + } +); diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 0e71ab9..9fcd57a 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -42,7 +42,6 @@ declare module 'vue' { NCascader: typeof import('naive-ui')['NCascader'] NCheckbox: typeof import('naive-ui')['NCheckbox'] NCheckboxGroup: typeof import('naive-ui')['NCheckboxGroup'] - NCol: typeof import('naive-ui')['NCol'] NColorPicker: typeof import('naive-ui')['NColorPicker'] NDataTable: typeof import('naive-ui')['NDataTable'] NDatePicker: typeof import('naive-ui')['NDatePicker'] @@ -57,7 +56,6 @@ declare module 'vue' { NFormItemGi: typeof import('naive-ui')['NFormItemGi'] NGi: typeof import('naive-ui')['NGi'] NGrid: typeof import('naive-ui')['NGrid'] - NIcon: typeof import('naive-ui')['NIcon'] NInput: typeof import('naive-ui')['NInput'] NInputGroup: typeof import('naive-ui')['NInputGroup'] NInputNumber: typeof import('naive-ui')['NInputNumber'] @@ -65,7 +63,6 @@ declare module 'vue' { NMenu: typeof import('naive-ui')['NMenu'] NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NModal: typeof import('naive-ui')['NModal'] - NNInput: typeof import('naive-ui')['NNInput'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NPagination: typeof import('naive-ui')['NPagination'] NPopconfirm: typeof import('naive-ui')['NPopconfirm'] @@ -73,7 +70,6 @@ declare module 'vue' { NProgress: typeof import('naive-ui')['NProgress'] NRadio: typeof import('naive-ui')['NRadio'] NRadioGroup: typeof import('naive-ui')['NRadioGroup'] - NRow: typeof import('naive-ui')['NRow'] NScrollbar: typeof import('naive-ui')['NScrollbar'] NSelect: typeof import('naive-ui')['NSelect'] NSpace: typeof import('naive-ui')['NSpace'] @@ -135,7 +131,6 @@ declare global { const NCascader: typeof import('naive-ui')['NCascader'] const NCheckbox: typeof import('naive-ui')['NCheckbox'] const NCheckboxGroup: typeof import('naive-ui')['NCheckboxGroup'] - const NCol: typeof import('naive-ui')['NCol'] const NColorPicker: typeof import('naive-ui')['NColorPicker'] const NDataTable: typeof import('naive-ui')['NDataTable'] const NDatePicker: typeof import('naive-ui')['NDatePicker'] @@ -150,7 +145,6 @@ declare global { const NFormItemGi: typeof import('naive-ui')['NFormItemGi'] const NGi: typeof import('naive-ui')['NGi'] const NGrid: typeof import('naive-ui')['NGrid'] - const NIcon: typeof import('naive-ui')['NIcon'] const NInput: typeof import('naive-ui')['NInput'] const NInputGroup: typeof import('naive-ui')['NInputGroup'] const NInputNumber: typeof import('naive-ui')['NInputNumber'] @@ -158,7 +152,6 @@ declare global { const NMenu: typeof import('naive-ui')['NMenu'] const NMessageProvider: typeof import('naive-ui')['NMessageProvider'] const NModal: typeof import('naive-ui')['NModal'] - const NNInput: typeof import('naive-ui')['NNInput'] const NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] const NPagination: typeof import('naive-ui')['NPagination'] const NPopconfirm: typeof import('naive-ui')['NPopconfirm'] @@ -166,7 +159,6 @@ declare global { const NProgress: typeof import('naive-ui')['NProgress'] const NRadio: typeof import('naive-ui')['NRadio'] const NRadioGroup: typeof import('naive-ui')['NRadioGroup'] - const NRow: typeof import('naive-ui')['NRow'] const NScrollbar: typeof import('naive-ui')['NScrollbar'] const NSelect: typeof import('naive-ui')['NSelect'] const NSpace: typeof import('naive-ui')['NSpace'] diff --git a/src/views/systemManage/changePassword/index.vue b/src/views/systemManage/changePassword/index.vue index 76ae9af..ff3dd13 100644 --- a/src/views/systemManage/changePassword/index.vue +++ b/src/views/systemManage/changePassword/index.vue @@ -1,98 +1,98 @@ - - - - - + + + + + diff --git a/vite.config.ts b/vite.config.ts index 1efe891..365bd9d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -37,9 +37,11 @@ export default defineConfig(configEnv => { open: true, proxy: { ...createViteProxy(viteEnv, enableProxy), - // ai-server OpenApi(本地 docker ai-server-ai-1,:12333) + // ai-server OpenApi:默认走线上映射域名(https://mocaiapi.djxinxi.net → 192.168.0.230:8085/proxy-ai/ → ai-server:12333, + // 网关超时已调至 900s,长耗时接口可用;域名根路径已含 /proxy-ai 映射,故此处剥掉前缀)。 + // 本地起 docker ai-server 联调时,用环境变量覆盖:AI_SERVER_URL=http://127.0.0.1:12333 pnpm dev '/proxy-ai': { - target: process.env.AI_SERVER_URL || 'http://127.0.0.1:12333', + target: process.env.AI_SERVER_URL || 'https://mocaiapi.djxinxi.net', changeOrigin: true, rewrite: p => p.replace(/^\/proxy-ai/, '') }