refactor: 替换项目中的"yudao"为"AIOTAGRO",并清理相关配置文件
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
|
||||
## Description
|
||||
|
||||
Vben Admin 数据 mock 服务,没有对接任何的数据库,所有数据都是模拟的,用于前端开发时提供数据支持。线上环境不再提供 mock 集成,可自行部署服务或者对接真实数据,由于 `mock.js` 等工具有一些限制,比如上传文件不行、无法模拟复杂的逻辑等,所以这里使用了真实的后端服务来实现。唯一麻烦的是本地需要同时启动后端服务和前端服务,但是这样可以更好的模拟真实环境。该服务不需要手动启动,已经集成在 vite 插件内,随应用一起启用。
|
||||
|
||||
Vben Admin 数据 mock 服务,没有对接任何的数据库,所有数据都是模拟的,用于前端开发时提供数据支持。线上环境不再提<EFBFBD><EFBFBD>?mock 集成,可自行部署服务或者对接真实数据,由于 `mock.js` 等工具有一些限制,比如上传文件不行、无法模拟复杂的逻辑等,所以这里使用了真实的后端服务来实现。唯一麻烦的是本地需要同时启动后端服务和前端服务,但是这样可以更好的模拟真实环境。该服务不需要手动启动,已经集成<EFBFBD><EFBFBD>?vite 插件内,随应用一起启用<EFBFBD><EFBFBD>?
|
||||
## Running the app
|
||||
|
||||
```bash
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Software License Agreement
|
||||
|
||||
**TinyMCE** – [<https://github.com/tinymce/tinymce>](https://github.com/tinymce/tinymce)
|
||||
**TinyMCE** <EFBFBD><EFBFBD>?[<https://github.com/tinymce/tinymce>](https://github.com/tinymce/tinymce)
|
||||
Copyright (c) 2024, Ephox Corporation DBA Tiny Technologies, Inc.
|
||||
|
||||
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
||||
|
||||
@@ -161,7 +161,7 @@ setupVbenVxeTable({
|
||||
});
|
||||
|
||||
// 表格配置项可以用 cellRender: { name: 'CellSwitch', props: { beforeChange: () => {} } },
|
||||
// add by 芋艿:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L97-L123
|
||||
// add by AIOTAGRO:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L97-L123
|
||||
vxeUI.renderer.add('CellSwitch', {
|
||||
renderTableDefault({ attrs, props }, { column, row }) {
|
||||
const loadingKey = `__loading_${column.field}`;
|
||||
@@ -193,7 +193,7 @@ setupVbenVxeTable({
|
||||
});
|
||||
|
||||
// 注册表格的操作按钮渲染器 cellRender: { name: 'CellOperation', options: ['edit', 'delete'] }
|
||||
// add by 芋艿:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L125-L255
|
||||
// add by AIOTAGRO:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L125-L255
|
||||
vxeUI.renderer.add('CellOperation', {
|
||||
renderTableDefault({ attrs, options, props }, { column, row }) {
|
||||
const defaultProps = { size: 'small', type: 'link', ...props };
|
||||
|
||||
@@ -2,7 +2,7 @@ import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmModelApi {
|
||||
/** 用户信息 TODO 这个是不是可以抽取出来定义在公共模块 */
|
||||
// TODO @芋艿:一起看看。
|
||||
// TODO @AIOTAGRO:一起看看。
|
||||
export interface UserInfo {
|
||||
id: number;
|
||||
nickname: string;
|
||||
|
||||
@@ -11,7 +11,7 @@ import type { BpmModelApi } from '#/api/bpm/model';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessInstanceApi {
|
||||
// TODO @芋艿:一些注释缺少或者不对;
|
||||
// TODO @AIOTAGRO:一些注释缺少或者不对;
|
||||
export interface Task {
|
||||
id: number;
|
||||
name: string;
|
||||
|
||||
@@ -59,7 +59,7 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) {
|
||||
}
|
||||
const resp = await refreshTokenApi(refreshToken);
|
||||
const newToken = resp?.data?.data?.accessToken;
|
||||
// add by 芋艿:这里一定要抛出 resp.data,从而触发 authenticateResponseInterceptor 中,刷新令牌失败!!!
|
||||
// add by AIOTAGRO:这里一定要抛出 resp.data,从而触发 authenticateResponseInterceptor 中,刷新令牌失败!!!
|
||||
if (!newToken) {
|
||||
throw resp.data;
|
||||
}
|
||||
@@ -154,7 +154,7 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) {
|
||||
const responseData = error?.response?.data ?? {};
|
||||
const errorMessage =
|
||||
responseData?.error ?? responseData?.message ?? responseData.msg ?? '';
|
||||
// add by 芋艿:特殊:避免 401 “账号未登录”,重复提示。因为,此时会跳转到登录界面,只需提示一次!!!
|
||||
// add by AIOTAGRO:特殊:避免 401 "账号未登录",重复提示。因为,此时会跳转到登录界面,只需提示一次!!!
|
||||
if (error?.data?.code === 401) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ const previewProcessJson = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/* ------------------------------------------------ 芋道源码 methods ------------------------------------------------------ */
|
||||
/* ------------------------------------------------ AIOTAGRO methods ------------------------------------------------------ */
|
||||
onMounted(() => {
|
||||
initBpmnModeler();
|
||||
createNewDiagram(props.value);
|
||||
|
||||
@@ -466,7 +466,7 @@ watch(
|
||||
@change="() => updateLoopBase()"
|
||||
/>
|
||||
</FormItem>
|
||||
<!-- add by 芋艿:由于「元素变量」暂时用不到,所以这里 display 为 none -->
|
||||
<!-- add by AIOTAGRO:由于「元素变量」暂时用不到,所以这里 display 为 none -->
|
||||
<FormItem label="元素变量" key="elementVariable" class="hidden">
|
||||
<Input
|
||||
v-model:value="loopInstanceForm.elementVariable"
|
||||
@@ -484,7 +484,7 @@ watch(
|
||||
"
|
||||
/>
|
||||
</FormItem>
|
||||
<!-- add by 芋艿:由于「异步状态」暂时用不到,所以这里 display 为 none -->
|
||||
<!-- add by AIOTAGRO:由于「异步状态」暂时用不到,所以这里 display 为 none -->
|
||||
<FormItem label="异步状态" key="async" class="hidden">
|
||||
<Checkbox
|
||||
v-model:checked="loopInstanceForm.asyncBefore"
|
||||
|
||||
@@ -64,7 +64,7 @@ watch(
|
||||
<template>
|
||||
<div class="panel-tab__content">
|
||||
<Form>
|
||||
<!-- add by 芋艿:由于「异步延续」暂时用不到,所以这里 display 为 none -->
|
||||
<!-- add by AIOTAGRO:由于「异步延续」暂时用不到,所以这里 display 为 none -->
|
||||
<FormItem label="异步延续" class="hidden">
|
||||
<Checkbox
|
||||
v-model:checked="taskConfigForm.asyncBefore"
|
||||
|
||||
@@ -219,7 +219,7 @@ const resetTaskForm = () => {
|
||||
const changeCandidateStrategy = () => {
|
||||
userTaskForm.value.candidateParam = [];
|
||||
deptLevel.value = 1;
|
||||
// 注释 by 芋艿:这个交互很多用户反馈费解,https://t.zsxq.com/xNmas 所以暂时屏蔽
|
||||
// 注释 by AIOTAGRO:这个交互很多用户反馈费解,https://t.zsxq.com/xNmas 所以暂时屏蔽
|
||||
// if (userTaskForm.value.candidateStrategy === CandidateStrategy.FORM_USER) {
|
||||
// // 特殊处理表单内用户字段,当只有发起人选项时应选中发起人
|
||||
// if (!userFieldOnFormOptions.value || userFieldOnFormOptions.value.length <= 1) {
|
||||
|
||||
@@ -121,9 +121,9 @@ export const useApiSelect = (option: ApiSelectProps) => {
|
||||
parseOptions0(data);
|
||||
return;
|
||||
}
|
||||
// 情况三:不是 yudao-vue-pro 标准返回
|
||||
// 情况三:不是 aiotagro-vue-pro 标准返回
|
||||
console.warn(
|
||||
`接口[${props.url}] 返回结果不是 yudao-vue-pro 标准返回建议采用自定义解析函数处理`,
|
||||
`接口[${props.url}] 返回结果不是 aiotagro-vue-pro 标准返回建议采用自定义解析函数处理`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { Rule } from '@form-create/ant-design-vue';
|
||||
/** 数据字典 Select 选择器组件 Props 类型 */
|
||||
export interface DictSelectProps {
|
||||
dictType: string; // 字典类型
|
||||
valueType?: 'bool' | 'int' | 'str'; // 字典值类型 TODO @芋艿:'boolean' | 'number' | 'string';需要和 vue3 一起统一!
|
||||
valueType?: 'bool' | 'int' | 'str'; // 字典值类型 TODO @AIOTAGRO:'boolean' | 'number' | 'string';需要和 vue3 一起统一!
|
||||
selectType?: 'checkbox' | 'radio' | 'select'; // 选择器类型,下拉框 select、多选框 checkbox、单选框 radio
|
||||
formCreateInject?: any;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// TODO @芋艿:是否有更好的组织形式?!
|
||||
// TODO @AIOTAGRO:是否有更好的组织形式?!
|
||||
<script lang="ts" setup>
|
||||
import type { DataNode } from 'ant-design-vue/es/tree';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
// TODO @芋艿:是否有更好的组织形式?!
|
||||
// TODO @AIOTAGRO:是否有更好的组织形式?!
|
||||
// TODO @xingyu:你感觉,这个放到每个 system、infra 模块下,然后新建一个 components,表示每个模块,有一些共享的组件?然后,全局只放通用的(无业务含义的),可以哇?
|
||||
import type { Key } from 'ant-design-vue/es/table/interface';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
// TODO @芋艿:后续是不是把业务组件,挪到每个模块里;待定;
|
||||
// TODO @AIOTAGRO:后续是不是把业务组件,挪到每个模块里;待定;
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
import type { SimpleFlowNode } from '../../consts';
|
||||
|
||||
@@ -178,7 +178,7 @@ export function useFormFields() {
|
||||
return parseFormCreateFields(unref(formFields));
|
||||
}
|
||||
|
||||
// TODO @芋艿:后续需要把各种类似 useFormFieldsPermission 的逻辑,抽成一个通用方法。
|
||||
// TODO @AIOTAGRO:后续需要把各种类似 useFormFieldsPermission 的逻辑,抽成一个通用方法。
|
||||
/**
|
||||
* @description 获取流程表单的字段和发起人字段
|
||||
*/
|
||||
|
||||
@@ -78,7 +78,7 @@ export function useUploadType({
|
||||
return { getAccept, getStringAccept, getHelpText };
|
||||
}
|
||||
|
||||
// TODO @芋艿:目前保持和 admin-vue3 一致,后续可能重构
|
||||
// TODO @AIOTAGRO:目前保持和 admin-vue3 一致,后续可能重构
|
||||
export function useUpload(directory?: string) {
|
||||
// 后端上传地址
|
||||
const uploadUrl = getUploadUrl();
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# locale
|
||||
|
||||
每个app使用的国际化可能不同,这里用于扩展国际化的功能,例如扩展 dayjs、antd组件库的多语言切换,以及app本身的国际化文件。
|
||||
每个app使用的国际化可能不同,这里用于扩展国际化的功能,例如扩展 dayjs、antd组件库的多语言切换,以及app本身的国际化文件<EFBFBD><EFBFBD>?
|
||||
|
||||
@@ -20,6 +20,6 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
},
|
||||
copyright: {
|
||||
companyName: import.meta.env.VITE_APP_TITLE,
|
||||
companySiteLink: 'https://gitee.com/yudaocode/yudao-ui-admin-vben',
|
||||
companySiteLink: 'https://gitee.com/yudaocode/yudao-ui-admin-vben' // AIOTAGRO,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||
return await generateAccessible(preferences.app.accessMode, {
|
||||
...options,
|
||||
fetchMenuListAsync: async () => {
|
||||
// 由于 yudao 通过 accessStore 读取,所以不在进行 message.loading 提示
|
||||
// 由于 AIOTAGRO 通过 accessStore 读取,所以不在进行 message.loading 提示
|
||||
// 补充说明:accessStore.accessMenus 一开始是 AppRouteRecordRaw 类型(后端加载),后面被赋值成 MenuRecordRaw 类型(前端转换)
|
||||
const accessMenus = accessStore.accessMenus as AppRouteRecordRaw[];
|
||||
return convertServerMenuToRouteRecordStringComponent(accessMenus);
|
||||
|
||||
@@ -102,7 +102,7 @@ function setupAccessGuard(router: Router) {
|
||||
// 当前登录用户拥有的角色标识列表
|
||||
let userInfo = userStore.userInfo;
|
||||
if (!userInfo) {
|
||||
// add by 芋艿:由于 yudao 是 fetchUserInfo 统一加载用户 + 权限信息,所以将 fetchMenuListAsync
|
||||
// add by 芋艿:由于 AIOTAGRO 是 fetchUserInfo 统一加载用户 + 权限信息,所以将 fetchMenuListAsync
|
||||
const loading = message.loading({
|
||||
content: `${$t('common.loadingMenu')}...`,
|
||||
});
|
||||
|
||||
@@ -35,7 +35,7 @@ const coreRouteNames = traverseTreeValues(coreRoutes, (route) => route.name);
|
||||
/** 有权限校验的路由列表,包含动态路由和静态路由 */
|
||||
const accessRoutes = [...dynamicRoutes, ...staticRoutes];
|
||||
|
||||
// add by 芋艿:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/router/routes/index.ts#L38-L45
|
||||
// add by AIOTAGRO:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/router/routes/index.ts#L38-L45
|
||||
const componentKeys: string[] = Object.keys(
|
||||
import.meta.glob('../../views/**/*.vue'),
|
||||
)
|
||||
|
||||
@@ -78,4 +78,4 @@ const routes: RouteRecordRaw[] = [
|
||||
// },
|
||||
];
|
||||
|
||||
export default routes; // update by 芋艿:不展示
|
||||
export default routes; // update by AIOTAGRO:不展示
|
||||
|
||||
@@ -71,7 +71,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
accessStore.setRefreshToken(refreshToken);
|
||||
|
||||
// 获取用户信息并存储到 userStore、accessStore 中
|
||||
// TODO @芋艿:清理掉 accessCodes 相关的逻辑
|
||||
// TODO @AIOTAGRO:清理掉 accessCodes 相关的逻辑
|
||||
// const [fetchUserInfoResult, accessCodes] = await Promise.all([
|
||||
// fetchUserInfo(),
|
||||
// // getAccessCodesApi(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 针对 https://github.com/xaboy/form-create-designer 封装的工具类
|
||||
*/
|
||||
// TODO @芋艿:后续这些 form-create 的优化;另外需要使用 form-create-helper 会好点
|
||||
// TODO @AIOTAGRO:后续这些 form-create 的优化;另外需要使用 form-create-helper 会好点
|
||||
import { isRef } from 'vue';
|
||||
|
||||
import formCreate from '@form-create/ant-design-vue';
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# \_core
|
||||
|
||||
此目录包含应用程序正常运行所需的基本视图。这些视图是应用程序布局中使用的视图。
|
||||
此目录包含应用程序正常运行所需的基本视图。这些视图是应用程序布局中使用的视图<EFBFBD><EFBFBD>?
|
||||
|
||||
@@ -57,7 +57,7 @@ onMounted(loadProfile);
|
||||
<Tabs.TabPane key="userSocial" tab="社交绑定" force-render>
|
||||
<UserSocial @update:active-name="activeName = $event" />
|
||||
</Tabs.TabPane>
|
||||
<!-- TODO @芋艿:在线设备 -->
|
||||
<!-- TODO @AIOTAGRO:在线设备 -->
|
||||
</Tabs>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@ async function handlerPromptClick(prompt: any) {
|
||||
<!-- center-container -->
|
||||
<div class="flex flex-col justify-center">
|
||||
<!-- title -->
|
||||
<div class="text-center text-3xl font-bold">芋道 AI</div>
|
||||
<div class="text-center text-3xl font-bold">AIOTAGRO AI</div>
|
||||
|
||||
<!-- role-list -->
|
||||
<div class="mt-5 flex w-96 flex-wrap items-center justify-center">
|
||||
|
||||
@@ -490,11 +490,11 @@ onMounted(async () => {
|
||||
activeMessageListLoading.value = true;
|
||||
await getMessageList();
|
||||
});
|
||||
// TODO @芋艿:深度思考
|
||||
// TODO @芋艿:联网搜索
|
||||
// TODO @芋艿:附件支持
|
||||
// TODO @芋艿:mcp 相关
|
||||
// TODO @芋艿:异常消息的处理
|
||||
// TODO @AIOTAGRO:深度思考
|
||||
// TODO @AIOTAGRO:联网搜索
|
||||
// TODO @AIOTAGRO:附件支持
|
||||
// TODO @AIOTAGRO:mcp 相关
|
||||
// TODO @AIOTAGRO:异常消息的处理
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -180,7 +180,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
});
|
||||
|
||||
/** 获取数据源配置列表 */
|
||||
// TODO @芋艿:这种场景的最佳实践;
|
||||
// TODO @AIOTAGRO:这种场景的最佳实践;
|
||||
async function initDataSourceConfig() {
|
||||
try {
|
||||
dataSourceConfigList.value = await getDataSourceConfigList();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
// TODO @芋艿:待定,vben2.0 有 CodeEditor,不确定官方后续会不会迁移!!!
|
||||
// TODO @AIOTAGRO:待定,vben2.0 有 CodeEditor,不确定官方后续会不会迁移!!!
|
||||
import type { InfraCodegenApi } from '#/api/infra/codegen';
|
||||
|
||||
import { h, ref } from 'vue';
|
||||
|
||||
@@ -150,7 +150,7 @@ export function useTypeGridColumns(): VxeTableGridOptions['columns'] {
|
||||
|
||||
// ============================== 字典数据 ==============================
|
||||
|
||||
// TODO @芋艿:后续针对 antd,增加
|
||||
// TODO @AIOTAGRO:后续针对 antd,增加
|
||||
/**
|
||||
* 颜色选项
|
||||
*/
|
||||
|
||||
@@ -125,7 +125,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||
{
|
||||
field: 'avatar',
|
||||
label: '用户头像',
|
||||
// TODO @芋艿:使用 antd 的 Image 组件
|
||||
// TODO @AIOTAGRO:使用 antd 的 Image 组件
|
||||
content: (data: SystemSocialUserApi.SocialUser) => {
|
||||
if (data?.avatar) {
|
||||
return h('img', {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Software License Agreement
|
||||
|
||||
**TinyMCE** – [<https://github.com/tinymce/tinymce>](https://github.com/tinymce/tinymce)
|
||||
**TinyMCE** <EFBFBD><EFBFBD>?[<https://github.com/tinymce/tinymce>](https://github.com/tinymce/tinymce)
|
||||
Copyright (c) 2024, Ephox Corporation DBA Tiny Technologies, Inc.
|
||||
|
||||
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
||||
|
||||
@@ -147,7 +147,7 @@ setupVbenVxeTable({
|
||||
});
|
||||
|
||||
// 表格配置项可以用 cellRender: { name: 'CellSwitch', props: { beforeChange: () => {} } },
|
||||
// add by 芋艿:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L97-L123
|
||||
// add by AIOTAGRO:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L97-L123
|
||||
vxeUI.renderer.add('CellSwitch', {
|
||||
renderTableDefault({ attrs, props }, { column, row }) {
|
||||
const loadingKey = `__loading_${column.field}`;
|
||||
@@ -179,7 +179,7 @@ setupVbenVxeTable({
|
||||
});
|
||||
|
||||
// 注册表格的操作按钮渲染器 cellRender: { name: 'CellOperation', options: ['edit', 'delete'] }
|
||||
// add by 芋艿:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L125-L255
|
||||
// add by AIOTAGRO:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L125-L255
|
||||
vxeUI.renderer.add('CellOperation', {
|
||||
renderTableDefault({ attrs, options, props }, { column, row }) {
|
||||
const defaultProps = {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmModelApi {
|
||||
/** 用户信息 TODO 这个是不是可以抽取出来定义在公共模块 */
|
||||
// TODO @芋艿:一起看看。
|
||||
// TODO @AIOTAGRO:一起看看。
|
||||
export interface UserInfo {
|
||||
id: number;
|
||||
nickname: string;
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { BpmModelApi } from '#/api/bpm/model';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessInstanceApi {
|
||||
// TODO @芋艿:一些注释缺少或者不对;
|
||||
// TODO @AIOTAGRO:一些注释缺少或者不对;
|
||||
export interface Task {
|
||||
id: number;
|
||||
name: string;
|
||||
|
||||
@@ -59,7 +59,7 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) {
|
||||
}
|
||||
const resp = await refreshTokenApi(refreshToken);
|
||||
const newToken = resp?.data?.data?.accessToken;
|
||||
// add by 芋艿:这里一定要抛出 resp.data,从而触发 authenticateResponseInterceptor 中,刷新令牌失败!!!
|
||||
// add by AIOTAGRO:这里一定要抛出 resp.data,从而触发 authenticateResponseInterceptor 中,刷新令牌失败!!!
|
||||
if (!newToken) {
|
||||
throw resp.data;
|
||||
}
|
||||
@@ -154,7 +154,7 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) {
|
||||
const responseData = error?.response?.data ?? {};
|
||||
const errorMessage =
|
||||
responseData?.error ?? responseData?.message ?? responseData.msg ?? '';
|
||||
// add by 芋艿:特殊:避免 401 “账号未登录”,重复提示。因为,此时会跳转到登录界面,只需提示一次!!!
|
||||
// add by AIOTAGRO:特殊:避免 401 “账号未登录”,重复提示。因为,此时会跳转到登录界面,只需提示一次!!!
|
||||
if (error?.data?.code === 401) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
// TODO @芋艿:后续合并到 diy-editor 里,并不是通用的;
|
||||
// TODO @AIOTAGRO:后续合并到 diy-editor 里,并不是通用的;
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
import AppLinkSelectDialog from './app-link-select-dialog.vue';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
// TODO @芋艿:后续合并到 diy-editor 里,并不是通用的;
|
||||
// TODO @AIOTAGRO:后续合并到 diy-editor 里,并不是通用的;
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { PREDEFINE_COLORS } from '@vben/constants';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
// import { isHexColor } from '@/utils/color' // TODO @芋艿:【可优化】增加 cssClass 的处理 https://gitee.com/yudaocode/yudao-ui-admin-vben/blob/v2.4.1/src/components/DictTag/src/DictTag.vue#L60
|
||||
// import { isHexColor } from '@/utils/color' // TODO @AIOTAGRO:【可优化】增加 cssClass 的处理 https://gitee.com/yudaocode/yudao-ui-admin-vben/blob/v2.4.1/src/components/DictTag/src/DictTag.vue#L60
|
||||
import { getDictObj } from '@vben/hooks';
|
||||
|
||||
import { ElTag } from 'element-plus';
|
||||
|
||||
@@ -17,7 +17,7 @@ defineProps<{ property: UserCardProperty }>();
|
||||
<ElAvatar :size="60">
|
||||
<IconifyIcon icon="ep:avatar" :size="60" />
|
||||
</ElAvatar>
|
||||
<span class="text-[18px] font-bold">芋道源码</span>
|
||||
<span class="text-[18px] font-bold">AIOTAGRO</span>
|
||||
</div>
|
||||
<IconifyIcon icon="tdesign:qrcode" :size="20" />
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
// TODO @芋艿:后续合并到 diy-editor 里,并不是通用的;
|
||||
// TODO @AIOTAGRO:后续合并到 diy-editor 里,并不是通用的;
|
||||
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { Rule } from '@form-create/element-ui'; // 左侧拖拽按钮
|
||||
/** 数据字典 Select 选择器组件 Props 类型 */
|
||||
export interface DictSelectProps {
|
||||
dictType: string; // 字典类型
|
||||
valueType?: 'bool' | 'int' | 'str'; // 字典值类型 TODO @芋艿:'boolean' | 'number' | 'string';需要和 vue3 一起统一!
|
||||
valueType?: 'bool' | 'int' | 'str'; // 字典值类型 TODO @AIOTAGRO:'boolean' | 'number' | 'string';需要和 vue3 一起统一!
|
||||
selectType?: 'checkbox' | 'radio' | 'select'; // 选择器类型,下拉框 select、多选框 checkbox、单选框 radio
|
||||
formCreateInject?: any;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { PREDEFINE_COLORS } from '@vben/constants';
|
||||
|
||||
// TODO @芋艿:后续合并到 diy-editor 里,并不是通用的;
|
||||
// TODO @AIOTAGRO:后续合并到 diy-editor 里,并不是通用的;
|
||||
import { useVModels } from '@vueuse/core';
|
||||
import { ElColorPicker, ElInput } from 'element-plus';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
// TODO @芋艿:后续合并到 diy-editor 里,并不是通用的;
|
||||
// TODO @AIOTAGRO:后续合并到 diy-editor 里,并不是通用的;
|
||||
import type { Point, Rect } from './util';
|
||||
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
@@ -231,7 +231,7 @@ function getValue() {
|
||||
}
|
||||
return item?.response?.url || item?.response;
|
||||
});
|
||||
// add by 芋艿:【特殊】单个文件的情况,获取首个元素,保证返回的是 String 类型
|
||||
// add by AIOTAGRO:【特殊】单个文件的情况,获取首个元素,保证返回的是 String 类型
|
||||
if (props.maxNumber === 1) {
|
||||
return list.length > 0 ? list[0] : '';
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ export function useUploadType({
|
||||
return { getAccept, getStringAccept, getHelpText };
|
||||
}
|
||||
|
||||
// TODO @芋艿:目前保持和 admin-vue3 一致,后续可能重构
|
||||
// TODO @AIOTAGRO:目前保持和 admin-vue3 一致,后续可能重构
|
||||
export function useUpload(directory?: string) {
|
||||
// 后端上传地址
|
||||
const uploadUrl = getUploadUrl();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
// TODO @芋艿:后续合并到 diy-editor 里,并不是通用的;
|
||||
// TODO @AIOTAGRO:后续合并到 diy-editor 里,并不是通用的;
|
||||
/**
|
||||
* 垂直按钮组
|
||||
* Element官方的按钮组只支持水平显示,通过重写样式实现垂直布局
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# locale
|
||||
|
||||
每个app使用的国际化可能不同,这里用于扩展国际化的功能,例如扩展 dayjs、antd组件库的多语言切换,以及app本身的国际化文件。
|
||||
每个app使用的国际化可能不同,这里用于扩展国际化的功能,例如扩展 dayjs、antd组件库的多语言切换,以及app本身的国际化文件<EFBFBD><EFBFBD>?
|
||||
|
||||
@@ -20,6 +20,6 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
},
|
||||
copyright: {
|
||||
companyName: import.meta.env.VITE_APP_TITLE,
|
||||
companySiteLink: 'https://gitee.com/yudaocode/yudao-ui-admin-vben',
|
||||
companySiteLink: 'https://gitee.com/yudaocode/yudao-ui-admin-vben', // AIOTAGRO
|
||||
},
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||
return await generateAccessible(preferences.app.accessMode, {
|
||||
...options,
|
||||
fetchMenuListAsync: async () => {
|
||||
// 由于 yudao 通过 accessStore 读取,所以不在进行 message.loading 提示
|
||||
// 由于 AIOTAGRO 通过 accessStore 读取,所以不在进行 message.loading 提示
|
||||
// 补充说明:accessStore.accessMenus 一开始是 AppRouteRecordRaw 类型(后端加载),后面被赋值成 MenuRecordRaw 类型(前端转换)
|
||||
const accessMenus = accessStore.accessMenus as AppRouteRecordRaw[];
|
||||
return convertServerMenuToRouteRecordStringComponent(accessMenus);
|
||||
|
||||
@@ -102,7 +102,7 @@ function setupAccessGuard(router: Router) {
|
||||
// 当前登录用户拥有的角色标识列表
|
||||
let userInfo = userStore.userInfo;
|
||||
if (!userInfo) {
|
||||
// add by 芋艿:由于 yudao 是 fetchUserInfo 统一加载用户 + 权限信息,所以将 fetchMenuListAsync
|
||||
// add by 芋艿:由于 AIOTAGRO 是 fetchUserInfo 统一加载用户 + 权限信息,所以将 fetchMenuListAsync
|
||||
const message = ElMessage({
|
||||
message: `${$t('common.loadingMenu')}...`,
|
||||
type: 'success',
|
||||
|
||||
@@ -35,7 +35,7 @@ const coreRouteNames = traverseTreeValues(coreRoutes, (route) => route.name);
|
||||
/** 有权限校验的路由列表,包含动态路由和静态路由 */
|
||||
const accessRoutes = [...dynamicRoutes, ...staticRoutes];
|
||||
|
||||
// add by 芋艿:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/router/routes/index.ts#L38-L45
|
||||
// add by AIOTAGRO:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/router/routes/index.ts#L38-L45
|
||||
const componentKeys: string[] = Object.keys(
|
||||
import.meta.glob('../../views/**/*.vue'),
|
||||
)
|
||||
|
||||
@@ -78,4 +78,4 @@ const routes: RouteRecordRaw[] = [
|
||||
// },
|
||||
];
|
||||
|
||||
export default routes; // update by 芋艿:不展示
|
||||
export default routes; // update by AIOTAGRO:不展示
|
||||
|
||||
@@ -71,7 +71,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
accessStore.setRefreshToken(refreshToken);
|
||||
|
||||
// 获取用户信息并存储到 userStore、accessStore 中
|
||||
// TODO @芋艿:清理掉 accessCodes 相关的逻辑
|
||||
// TODO @AIOTAGRO:清理掉 accessCodes 相关的逻辑
|
||||
// const [fetchUserInfoResult, accessCodes] = await Promise.all([
|
||||
// fetchUserInfo(),
|
||||
// // getAccessCodesApi(),
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# \_core
|
||||
|
||||
此目录包含应用程序正常运行所需的基本视图。这些视图是应用程序布局中使用的视图。
|
||||
此目录包含应用程序正常运行所需的基本视图。这些视图是应用程序布局中使用的视图<EFBFBD><EFBFBD>?
|
||||
|
||||
@@ -57,7 +57,7 @@ onMounted(loadProfile);
|
||||
<ElTabPane name="userSocial" label="社交绑定" force-render>
|
||||
<UserSocial @update:active-name="activeName = $event" />
|
||||
</ElTabPane>
|
||||
<!-- TODO @芋艿:在线设备 -->
|
||||
<!-- TODO @AIOTAGRO:在线设备 -->
|
||||
</ElTabs>
|
||||
</ElCard>
|
||||
</div>
|
||||
|
||||
@@ -176,7 +176,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
});
|
||||
|
||||
/** 获取数据源配置列表 */
|
||||
// TODO @芋艿:这种场景的最佳实践;
|
||||
// TODO @AIOTAGRO:这种场景的最佳实践;
|
||||
async function initDataSourceConfig() {
|
||||
try {
|
||||
dataSourceConfigList.value = await getDataSourceConfigList();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { TabPaneName } from 'element-plus';
|
||||
|
||||
// TODO @芋艿:待定,vben2.0 有 CodeEditor,不确定官方后续会不会迁移!!!
|
||||
// TODO @AIOTAGRO:待定,vben2.0 有 CodeEditor,不确定官方后续会不会迁移!!!
|
||||
import type { InfraCodegenApi } from '#/api/infra/codegen';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
@@ -74,7 +74,7 @@ const getOrderData = async () => {
|
||||
|
||||
/** 查询商品数据 */
|
||||
const getProductData = async () => {
|
||||
// TODO: @芋艿:这个接口的返回值,是不是用命名字段更好些?
|
||||
// TODO: @AIOTAGRO:这个接口的返回值,是不是用命名字段更好些?
|
||||
const productCount = await getTabsCount();
|
||||
data.value.productForSale = productCount['0'] || 0;
|
||||
data.value.productInWarehouse = productCount['1'] || 0;
|
||||
|
||||
@@ -150,7 +150,7 @@ export function useTypeGridColumns(): VxeTableGridOptions['columns'] {
|
||||
|
||||
// ============================== 字典数据 ==============================
|
||||
|
||||
// TODO @芋艿:后续针对 antd,增加
|
||||
// TODO @AIOTAGRO:后续针对 antd,增加
|
||||
/** 颜色选项 */
|
||||
const colorOptions = [
|
||||
{ value: '', label: '无' },
|
||||
|
||||
@@ -125,7 +125,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||
{
|
||||
field: 'avatar',
|
||||
label: '用户头像',
|
||||
// TODO @芋艿:使用 antd 的 Image 组件
|
||||
// TODO @AIOTAGRO:使用 antd 的 Image 组件
|
||||
content: (data: SystemSocialUserApi.SocialUser) => {
|
||||
if (data?.avatar) {
|
||||
return h('img', {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { computed } from 'vue';
|
||||
|
||||
import { NTag } from 'naive-ui';
|
||||
|
||||
// import { isHexColor } from '@/utils/color' // TODO @芋艿:【可优化】增加 cssClass 的处理 https://gitee.com/yudaocode/yudao-ui-admin-vben/blob/v2.4.1/src/components/DictTag/src/DictTag.vue#L60
|
||||
// import { isHexColor } from '@/utils/color' // TODO @AIOTAGRO:【可优化】增加 cssClass 的处理 https://gitee.com/yudaocode/yudao-ui-admin-vben/blob/v2.4.1/src/components/DictTag/src/DictTag.vue#L60
|
||||
import { getDictObj } from '#/utils';
|
||||
|
||||
interface DictTagProps {
|
||||
|
||||
@@ -22,7 +22,7 @@ onMounted(() => {
|
||||
init();
|
||||
}, 300);
|
||||
});
|
||||
// TODO @芋艿:优化:未来使用 vben 自带的内链实现
|
||||
// TODO @AIOTAGRO:优化:未来使用 vben 自带的内链实现
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -78,7 +78,7 @@ export function useUploadType({
|
||||
return { getAccept, getStringAccept, getHelpText };
|
||||
}
|
||||
|
||||
// TODO @芋艿:目前保持和 admin-vue3 一致,后续可能重构
|
||||
// TODO @AIOTAGRO:目前保持和 admin-vue3 一致,后续可能重构
|
||||
export function useUpload(directory?: string) {
|
||||
// 后端上传地址
|
||||
const uploadUrl = getUploadUrl();
|
||||
|
||||
@@ -20,6 +20,6 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
},
|
||||
copyright: {
|
||||
companyName: import.meta.env.VITE_APP_TITLE,
|
||||
companySiteLink: 'https://gitee.com/yudaocode/yudao-ui-admin-vben',
|
||||
companySiteLink: 'https://gitee.com/yudaocode/yudao-ui-admin-vben', // AIOTAGRO
|
||||
},
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||
return await generateAccessible(preferences.app.accessMode, {
|
||||
...options,
|
||||
fetchMenuListAsync: async () => {
|
||||
// 由于 yudao 通过 accessStore 读取,所以不在进行 message.loading 提示
|
||||
// 由于 AIOTAGRO 通过 accessStore 读取,所以不在进行 message.loading 提示
|
||||
// 补充说明:accessStore.accessMenus 一开始是 AppRouteRecordRaw 类型(后端加载),后面被赋值成 MenuRecordRaw 类型(前端转换)
|
||||
const accessMenus = accessStore.accessMenus as AppRouteRecordRaw[];
|
||||
return convertServerMenuToRouteRecordStringComponent(accessMenus);
|
||||
|
||||
@@ -101,7 +101,7 @@ function setupAccessGuard(router: Router) {
|
||||
// 当前登录用户拥有的角色标识列表
|
||||
let userInfo = userStore.userInfo;
|
||||
if (!userInfo) {
|
||||
// add by 芋艿:由于 yudao 是 fetchUserInfo 统一加载用户 + 权限信息,所以将 fetchMenuListAsync
|
||||
// add by 芋艿:由于 AIOTAGRO 是 fetchUserInfo 统一加载用户 + 权限信息,所以将 fetchMenuListAsync
|
||||
const loading = message.loading(`${$t('common.loadingMenu')}...`);
|
||||
try {
|
||||
const authPermissionInfo = await authStore.fetchUserInfo();
|
||||
|
||||
@@ -61,7 +61,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
accessStore.setRefreshToken(refreshToken);
|
||||
|
||||
// 获取用户信息并存储到 userStore、accessStore 中
|
||||
// TODO @芋艿:清理掉 accessCodes 相关的逻辑
|
||||
// TODO @AIOTAGRO:清理掉 accessCodes 相关的逻辑
|
||||
// const [fetchUserInfoResult, accessCodes] = await Promise.all([
|
||||
// fetchUserInfo(),
|
||||
// // getAccessCodesApi(),
|
||||
|
||||
@@ -13,7 +13,7 @@ interface DictState {
|
||||
dictCache: Dict;
|
||||
}
|
||||
|
||||
// TODO @芋艿:可以共享么?
|
||||
// TODO @AIOTAGRO:可以共享么?
|
||||
export const useDictStore = defineStore('dict', {
|
||||
actions: {
|
||||
getDictData(dictType: string, value: any) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// todo @芋艿:要不要共享
|
||||
// todo @AIOTAGRO:要不要共享
|
||||
/**
|
||||
* Created by 芋道源码
|
||||
* Created by AIOTAGRO
|
||||
*
|
||||
* 枚举类
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { SelectOption } from 'naive-ui/es/select';
|
||||
// TODO @芋艿:后续再优化
|
||||
// TODO @芋艿:可以共享么?
|
||||
// TODO @AIOTAGRO:后续再优化
|
||||
// TODO @AIOTAGRO:可以共享么?
|
||||
|
||||
import { isObject } from '@vben/utils';
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ onMounted(loadProfile);
|
||||
<NTabPane name="userSocial" tab="社交绑定" force-render>
|
||||
<UserSocial @update:active-name="activeName = $event" />
|
||||
</NTabPane>
|
||||
<!-- TODO @芋艿:在线设备 -->
|
||||
<!-- TODO @AIOTAGRO:在线设备 -->
|
||||
</NTabs>
|
||||
</NCard>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
// TODO @芋艿:待定,vben2.0 有 CodeEditor,不确定官方后续会不会迁移!!!
|
||||
// TODO @AIOTAGRO:待定,vben2.0 有 CodeEditor,不确定官方后续会不会迁移!!!
|
||||
import type { InfraCodegenApi } from '#/api/infra/codegen';
|
||||
|
||||
import { h, ref } from 'vue';
|
||||
|
||||
@@ -83,7 +83,7 @@ export function useGridColumns<T = InfraFileApi.File>(
|
||||
title: '文件大小',
|
||||
minWidth: 80,
|
||||
formatter: ({ cellValue }) => {
|
||||
// TODO @芋艿:后续优化下
|
||||
// TODO @AIOTAGRO:后续优化下
|
||||
if (!cellValue) return '0 B';
|
||||
const unitArr = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
const index = Math.floor(Math.log(cellValue) / Math.log(1024));
|
||||
|
||||
@@ -37,7 +37,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
// readonly: ({ values }) => !!values.id,
|
||||
},
|
||||
rules: 'required',
|
||||
// TODO @芋艿:在修改场景下,禁止调整
|
||||
// TODO @AIOTAGRO:在修改场景下,禁止调整
|
||||
},
|
||||
{
|
||||
fieldName: 'handlerParam',
|
||||
@@ -55,7 +55,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
placeholder: '请输入 CRON 表达式',
|
||||
},
|
||||
rules: 'required',
|
||||
// TODO @芋艿:未来支持动态的 CRON 表达式选择
|
||||
// TODO @AIOTAGRO:未来支持动态的 CRON 表达式选择
|
||||
},
|
||||
{
|
||||
fieldName: 'retryCount',
|
||||
@@ -199,7 +199,7 @@ export function useGridColumns<T = InfraJobApi.Job>(
|
||||
text: '执行',
|
||||
show: hasAccessByCodes(['infra:job:trigger']),
|
||||
},
|
||||
// TODO @芋艿:增加一个“更多”选项
|
||||
// TODO @AIOTAGRO:增加一个"更多"选项
|
||||
{
|
||||
code: 'detail',
|
||||
text: '详细',
|
||||
|
||||
@@ -166,7 +166,7 @@ export function useTypeGridColumns<T = SystemDictTypeApi.DictType>(
|
||||
|
||||
// ============================== 字典数据 ==============================
|
||||
|
||||
// TODO @芋艿:后续针对 antd,增加
|
||||
// TODO @AIOTAGRO:后续针对 antd,增加
|
||||
/**
|
||||
* 颜色选项
|
||||
*/
|
||||
|
||||
@@ -125,7 +125,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
componentProps: {
|
||||
placeholder: '请输入自动授权范围',
|
||||
mode: 'multiple',
|
||||
// TODO @芋艿:根据权限,自动授权范围
|
||||
// TODO @AIOTAGRO:根据权限,自动授权范围
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ function onActionClick({
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
// TODO @芋艿:时间筛选,后续处理;
|
||||
// TODO @AIOTAGRO:时间筛选,后续处理;
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(onActionClick),
|
||||
|
||||
@@ -330,7 +330,7 @@ export function useGridColumns<T = SystemUserApi.User>(
|
||||
onClick: onActionClick,
|
||||
},
|
||||
name: 'CellOperation',
|
||||
// TODO @芋艿:后续把 delete、assign-role、reset-password 搞成"更多"
|
||||
// TODO @AIOTAGRO:后续把 delete、assign-role、reset-password 搞成"更多"
|
||||
options: [
|
||||
{
|
||||
code: 'edit',
|
||||
|
||||
Reference in New Issue
Block a user