diff --git a/src/api/app/appmenu.ts b/src/api/app/appmenu.ts index 125a959e..3a3193d4 100644 --- a/src/api/app/appmenu.ts +++ b/src/api/app/appmenu.ts @@ -1,49 +1,94 @@ import request from "/@/utils/request"; +import {getDetailsByPhone} from "/@/api/admin/user"; export const pageList = (params?: Object) => { - return request({ - url: '/admin/appmenu/tree', - method: "get", - params - }) + return request({ + url: '/admin/appmenu/tree', + method: "get", + params + }) } export const info = (id: String) => { - return request({ - url: `/admin/appmenu/${id}`, - method: "get", - }) + return request({ + url: `/admin/appmenu/${id}`, + method: "get", + }) } export const save = (data: Object) => { - return request({ - url: '/admin/appmenu', - method: "post", - data: data - }) + return request({ + url: '/admin/appmenu', + method: "post", + data: data + }) } export const update = (data: Object) => { - return request({ - url: '/admin/appmenu', - method: "put", - data: data - }) + return request({ + url: '/admin/appmenu', + method: "put", + data: data + }) } export const addObj = (data: Object) => { - return request({ - url: '/admin/appmenu', - method: "post", - data: data - }) + return request({ + url: '/admin/appmenu', + method: "post", + data: data + }) } -export function delObj (ids?:object) { - return request({ - url: '/admin/appmenu', - method: 'delete', - data:ids - }) +export function delObj(ids?: object) { + return request({ + url: '/admin/appmenu', + method: 'delete', + data: ids + }) +} + +export function getDetails(obj: Object) { + return request({ + url: '/admin/appmenu/details/' + obj, + method: 'get' + }) +} + + +export function getDetailsByName(obj: Object) { + return request({ + url: '/admin/appmenu/detailsByName/' + obj, + method: 'get' + }) +} + +export function validatePermission(rule: any, value: any, callback: any, isEdit: boolean) { + if (isEdit) { + return callback() + } + + getDetails(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('权限标识已经存在')) + } else { + callback() + } + }) +} + +export function validateByName(rule: any, value: any, callback: any, isEdit: boolean) { + if (isEdit) { + return callback() + } + getDetailsByName(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('菜单名称已经存在')) + } else { + callback() + } + }) } diff --git a/src/api/app/approle.ts b/src/api/app/approle.ts index 9d3c3127..726a94eb 100644 --- a/src/api/app/approle.ts +++ b/src/api/app/approle.ts @@ -1,65 +1,115 @@ import request from "/@/utils/request"; export function fetchList(query: any) { - return request({ - url: '/admin/approle/page', - method: 'get', - params: query - }) + return request({ + url: '/admin/approle/page', + method: 'get', + params: query + }) } export function list() { - return request({ - url: '/admin/approle/list', - method: 'get' - }) + return request({ + url: '/admin/approle/list', + method: 'get' + }) } export function addObj(obj: any) { - return request({ - url: '/admin/approle', - method: 'post', - data: obj - }) + return request({ + url: '/admin/approle', + method: 'post', + data: obj + }) } export function getObj(id: string) { - return request({ - url: '/admin/approle/' + id, - method: 'get' - }) + return request({ + url: '/admin/approle/' + id, + method: 'get' + }) } -export function delObj( ids?:object ) { - return request({ - url: '/admin/approle', - method: 'delete', - data:ids - }) +export function delObj(ids?: object) { + return request({ + url: '/admin/approle', + method: 'delete', + data: ids + }) } export function putObj(obj: any) { - return request({ - url: '/admin/approle', - method: 'put', - data: obj - }) + return request({ + url: '/admin/approle', + method: 'put', + data: obj + }) } export function fetchRoleTree(roleId: string) { - return request({ - url: '/admin/appmenu/tree/' + roleId, - method: 'get' - }) + return request({ + url: '/admin/appmenu/tree/' + roleId, + method: 'get' + }) } export function permissionUpd(roleId: string, menuIds: string) { - return request({ - url: '/admin/approle/menu', - method: 'put', - data: { - roleId: roleId, - menuIds: menuIds - } - }) + return request({ + url: '/admin/approle/menu', + method: 'put', + data: { + roleId: roleId, + menuIds: menuIds + } + }) +} + +export function getDetails(obj: Object) { + return request({ + url: '/admin/approle/details/' + obj, + method: 'get' + }) +} + + +export function getDetailsByPhone(obj: Object) { + return request({ + url: '/admin/approle/detailsByCode/' + obj, + method: 'get' + }) +} + + +export function validateApproleName(rule: any, value: any, callback: any, isEdit: boolean) { + const flag = new RegExp(/^([a-z\u4e00-\u9fa5\d]+?)$/).test(value) + if (!flag) { + callback(new Error('用户名支持小写英文、数字、中文')) + } + + if (isEdit) { + return callback() + } + + getDetails(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('用户名已经存在')) + } else { + callback() + } + }) +} + +export function validateAppRoleCode(rule: any, value: any, callback: any, isEdit: boolean) { + if (isEdit) { + return callback() + } + getDetailsByPhone(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('角色标识已经存在')) + } else { + callback() + } + }) } diff --git a/src/api/app/appuser.ts b/src/api/app/appuser.ts index 9909cb3f..f2902dd3 100644 --- a/src/api/app/appuser.ts +++ b/src/api/app/appuser.ts @@ -1,40 +1,92 @@ import request from "/@/utils/request" export function fetchList(query: any) { - return request({ - url: '/admin/appuser/page', - method: 'get', - params: query - }) + return request({ + url: '/admin/appuser/page', + method: 'get', + params: query + }) } export function addObj(obj: any) { - return request({ - url: '/admin/appuser', - method: 'post', - data: obj - }) + return request({ + url: '/admin/appuser', + method: 'post', + data: obj + }) } export function getObj(id: string) { - return request({ - url: '/admin/appuser/' + id, - method: 'get' - }) + return request({ + url: '/admin/appuser/' + id, + method: 'get' + }) } export function delObj(ids?: object) { - return request({ - url: '/admin/appuser/', - method: 'delete', - data:ids - }) + return request({ + url: '/admin/appuser/', + method: 'delete', + data: ids + }) } export function putObj(obj: any) { - return request({ - url: '/admin/appuser', - method: 'put', - data: obj - }) + return request({ + url: '/admin/appuser', + method: 'put', + data: obj + }) } + + +export function getDetails(obj: Object) { + return request({ + url: '/admin/appuser/details/' + obj, + method: 'get' + }) +} + + +export function getDetailsByPhone(obj: Object) { + return request({ + url: '/admin/appuser/detailsByPhone/' + obj, + method: 'get' + }) +} + +export function validateUsername(rule: any, value: any, callback: any, isEdit: boolean) { + const flag = new RegExp(/^([a-z\u4e00-\u9fa5\d]+?)$/).test(value) + if (!flag) { + callback(new Error('用户名支持小写英文、数字、中文')) + } + + if (isEdit) { + return callback() + } + + getDetails(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('用户名已经存在')) + } else { + callback() + } + }) +} + +export function validatePhone(rule: any, value: any, callback: any, isEdit: boolean) { + if (isEdit) { + return callback() + } + getDetailsByPhone(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('手机号已经存在')) + } else { + callback() + } + }) +} + + diff --git a/src/api/oa/leave-bill.ts b/src/api/oa/leave-bill.ts new file mode 100644 index 00000000..de553bf0 --- /dev/null +++ b/src/api/oa/leave-bill.ts @@ -0,0 +1,46 @@ +import request from '/@/utils/request'; + +export function fetchList(query) { + return request({ + url: '/admin/leave-bill/page', + method: 'get', + params: query + }) +} + +export function addObj(obj) { + return request({ + url: '/admin/leave-bill', + method: 'post', + data: obj + }) +} + +export function getObj(id) { + return request({ + url: '/admin/leave-bill/' + id, + method: 'get' + }) +} + +export function submit(id) { + return request({ + url: '/admin/leave-bill/submit/' + id, + method: 'get' + }) +} + +export function delObj(id) { + return request({ + url: '/admin/leave-bill/' + id, + method: 'delete' + }) +} + +export function putObj(obj) { + return request({ + url: '/admin/leave-bill/', + method: 'put', + data: obj + }) +} diff --git a/src/api/oa/model.ts b/src/api/oa/model.ts new file mode 100644 index 00000000..4de5bd3e --- /dev/null +++ b/src/api/oa/model.ts @@ -0,0 +1,46 @@ +import request from '/@/utils/request'; + +export function fetchList(query) { + return request({ + url: '/admin/model', + method: 'get', + params: query + }) +} + +export function delObj(id) { + return request({ + url: '/admin/model/' + id, + method: 'delete' + }) +} + +export function deploy(id) { + return request({ + url: '/admin/model/deploy/' + id, + method: 'post' + }) +} + +export function addObj(obj) { + return request({ + url: '/admin/model/insert', + method: 'post', + data: obj + }) +} + +export function getObj(id) { + return request({ + url: '/admin/log/' + id, + method: 'get' + }) +} + +export function putObj(obj) { + return request({ + url: '/admin/log/', + method: 'put', + data: obj + }) +} diff --git a/src/api/oa/process.ts b/src/api/oa/process.ts new file mode 100644 index 00000000..3369e76c --- /dev/null +++ b/src/api/oa/process.ts @@ -0,0 +1,23 @@ +import request from '/@/utils/request'; + +export function fetchList(query) { + return request({ + url: '/admin/process', + method: 'get', + params: query + }) +} + +export function delObj(id) { + return request({ + url: '/admin/process/' + id, + method: 'delete' + }) +} + +export function status(id, type) { + return request({ + url: '/admin/process/status/' + id + '/' + type, + method: 'put' + }) +} diff --git a/src/api/oa/task.ts b/src/api/oa/task.ts new file mode 100644 index 00000000..689cdf19 --- /dev/null +++ b/src/api/oa/task.ts @@ -0,0 +1,31 @@ +import request from '/@/utils/request'; + +export function fetchList(query) { + return request({ + url: '/admin/task/todo', + method: 'get', + params: query + }) +} + +export function fetchDetail(id) { + return request({ + url: '/admin/task/' + id, + method: 'get' + }) +} + +export function fetchComment(id) { + return request({ + url: '/admin/task/comment/' + id, + method: 'get' + }) +} + +export function doTask(obj) { + return request({ + url: '/admin/task', + method: 'post', + data: obj + }) +} diff --git a/src/i18n/pages/form/en.ts b/src/i18n/pages/form/en.ts index 6a367d0d..193d784e 100644 --- a/src/i18n/pages/form/en.ts +++ b/src/i18n/pages/form/en.ts @@ -13,6 +13,7 @@ export default { resetBtn: 'reset', action:'action', optSuccessText: 'operation success', + optConfirmText: 'Confirm this operation ', editSuccessText: 'edit success', addSuccessText: 'add success', delSuccessText: 'delete success', diff --git a/src/i18n/pages/form/zh-cn.ts b/src/i18n/pages/form/zh-cn.ts index 4b74b3dd..ca3ff167 100644 --- a/src/i18n/pages/form/zh-cn.ts +++ b/src/i18n/pages/form/zh-cn.ts @@ -16,6 +16,7 @@ export default { addSuccessText: '添加成功', delSuccessText: '删除成功', delConfirmText: '此操作将永久删除', + optConfirmText: '是否确认本操作', confirmButtonText: '确认', cancelButtonText: '取消', download: '下载' diff --git a/src/i18n/pages/login/en.ts b/src/i18n/pages/login/en.ts index 8be616e9..b4d2d54c 100644 --- a/src/i18n/pages/login/en.ts +++ b/src/i18n/pages/login/en.ts @@ -10,7 +10,7 @@ export default { one3: 'Third party login', two4: 'Links', }, - account: { + password: { accountPlaceholder1: 'The user name admin or not is common', accountPlaceholder2: 'Password: 123456', accountPlaceholder3: 'Please enter the verification code', @@ -23,11 +23,10 @@ export default { placeholder2: 'Please enter the verification code', codeText: 'Get code', btnText: 'Sign in', - msgText: - 'Warm tip: it is recommended to use Google, Microsoft edge, version 79.0.1072.62 and above browsers, and 360 browser, please use speed mode', }, scan: { text: 'Open the mobile phone to scan and quickly log in / register', }, signInText: 'welcome back!', + browserMsgText: 'Warm tip: it is recommended to use Google, Microsoft edge, version 79.0.1072.62 and above browsers, and 360 browser, please use speed mode', }; diff --git a/src/i18n/pages/login/zh-cn.ts b/src/i18n/pages/login/zh-cn.ts index 823e32ce..f8e70a50 100644 --- a/src/i18n/pages/login/zh-cn.ts +++ b/src/i18n/pages/login/zh-cn.ts @@ -10,7 +10,7 @@ export default { one3: '第三方登录', two4: '友情链接', }, - account: { + password: { accountPlaceholder1: '请输入用户名', accountPlaceholder2: '请输入密码', accountPlaceholder3: '请输入验证码', @@ -23,10 +23,10 @@ export default { placeholder2: '请输入验证码', codeText: '获取验证码', btnText: '登 录', - msgText: '* 温馨提示:建议使用谷歌、Microsoft Edge,版本 79.0.1072.62 及以上浏览器,360浏览器请使用极速模式', }, scan: { text: '打开手机扫一扫,快速登录/注册', }, signInText: '欢迎回来!', + browserMsgText: '* 温馨提示:建议使用谷歌、Microsoft Edge,版本 79.0.1072.62 及以上浏览器,360浏览器请使用极速模式', }; diff --git a/src/layout/navBars/breadcrumb/user.vue b/src/layout/navBars/breadcrumb/user.vue index 95c15e10..98cd66a9 100644 --- a/src/layout/navBars/breadcrumb/user.vue +++ b/src/layout/navBars/breadcrumb/user.vue @@ -101,7 +101,7 @@ const GlobalWebsocket = defineAsyncComponent(() => import('/@/components/Websock const UserNews = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/userNews.vue')); const Search = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/search.vue')); -const personalDrawer = defineAsyncComponent(() => import("/@/views/personal/index.vue")) +const personalDrawer = defineAsyncComponent(() => import("/@/views/admin/user/personal.vue")) // 定义变量内容 const { locale, t } = useI18n(); diff --git a/src/router/route.ts b/src/router/route.ts index 4703fce6..241a8902 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -101,7 +101,7 @@ export const staticConfigRoutes: Array = [ { path: '/personal', name: 'personal', - component: () => import('/@/views/personal/index.vue'), + component: () => import('/@/views/admin/user/personal.vue'), meta: { "title": "router.personal", "isHide": true diff --git a/src/stores/themeConfig.ts b/src/stores/themeConfig.ts index b7989ac3..3d2e2537 100644 --- a/src/stores/themeConfig.ts +++ b/src/stores/themeConfig.ts @@ -133,11 +133,11 @@ export const useThemeConfig = defineStore('themeConfig', { * 全局网站标题 / 副标题 */ // 网站主标题(菜单导航、浏览器当前网页标题、登录form顶部右侧) - globalTitle: 'PigX 快速开发框架1', + globalTitle: 'PigX 快速开发框架', // 网站副标题(登录左侧底部页顶部文字) - globalViceTitle: 'PigX 快速开发框架2', + globalViceTitle: 'PigX 快速开发框架', // 网站副标题(登录页顶部文字) - globalViceTitleMsg: '专注、免费、开源、维护、解疑3', + globalViceTitleMsg: '专注、免费、开源、维护、解疑', // 默认初始语言,可选值"",默认 zh-cn globalI18n: 'zh-cn', // 默认全局组件大小,可选值"",默认 'large' diff --git a/src/theme/app.scss b/src/theme/app.scss index 5ecae09e..f65a8f55 100644 --- a/src/theme/app.scss +++ b/src/theme/app.scss @@ -93,11 +93,13 @@ body, position: absolute; left: 0; top: 0; + height: 100%; overflow: hidden; @extend .layout-flex; &-auto { height: inherit; @extend .layout-flex; + padding: 10px; } &-view { background: var(--el-color-white); diff --git a/src/utils/storage.ts b/src/utils/storage.ts index 09213b4e..28daae33 100644 --- a/src/utils/storage.ts +++ b/src/utils/storage.ts @@ -41,24 +41,27 @@ export const Local = { */ export const Session = { // 设置临时缓存 - set(key: string, val: T) { - if (key === 'token') return Cookies.set(key, val); - window.sessionStorage.setItem(Local.setKey(key), JSON.stringify(val)); + set(key: string, val: any) { + if (key === 'token' || key === 'refresh_token') { + Cookies.set(key, val) + } + window.sessionStorage.setItem(key, JSON.stringify(val)); }, // 获取临时缓存 get(key: string) { - if (key === 'token') return Cookies.get(key); - let json = window.sessionStorage.getItem(Local.setKey(key)); + if (key === 'token' || key === 'refresh_token') return Cookies.get(key); + let json = window.sessionStorage.getItem(key); return JSON.parse(json); }, // 移除临时缓存 remove(key: string) { - if (key === 'token') return Cookies.remove(key); - window.sessionStorage.removeItem(Local.setKey(key)); + if (key === 'token' || key === 'refresh_token') return Cookies.remove(key); + window.sessionStorage.removeItem(key); }, // 移除全部临时缓存 clear() { Cookies.remove('token'); + Cookies.remove('refresh_token'); window.sessionStorage.clear(); }, }; diff --git a/src/views/admin/audit/index.vue b/src/views/admin/audit/index.vue index f274f949..4a599297 100644 --- a/src/views/admin/audit/index.vue +++ b/src/views/admin/audit/index.vue @@ -1,6 +1,6 @@ diff --git a/src/views/admin/client/form.vue b/src/views/admin/client/form.vue index 6cafe9e2..e57c0d18 100644 --- a/src/views/admin/client/form.vue +++ b/src/views/admin/client/form.vue @@ -1,251 +1,263 @@ diff --git a/src/views/admin/client/index.vue b/src/views/admin/client/index.vue index db18d367..9acc56f7 100644 --- a/src/views/admin/client/index.vue +++ b/src/views/admin/client/index.vue @@ -1,6 +1,6 @@