diff --git a/.env b/.env index 5f2334a3..a77d490d 100644 --- a/.env +++ b/.env @@ -15,3 +15,6 @@ VITE_APP_CAPTCHA_ENABLE=true # 验证码的开关 VITE_APP_CAPTCHA_ENABLE=true + +# 百度统计 +VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc diff --git a/.env.dev b/.env.dev index 3b85e481..a52eec30 100644 --- a/.env.dev +++ b/.env.dev @@ -16,7 +16,7 @@ VITE_API_BASEPATH=/dev-api VITE_API_URL=/admin-api # 打包路径 -VITE_BASE_PATH=/dist-dev/ +VITE_BASE_PATH=/ # 是否删除debugger VITE_DROP_DEBUGGER=false diff --git a/src/api/infra/redis/index.ts b/src/api/infra/redis/index.ts index 9856fa64..f27be77f 100644 --- a/src/api/infra/redis/index.ts +++ b/src/api/infra/redis/index.ts @@ -6,39 +6,3 @@ import request from '@/config/axios' export const getCache = () => { return request.get({ url: '/infra/redis/get-monitor-info' }) } - -// 获取模块 -export const getKeyDefineList = () => { - return request.get({ url: '/infra/redis/get-key-define-list' }) -} - -/** - * 获取redis key列表 - */ -export const getKeyList = (keyTemplate: string) => { - return request.get({ - url: '/infra/redis/get-key-list', - params: { - keyTemplate - } - }) -} - -// 获取缓存内容 -export const getKeyValue = (key: string) => { - return request.get({ url: '/infra/redis/get-key-value?key=' + key }) -} - -// 根据键名删除缓存 -export const deleteKey = (key: string) => { - return request.delete({ url: '/infra/redis/delete-key?key=' + key }) -} - -export const deleteKeys = (keyTemplate: string) => { - return request.delete({ - url: '/infra/redis/delete-keys?', - params: { - keyTemplate - } - }) -} diff --git a/src/api/infra/redis/types.ts b/src/api/infra/redis/types.ts index 2342e543..548bfe96 100644 --- a/src/api/infra/redis/types.ts +++ b/src/api/infra/redis/types.ts @@ -174,12 +174,3 @@ export interface RedisCommandStatsVO { calls: number usec: number } - -export interface RedisKeyInfo { - keyTemplate: string - keyType: string - valueType: string - timeoutType: number - timeout: number - memo: string -} diff --git a/src/api/login/index.ts b/src/api/login/index.ts index 2255e3cf..536f6a66 100644 --- a/src/api/login/index.ts +++ b/src/api/login/index.ts @@ -2,15 +2,11 @@ import request from '@/config/axios' import { getRefreshToken } from '@/utils/auth' import type { UserLoginVO } from './types' -export interface CodeImgResult { - captchaOnOff: boolean - img: string - uuid: string -} export interface SmsCodeVO { mobile: string scene: number } + export interface SmsLoginVO { mobile: string code: string diff --git a/src/api/login/oauth2/index.ts b/src/api/login/oauth2/index.ts new file mode 100644 index 00000000..aef1820d --- /dev/null +++ b/src/api/login/oauth2/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +// 获得授权信息 +export const getAuthorize = (clientId: string) => { + return request.get({ url: '/system/oauth2/authorize?clientId=' + clientId }) +} + +// 发起授权 +export const authorize = ( + responseType: string, + clientId: string, + redirectUri: string, + state: string, + autoApprove: boolean, + checkedScopes: string[], + uncheckedScopes: string[] +) => { + // 构建 scopes + const scopes = {} + for (const scope of checkedScopes) { + scopes[scope] = true + } + for (const scope of uncheckedScopes) { + scopes[scope] = false + } + // 发起请求 + return request.post({ + url: '/system/oauth2/authorize', + headers: { + 'Content-type': 'application/x-www-form-urlencoded' + }, + params: { + response_type: responseType, + client_id: clientId, + redirect_uri: redirectUri, + state: state, + auto_approve: autoApprove, + scope: JSON.stringify(scopes) + } + }) +} diff --git a/src/api/login/types.ts b/src/api/login/types.ts index 1a91aecc..b2173f72 100644 --- a/src/api/login/types.ts +++ b/src/api/login/types.ts @@ -26,17 +26,3 @@ export type UserVO = { loginIp: string loginDate: string } - -export type UserInfoVO = { - permissions: [] - roles: [] - user: { - avatar: string - id: number - nickname: string - } -} - -export type TentantNameVO = { - name: string -} diff --git a/src/api/mall/product/brand.ts b/src/api/mall/product/brand.ts new file mode 100644 index 00000000..dc8acc2a --- /dev/null +++ b/src/api/mall/product/brand.ts @@ -0,0 +1,56 @@ +import request from '@/config/axios' + +/** + * 商品品牌 + */ +export interface BrandVO { + /** + * 品牌编号 + */ + id?: number + /** + * 品牌名称 + */ + name: string + /** + * 品牌图片 + */ + picUrl: string + /** + * 品牌排序 + */ + sort?: number + /** + * 品牌描述 + */ + description?: string + /** + * 开启状态 + */ + status: number +} + +// 创建商品品牌 +export const createBrand = (data: BrandVO) => { + return request.post({ url: '/product/brand/create', data }) +} + +// 更新商品品牌 +export const updateBrand = (data: BrandVO) => { + return request.put({ url: '/product/brand/update', data }) +} + +// 删除商品品牌 +export const deleteBrand = (id: number) => { + return request.delete({ url: `/product/brand/delete?id=${id}` }) +} + +// 获得商品品牌 +export const getBrand = (id: number) => { + return request.get({ url: `/product/brand/get?id=${id}` }) +} + +// 获得商品品牌列表 +export const getBrandParam = (params: PageParam) => { + return request.get({ url: '/product/brand/page', params }) +} diff --git a/src/api/mp/mpuser/index.ts b/src/api/mp/user/index.ts similarity index 100% rename from src/api/mp/mpuser/index.ts rename to src/api/mp/user/index.ts diff --git a/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue b/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue index e2c406db..2d47b8f0 100644 --- a/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue +++ b/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue @@ -23,7 +23,7 @@ @@ -49,7 +49,7 @@ const message = useMessage() const signalList = ref([]) const messageList = ref([]) -const modelVisible = ref(false) +const dialogVisible = ref(false) const modelType = ref('') const modelObjectForm = ref({}) const rootElements = ref() @@ -85,7 +85,7 @@ const initDataList = () => { const openModel = (type) => { modelType.value = type modelObjectForm.value = {} - modelVisible.value = true + dialogVisible.value = true } const addNewObject = () => { if (modelType.value === 'message') { @@ -101,7 +101,7 @@ const addNewObject = () => { const signalRef = bpmnInstances().moddle.create('bpmn:Signal', modelObjectForm.value) rootElements.value.push(signalRef) } - modelVisible.value = false + dialogVisible.value = false initDataList() } diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index fb205a6b..1a4741b6 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -1,8 +1,8 @@ import axios, { + AxiosError, AxiosInstance, AxiosRequestHeaders, AxiosResponse, - AxiosError, InternalAxiosRequestConfig } from 'axios' @@ -230,7 +230,8 @@ const handleAuthorized = () => { wsCache.clear() removeToken() isRelogin.show = false - window.location.href = import.meta.env.VITE_BASE_PATH + // 干掉token后再走一次路由让它过router.beforeEach的校验 + window.location.href = window.location.href }) } return Promise.reject(t('sys.api.timeoutMessage')) diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 7c5742c4..cc4bb47e 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -352,6 +352,7 @@ export default { login: { backSignIn: '返回', signInFormTitle: '登录', + ssoFormTitle: '三方授权', mobileSignInFormTitle: '手机登录', qrSignInFormTitle: '二维码登录', signUpFormTitle: '注册', diff --git a/src/main.ts b/src/main.ts index b3a9da16..f24560b5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -52,6 +52,8 @@ import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css' import hljs from 'highlight.js' //导入代码高亮文件 import 'highlight.js/styles/github.css' //导入代码高亮样式 新版 +import '@/plugins/tongji' // 百度统计 + import Logger from '@/utils/Logger' // 本地开发模式 全局引入 element-plus 样式,加快第一次进入速度 diff --git a/src/plugins/tongji/index.ts b/src/plugins/tongji/index.ts new file mode 100644 index 00000000..ec261a16 --- /dev/null +++ b/src/plugins/tongji/index.ts @@ -0,0 +1,23 @@ +import router from '@/router' + +// 用于 router push +window._hmt = window._hmt || [] +// HM_ID +const HM_ID = import.meta.env.VITE_APP_BAIDU_CODE +;(function () { + // 有值的时候,才开启 + if (!HM_ID) { + return + } + const hm = document.createElement('script') + hm.src = 'https://hm.baidu.com/hm.js?' + HM_ID + const s = document.getElementsByTagName('script')[0] + s.parentNode.insertBefore(hm, s) +})() + +router.afterEach(function (to) { + if (!HM_ID) { + return + } + _hmt.push(['_trackPageview', to.fullPath]) +}) diff --git a/src/router/index.ts b/src/router/index.ts index 02d913f8..8f66ca31 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,11 +1,11 @@ import type { App } from 'vue' import type { RouteRecordRaw } from 'vue-router' -import { createRouter, createWebHashHistory } from 'vue-router' +import { createRouter, createWebHistory } from 'vue-router' import remainingRouter from './modules/remaining' // 创建路由实例 const router = createRouter({ - history: createWebHashHistory(), // createWebHashHistory URL带#,createWebHistory URL不带# + history: createWebHistory(), // createWebHashHistory URL带#,createWebHistory URL不带# strict: true, routes: remainingRouter as RouteRecordRaw[], scrollBehavior: () => ({ left: 0, top: 0 }) diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 671ca353..8886e388 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -116,7 +116,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: 'type/data/:dictType', component: () => import('@/views/system/dict/data/index.vue'), - name: 'data', + name: 'SystemDictData', meta: { title: '字典数据', noCache: true, @@ -140,7 +140,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: 'edit', component: () => import('@/views/infra/codegen/EditTable.vue'), - name: 'EditTable', + name: 'InfraCodegenEditTable', meta: { noCache: true, hidden: true, @@ -163,7 +163,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: 'job-log', component: () => import('@/views/infra/job/logger/index.vue'), - name: 'JobLog', + name: 'InfraJobLog', meta: { noCache: true, hidden: true, @@ -185,6 +185,16 @@ const remainingRouter: AppRouteRecordRaw[] = [ noTagsView: true } }, + { + path: '/sso', + component: () => import('@/views/Login/Login.vue'), + name: 'SSOLogin', + meta: { + hidden: true, + title: t('router.login'), + noTagsView: true + } + }, { path: '/403', component: () => import('@/views/Error/403.vue'), @@ -226,7 +236,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: '/manager/form/edit', component: () => import('@/views/bpm/form/editor/index.vue'), - name: 'bpmFormEditor', + name: 'BpmFormEditor', meta: { noCache: true, hidden: true, @@ -238,7 +248,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: '/manager/model/edit', component: () => import('@/views/bpm/model/editor/index.vue'), - name: 'modelEditor', + name: 'BpmModelEditor', meta: { noCache: true, hidden: true, @@ -250,7 +260,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: '/manager/definition', component: () => import('@/views/bpm/definition/index.vue'), - name: 'BpmProcessDefinitionList', + name: 'BpmProcessDefinition', meta: { noCache: true, hidden: true, @@ -262,7 +272,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: '/manager/task-assign-rule', component: () => import('@/views/bpm/taskAssignRule/index.vue'), - name: 'BpmTaskAssignRuleList', + name: 'BpmTaskAssignRule', meta: { noCache: true, hidden: true, @@ -305,18 +315,6 @@ const remainingRouter: AppRouteRecordRaw[] = [ title: '发起 OA 请假', activeMenu: 'bpm/oa/leave/create' } - }, - { - path: '/bpm/oa/leave/detail', - component: () => import('@/views/bpm/oa/leave/detail.vue'), - name: 'OALeaveDetail', - meta: { - noCache: true, - hidden: true, - canTo: true, - title: '查看 OA 请假', - activeMenu: 'bpm/oa/leave/detail' - } } ] }, @@ -331,7 +329,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: 'value/:propertyId(\\d+)', component: () => import('@/views/mall/product/property/value/index.vue'), - name: 'PropertyValue', + name: 'ProductPropertyValue', meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' } } ] diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index 8b5de138..6b2e9456 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -25,13 +25,12 @@ declare module '@vue/runtime-core' { Echart: typeof import('./../components/Echart/src/Echart.vue')['default'] Editor: typeof import('./../components/Editor/src/Editor.vue')['default'] ElAlert: typeof import('element-plus/es')['ElAlert'] - ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer'] - ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElButton: typeof import('element-plus/es')['ElButton'] ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElCard: typeof import('element-plus/es')['ElCard'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] + ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] ElCol: typeof import('element-plus/es')['ElCol'] ElCollapse: typeof import('element-plus/es')['ElCollapse'] ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] @@ -71,19 +70,14 @@ declare module '@vue/runtime-core' { ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] ElSkeleton: typeof import('element-plus/es')['ElSkeleton'] - ElSpace: typeof import('element-plus/es')['ElSpace'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] - ElTableV2: typeof import('element-plus/es')['ElTableV2'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] - ElTimeline: typeof import('element-plus/es')['ElTimeline'] - ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTree: typeof import('element-plus/es')['ElTree'] - ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] ElUpload: typeof import('element-plus/es')['ElUpload'] Error: typeof import('./../components/Error/src/Error.vue')['default'] FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default'] diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 05c70dad..d1d84242 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -112,7 +112,6 @@ export enum DICT_TYPE { // ========== INFRA 模块 ========== INFRA_BOOLEAN_STRING = 'infra_boolean_string', - INFRA_REDIS_TIMEOUT_TYPE = 'infra_redis_timeout_type', INFRA_JOB_STATUS = 'infra_job_status', INFRA_JOB_LOG_STATUS = 'infra_job_log_status', INFRA_API_ERROR_LOG_PROCESS_STATUS = 'infra_api_error_log_process_status', diff --git a/src/views/Login/Login.vue b/src/views/Login/Login.vue index a513b0ca..a0186ab7 100644 --- a/src/views/Login/Login.vue +++ b/src/views/Login/Login.vue @@ -9,19 +9,19 @@ >
- + {{ underlineToHump(appStore.getTitle) }}
- -
{{ t('login.welcome') }}
-
+ +
{{ t('login.welcome') }}
+
{{ t('login.message') }}
@@ -31,7 +31,7 @@
- + {{ underlineToHump(appStore.getTitle) }}
@@ -52,20 +52,23 @@ + +
- diff --git a/src/views/Login/components/index.ts b/src/views/Login/components/index.ts index 903b1723..204ad73d 100644 --- a/src/views/Login/components/index.ts +++ b/src/views/Login/components/index.ts @@ -3,5 +3,6 @@ import MobileForm from './MobileForm.vue' import LoginFormTitle from './LoginFormTitle.vue' import RegisterForm from './RegisterForm.vue' import QrCodeForm from './QrCodeForm.vue' +import SSOLoginVue from './SSOLogin.vue' -export { LoginForm, MobileForm, LoginFormTitle, RegisterForm, QrCodeForm } +export { LoginForm, MobileForm, LoginFormTitle, RegisterForm, QrCodeForm, SSOLoginVue } diff --git a/src/views/Login/components/useLogin.ts b/src/views/Login/components/useLogin.ts index dc46e097..b4a02f8f 100644 --- a/src/views/Login/components/useLogin.ts +++ b/src/views/Login/components/useLogin.ts @@ -5,7 +5,8 @@ export enum LoginStateEnum { REGISTER, RESET_PASSWORD, MOBILE, - QR_CODE + QR_CODE, + SSO } const currentState = ref(LoginStateEnum.LOGIN) diff --git a/src/views/bpm/definition/index.vue b/src/views/bpm/definition/index.vue index 8bb92feb..f5fff612 100644 --- a/src/views/bpm/definition/index.vue +++ b/src/views/bpm/definition/index.vue @@ -93,7 +93,7 @@ - diff --git a/src/views/bpm/processInstance/process.data.ts b/src/views/bpm/processInstance/process.data.ts deleted file mode 100644 index 317e143d..00000000 --- a/src/views/bpm/processInstance/process.data.ts +++ /dev/null @@ -1,94 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' - -const { t } = useI18n() // 国际化 - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: null, - primaryTitle: '编号', - action: true, - actionWidth: '200px', - columns: [ - { - title: '编号', - field: 'id', - table: { - width: 320 - } - }, - { - title: '流程名', - field: 'name', - isSearch: true - }, - { - title: '所属流程', - field: 'processDefinitionId', - isSearch: true, - isTable: false - }, - { - title: '流程分类', - field: 'category', - dictType: DICT_TYPE.BPM_MODEL_CATEGORY, - dictClass: 'number', - isSearch: true, - table: { - slots: { - default: 'category_default' - } - } - }, - { - title: '当前审批任务', - field: 'tasks', - table: { - width: 140, - slots: { - default: 'tasks_default' - } - } - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '结果', - field: 'result', - dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, - dictClass: 'number', - isSearch: true - }, - { - title: '提交时间', - field: 'createTime', - formatter: 'formatDate', - table: { - width: 180 - }, - isForm: false, - isSearch: true, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: '结束时间', - field: 'endTime', - formatter: 'formatDate', - table: { - width: 180 - }, - isForm: false - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/bpm/task/done/index.vue b/src/views/bpm/task/done/index.vue index 75ba0fef..ae3352d9 100644 --- a/src/views/bpm/task/done/index.vue +++ b/src/views/bpm/task/done/index.vue @@ -74,7 +74,7 @@ - diff --git a/src/views/bpm/task/todo/todo.data.ts b/src/views/bpm/task/todo/todo.data.ts deleted file mode 100644 index 419a80fe..00000000 --- a/src/views/bpm/task/todo/todo.data.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' - -const { t } = useI18n() // 国际化 - -// crudSchemas -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: null, - action: true, - searchSpan: 8, - columns: [ - { - title: '任务编号', - field: 'id', - table: { - width: 320 - } - }, - { - title: '任务名称', - field: 'name', - isSearch: true - }, - { - title: '所属流程', - field: 'processInstance.name' - }, - { - title: '流程发起人', - field: 'processInstance.startUserNickname' - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - table: { - width: 180 - }, - isSearch: true, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: '任务状态', - field: 'suspensionState', - table: { - slots: { - default: 'suspensionState_default' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/bpm/taskAssignRule/index.vue b/src/views/bpm/taskAssignRule/index.vue index 4a4e76f8..d54fe168 100644 --- a/src/views/bpm/taskAssignRule/index.vue +++ b/src/views/bpm/taskAssignRule/index.vue @@ -32,7 +32,7 @@ - diff --git a/src/views/infra/file/FileForm.vue b/src/views/infra/file/FileForm.vue index 36f251e8..5485870d 100644 --- a/src/views/infra/file/FileForm.vue +++ b/src/views/infra/file/FileForm.vue @@ -2,17 +2,19 @@
将文件拖到此处,或 点击上传
@@ -29,44 +31,47 @@
diff --git a/src/views/infra/file/index.vue b/src/views/infra/file/index.vue index 6e709ec7..91d7639e 100644 --- a/src/views/infra/file/index.vue +++ b/src/views/infra/file/index.vue @@ -1,9 +1,14 @@ - - diff --git a/src/views/infra/server/index.vue b/src/views/infra/server/index.vue index dad3047c..57a5bc5c 100644 --- a/src/views/infra/server/index.vue +++ b/src/views/infra/server/index.vue @@ -1,10 +1,25 @@