diff --git a/backend/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java b/backend/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java index aeea607..5fbb48c 100644 --- a/backend/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java +++ b/backend/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java @@ -27,6 +27,9 @@ public class CmsEssayServiceImpl extends ServiceImpl i public BaseResponse addEssay(CmsEssay cmsEssay) { //设置文章发布时间 cmsEssay.setPublishTime(LocalDate.now()); + //设置发布人姓名 +// String nickName = userService.getById(cmsEssay.getUserId()).getNickName(); +// cmsEssay.setUsername(nickName); //如果数据库里没有文章,文章id设为2 Long count = query().count(); if (count == 0){ diff --git a/backend/src/main/resources/application-local.yml b/backend/src/main/resources/application-local.yml new file mode 100644 index 0000000..6673294 --- /dev/null +++ b/backend/src/main/resources/application-local.yml @@ -0,0 +1,90 @@ +server: + port: 8080 +spring: + application: + name: teaching-backend + servlet: + multipart: + enabled: true + max-file-size: 10MB + max-request-size: 10MB + neo4j: + uri: bolt://10.100.200.177:7687 + authentication: + username: neo4j # 连接Neo4j数据P库的用户名 + password: neo4j123456 # 连接Neo4j数据库的密码 + mvc: + pathmatch: + matching-strategy: ant_path_matcher + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://10.100.200.177:3306/teaching_db + username: root + password: root +# url: jdbc:mysql://rm-bp189rd5595301145do.mysql.rds.aliyuncs.com:3306/teaching_db +# username: root123 +# password: Zjh@111111 +mybatis: + configuration: + map-underscore-to-camel-case: true + mapper-locations: + - classpath:mapper/*.xml + - classpath*:com/**/mapper/*.xml + +jwt: + tokenHeader: Authorization + secret: mySecret + expiration: 604800 + tokenHead: Bearer + +knife4j: + enable: true + openapi: + title: 111 + description: "123" + concat: zjh + version: v1.0.0 + group: + default: + group-name: default + api-rule: package + api-rule-resources: + - com.teaching.backend.controller +secure: + ignored: + urls: + # - /swagger-ui/ + # - /swagger-resources/** + # - /**/v2/api-docs + # - /**/*.html + # - /**/*.js + # - /**/*.css + # - /**/*.png + # - /**/*.map + # - /favicon.ico + # - /actuator/** + # - /druid/** + # - /user/** + # - /user/login + # - /user/register + # - /user/info + # - /user/logout + # - /minio/upload + - /** + + +aliyun: + oss: + endpoint: oss-cn-wuhan-lr.aliyuncs.com + accessKeyId: LTAI5tFkdu3y5WddxbjgaG2F + accessKeySecret: 1xUchxUTlmUBoTV5JQIrKsVjSkmsLF + bucketName: ceshi132132 + +minio: + endpoint: http://39.106.16.162:9090 #MinIO服务所在地址 + bucketName: teaching # 存储桶名称 + accessKey: minioadmin # 访问的key + secretKey: minioadmin # 访问的秘钥 + +filename: + maxlength: 10 diff --git a/teaching_integration_platform_admin_template/.env.development b/teaching_integration_platform_admin_template/.env.development index 9eff337..bfb0e2d 100644 --- a/teaching_integration_platform_admin_template/.env.development +++ b/teaching_integration_platform_admin_template/.env.development @@ -1,5 +1,6 @@ # 变量必须以 VITE_ 为前缀才能暴露给外部读取 NODE_ENV = 'development' VITE_APP_TITLE = '无糖运营平台' -VITE_APP_BASE_API = 'http://127.0.0.1:8080' -# VITE_APP_BASE_API = 'http://39.106.16.162:8080' \ No newline at end of file + VITE_APP_BASE_API = 'http://127.0.0.1:8080' +# VITE_APP_BASE_API = 'http://39.106.16.162:8080' + diff --git a/teaching_integration_platform_admin_template/src/api/user/news.js b/teaching_integration_platform_admin_template/src/api/user/news.js index 5c8a527..9d00b05 100644 --- a/teaching_integration_platform_admin_template/src/api/user/news.js +++ b/teaching_integration_platform_admin_template/src/api/user/news.js @@ -9,7 +9,7 @@ export function deleteCategory(ids) { } //编辑栏目 export function editStatus(params) { - return request.put(`/api/cms-category/edit/status`, params); + return request.put(`/api/cms-category/edit/status`, {},{params}); } //添加栏目 function parseParams(params){ @@ -26,6 +26,7 @@ function parseParams(params){ export function addCategory(params) { const str = parseParams(params) return request.post(`/api/cms-category/add${str}`); + // return request.post(`/api/cms-category/add`,{},{params}); } //查询新闻文章 export function queryEssay(category_id) { diff --git a/teaching_integration_platform_admin_template/src/views/message/components/messageContent.vue b/teaching_integration_platform_admin_template/src/views/message/components/messageContent.vue index 22a514f..89d1716 100644 --- a/teaching_integration_platform_admin_template/src/views/message/components/messageContent.vue +++ b/teaching_integration_platform_admin_template/src/views/message/components/messageContent.vue @@ -150,25 +150,62 @@ const disappoint = ()=>{ addPerson.value = false } //发送信息 +// const send = async () => { +// await ElMessageBox.confirm('您确定发送这条信息吗', '温馨提示', { +// confirmButtonText: '确认', +// cancelButtonText: '取消', +// type: 'warning', +// }) +// await SendMessageApi({ +// receiverId: inputPerson.value.toString(), +// courseId:inputCourseId.value.toString(), +// title:inputText.value, +// content:textarea.value, +// senderId:userStore.data.id +// }).then(()=>{ +// ElMessage({ +// message:'发送成功', +// type:'success' +// }) +// }) +// } const send = async () => { - await ElMessageBox.confirm('您确定发送这条信息吗', '温馨提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }) - await SendMessageApi({ - receiverId: inputPerson.value.toString(), - courseId:inputCourseId.value.toString(), - title:inputText.value, - content:textarea.value, - senderId:userStore.data.id - }).then(()=>{ - ElMessage({ - message:'发送成功', - type:'success' - }) - }) -} + try { + // 显示确认框 + await ElMessageBox.confirm('您确定发送这条信息吗', '温馨提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }); + + // 发送消息 + await SendMessageApi({ + receiverId: inputPerson.value.toString(), + courseId: inputCourseId.value.toString(), + title: inputText.value, + content: textarea.value, + senderId: userStore.data.id, + }).then(() => { + ElMessage({ + message: '发送成功', + type: 'success', + }); + }); + } catch (error) { + // 处理确认框取消的情况或其他错误 + if (error.type === 'cancel') { + // 用户取消了发送 + return; + } + + // 发送失败时的提示 + ElMessage.error({ + message: '发送失败', + type: 'error', + }); + console.error('发送失败:', error); + } +};