在 thinkphp 3.2.3 中,在目錄 ThinkPHP\Library\Think 找到 Controller.class.php 這個(gè)文件,在代碼里面找到 dispatchJump 這個(gè)方法,找到 $this->assign(‘waitSecond','3');這行, 將里面的 3 改掉即可。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
if ( $status ) { //發(fā)送成功信息 $this ->assign( 'message' , $message ); // 提示信息 // 成功操作后默認(rèn)停留1秒 if (!isset( $this ->waitSecond)) $this ->assign( 'waitSecond' , '1' ); // 默認(rèn)操作成功自動(dòng)返回操作前頁(yè)面 if (!isset( $this ->jumpUrl)) $this ->assign( "jumpUrl" , $_SERVER [ "HTTP_REFERER" ]); $this ->display(C( 'TMPL_ACTION_SUCCESS' )); } else { $this ->assign( 'error' , $message ); // 提示信息 //發(fā)生錯(cuò)誤時(shí)候默認(rèn)停留3秒 if (!isset( $this ->waitSecond)) $this ->assign( 'waitSecond' , '3' ); // 默認(rèn)發(fā)生錯(cuò)誤的話自動(dòng)返回上頁(yè) if (!isset( $this ->jumpUrl)) $this ->assign( 'jumpUrl' , "javascript:history.back(-1);" ); $this ->display(C( 'TMPL_ACTION_ERROR' )); // 中止執(zhí)行 避免出錯(cuò)后繼續(xù)執(zhí)行 exit ; } |
以上這篇Thinkphp頁(yè)面跳轉(zhuǎn)設(shè)置跳轉(zhuǎn)等待時(shí)間的操作就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持服務(wù)器之家。
原文鏈接:https://blog.csdn.net/myphp2012/article/details/78425549