|
@@ -113,26 +113,35 @@
|
|
var that = this;
|
|
var that = this;
|
|
// var id = uni.getStorageSync("globalUser").id;
|
|
// var id = uni.getStorageSync("globalUser").id;
|
|
var token = uni.getStorageSync("token");
|
|
var token = uni.getStorageSync("token");
|
|
- uni.request({
|
|
|
|
- url: this.serverurl + '/TNotice/addNotice',
|
|
|
|
- data: {
|
|
|
|
- "title": title,
|
|
|
|
- "note":note
|
|
|
|
- },
|
|
|
|
- header: {
|
|
|
|
- 'token': token
|
|
|
|
- },
|
|
|
|
- method: "POST",
|
|
|
|
- success: (res) => {
|
|
|
|
- uni.showModal({
|
|
|
|
- title: "提示",
|
|
|
|
- content: res.data.message,
|
|
|
|
- success: (res) => {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
|
|
+ if(note == "<p><br></p>") {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '公告内容不为空',
|
|
|
|
+ duration: 3000,
|
|
|
|
+ icon: 'error'
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ } else {
|
|
|
|
+ uni.request({
|
|
|
|
+ url: this.serverurl + '/TNotice/addNotice',
|
|
|
|
+ data: {
|
|
|
|
+ "title": title,
|
|
|
|
+ "note":note
|
|
|
|
+ },
|
|
|
|
+ header: {
|
|
|
|
+ 'token': token
|
|
|
|
+ },
|
|
|
|
+ method: "POST",
|
|
|
|
+ success: (res) => {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: "提示",
|
|
|
|
+ content: res.data.message,
|
|
|
|
+ success: (res) => {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
fail: function(error) {
|
|
fail: function(error) {
|
|
console.log(error)
|
|
console.log(error)
|