123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- namespace basic;
- use service\JsonService;
- class SystemBasic extends \think\Controller
- {
-
- protected function failedNotice($msg = '操作失败', $backUrl = 0, $info = '', $duration = 3)
- {
- $type = 'error';
- $this->assign(compact('msg','backUrl','info','duration','type'));
- return $this->fetch('public/notice');
- }
-
- protected function failedNoticeLast($msg = '操作失败', $backUrl = 0, $info = '')
- {
- return $this->failedNotice($msg,$backUrl,$info,0);
- }
-
- protected function successfulNotice($msg = '操作成功',$backUrl = 0,$info = '',$duration = 3)
- {
- $type = 'success';
- $this->assign(compact('msg','backUrl','info','duration','type'));
- return $this->fetch('public/notice');
- }
-
- protected function successfulNoticeLast($msg = '操作成功',$backUrl = 0,$info = '')
- {
- return $this->successfulNotice($msg,$backUrl,$info,0);
- }
-
- protected function failed($msg = '哎呀…亲…您访问的页面出现错误', $url = 0)
- {
- if($this->request->isAjax()){
- exit(JsonService::fail($msg,$url)->getContent());
- }else{
- $this->assign(compact('msg','url'));
- exit($this->fetch('public/error'));
- }
- }
-
- protected function successful($msg, $url = 0)
- {
- if($this->request->isAjax()){
- exit(JsonService::successful($msg,$url)->getContent());
- }else{
- $this->assign(compact('msg','url'));
- exit($this->fetch('public/success'));
- }
- }
- protected function exception($msg = '无法打开页面')
- {
- $this->assign(compact('msg'));
- exit($this->fetch('public/exception'));
- }
- }
|