diff --git a/src/api/configuration.ts b/src/api/configuration.ts new file mode 100644 index 0000000..bb4f5a3 --- /dev/null +++ b/src/api/configuration.ts @@ -0,0 +1,45 @@ +import request from '@/utils/request' +import { tool } from '../utils/alioss.js' +import { ElLoading, ElMessage } from 'element-plus' + +enum Api { + get系统配置 = '/api/systemSettings/save', + put系统配置 = '/api/systemSettings', +} +// 提示批量处理 +const initOptions = { text: '加载中', success: '成功', error: '失败' } +function proxRequest(request, options: any = initOptions) { + return async (...arg) => { + if (!options) return request(...arg) + + const loadingInstance = ElLoading.service({ text: options.text }) + + try { + await request(...arg) + ElMessage.success(options.success) + } catch (error) { + ElMessage.error(options.error) + } finally { + loadingInstance.close() + } + + return request + } +} + + +export function uploadApi(file: File) { + if (file instanceof Object) return tool.oss.upload(file).then(res => res.url) + else return Promise.resolve(file) +} + + +export function getSysSettingApi() { + return request.get(Api.get系统配置) +} +export const proxGetSysSettingApi = proxRequest(getSysSettingApi) + +export function putSysSettingApi(params: any) { + return request.put(Api.put系统配置, params) +} +export const proxPutSysSettingApi = proxRequest(putSysSettingApi, { success: '保存成功', error: '保存失败' }) \ No newline at end of file diff --git a/src/layout/tabbar/setting/index.vue b/src/layout/tabbar/setting/index.vue index 48a8784..d7412ff 100644 --- a/src/layout/tabbar/setting/index.vue +++ b/src/layout/tabbar/setting/index.vue @@ -11,7 +11,7 @@ /> --> - + import('@/views/configurationPage/index.vue'), + name: 'configurationPage', + meta: { + title: '系统设置', + hidden: true, + icon: 'HomeFilled', + }, + }, ], }, { @@ -188,8 +198,8 @@ export const constantRoute: any = [ }, { path: '/messageManagement/sendMessage', - component: ()=>import('@/views/message/components/sendMessage.vue'), - name:'SendMessage', + component: () => import('@/views/message/components/sendMessage.vue'), + name: 'SendMessage', meta: { title: '个人发出', hidden: true, @@ -198,8 +208,8 @@ export const constantRoute: any = [ }, { path: '/messageContentList', - component:()=>import('@/views/message/components/indexContentList.vue'), - name:'MessageContentList', + component: () => import('@/views/message/components/indexContentList.vue'), + name: 'MessageContentList', meta: { title: '收到信息详情', hidden: true, @@ -208,8 +218,8 @@ export const constantRoute: any = [ }, { path: '/sendMessageList', - component:()=>import('@/views/message/components/sendMessageList.vue'), - name:'SendMessageList', + component: () => import('@/views/message/components/sendMessageList.vue'), + name: 'SendMessageList', meta: { title: '发送信息详情', hidden: true, @@ -222,7 +232,7 @@ export const constantRoute: any = [ path: '/messageContent', component: () => import('@/views/message/components/messageContent.vue'), name: 'MessageContent', - meta:{ + meta: { title: '写栈内信函', hidden: true, icon: 'EditPen', @@ -231,7 +241,7 @@ export const constantRoute: any = [ { path: '/news', component: () => import('@/layout/index.vue'), - name:'NewsManagement', + name: 'NewsManagement', meta: { title: '资讯', hidden: false, @@ -240,8 +250,8 @@ export const constantRoute: any = [ children: [ { path: '/news/newsContent', - component:()=>import('@/views/news/index.vue'), - name:'NewsContent', + component: () => import('@/views/news/index.vue'), + name: 'NewsContent', meta: { title: '资讯管理', hidden: false, @@ -250,8 +260,8 @@ export const constantRoute: any = [ }, { path: '/newsDetails', - component:()=>import('@/views/news/components/newsContent.vue'), - name:'NewsDetails', + component: () => import('@/views/news/components/newsContent.vue'), + name: 'NewsDetails', meta: { title: '新闻详情', hidden: true, diff --git a/src/views/configurationPage/MyUpdate.vue b/src/views/configurationPage/MyUpdate.vue new file mode 100644 index 0000000..455f5ae --- /dev/null +++ b/src/views/configurationPage/MyUpdate.vue @@ -0,0 +1,38 @@ + + + \ No newline at end of file diff --git a/src/views/configurationPage/index.vue b/src/views/configurationPage/index.vue new file mode 100644 index 0000000..9927af4 --- /dev/null +++ b/src/views/configurationPage/index.vue @@ -0,0 +1,93 @@ + + + + \ No newline at end of file