|
@@ -100,29 +100,39 @@
|
|
|
this.editor.setData(this.editor.getData() + ret);
|
|
|
},
|
|
|
handleSubmit() {
|
|
|
- this.notice.content = this.editor.getData();
|
|
|
- this.notice.isThirdParty = this.thirdParty ? 1 : 0;
|
|
|
- let canSubmit = this.notice.title && this.notice.content;
|
|
|
- if (canSubmit) {
|
|
|
- if (this.notice.id) { //更新
|
|
|
- this.notice.isChangingCreateTime = this.isChangingCreateTime ? 1 : 0;
|
|
|
- axios.put(`/api/update/${this.notice.id}`, this.notice).then(res => {
|
|
|
- if (res.status === 200) {
|
|
|
- this.$Message.info('发布成功!');
|
|
|
- router.push('/');
|
|
|
- }
|
|
|
- })
|
|
|
- } else { //创建
|
|
|
- axios.post('/api/create', this.notice).then(res => {
|
|
|
- if (res.status === 200) {
|
|
|
- this.$Message.info('发布成功!');
|
|
|
- router.push('/');
|
|
|
- }
|
|
|
- })
|
|
|
+ let validCode = localStorage.getItem("validCode");
|
|
|
+ axios.get(`/api/checkPWD/${validCode}`).then(res=>{
|
|
|
+ if (res.data) {
|
|
|
+ this.notice.content = this.editor.getData();
|
|
|
+ this.notice.isThirdParty = this.thirdParty ? 1 : 0;
|
|
|
+ let canSubmit = this.notice.title && this.notice.content;
|
|
|
+ if (canSubmit) {
|
|
|
+ if (this.notice.id) { //更新
|
|
|
+ this.notice.isChangingCreateTime = this.isChangingCreateTime ? 1 : 0;
|
|
|
+ axios.put(`/api/update/${this.notice.id}`, this.notice).then(res => {
|
|
|
+ if (res.status === 200) {
|
|
|
+ this.$Message.info('发布成功!');
|
|
|
+ router.push('/');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else { //创建
|
|
|
+ axios.post('/api/create', this.notice).then(res => {
|
|
|
+ if (res.status === 200) {
|
|
|
+ this.$Message.info('发布成功!');
|
|
|
+ router.push('/');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$Message.warning('通知标题和内容不能为空!');
|
|
|
}
|
|
|
- } else {
|
|
|
- this.$Message.warning('通知标题和内容不能为空!');
|
|
|
+ }else{
|
|
|
+ this.$Message.warning('没有权限');
|
|
|
+
|
|
|
}
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
|