message.js 998 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * 错误消息处理
  3. * @param result
  4. */
  5. function errorMesage(result) {
  6. if(result.code == -2){
  7. return;
  8. }
  9. new PNotify({
  10. title: '错误提示',
  11. text: result.message,
  12. type: 'error',
  13. hide: true,
  14. styling: 'bootstrap3'
  15. });
  16. }
  17. /**
  18. * 正确消息处理
  19. * @param result
  20. */
  21. function successMesage(result) {
  22. new PNotify({
  23. title: '操作成功',
  24. text: result.message,
  25. type: 'success',
  26. hide: true,
  27. styling: 'bootstrap3'
  28. });
  29. }
  30. /**
  31. * 错误消息处理
  32. * @param result
  33. */
  34. function errorMesageSimaple(message) {
  35. new PNotify({
  36. title: '错误提示',
  37. text: message,
  38. type: 'error',
  39. hide: true,
  40. styling: 'bootstrap3'
  41. });
  42. }
  43. /**
  44. * 警告消息处理
  45. * @param result
  46. */
  47. function warningMesageSimaple(message) {
  48. new PNotify({
  49. title: '错误提示',
  50. text: message,
  51. hide: true,
  52. styling: 'bootstrap3'
  53. });
  54. }