Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关闭当前标签并刷新列表页 #2

Closed
IBOXLAB opened this issue May 9, 2020 · 3 comments
Closed

关闭当前标签并刷新列表页 #2

IBOXLAB opened this issue May 9, 2020 · 3 comments

Comments

@IBOXLAB
Copy link

IBOXLAB commented May 9, 2020

protected function mtReturn($status,$info,$navTabId="",$closeCurrent=true) {

    $udata['id']=session('uid');
    $udata['update_time']=time();
    $Rs=M("user")->save($udata);
    $dat['username'] = session('username');
    $dat['content'] = $info;
	$dat['os']=$_SERVER['HTTP_USER_AGENT'];
    $dat['url'] = U();
    $dat['addtime'] = date("Y-m-d H:i:s",time());
    $dat['ip'] = get_client_ip();
    M("log")->add($dat);
   
    
    $result = array();
    $result['statusCode'] = $status; 
    $result['message'] = $info;
	$result['closeCurrent'] =$closeCurrent;
	if($navTabId!==''){
	 $result['tabid'] = strtolower($navTabId).'/index';	
	}else{
		$result['tabid'] = '';
	}
	
    $result['forward'] = '';
	$result['forwardConfirm']='';
    
    if (empty($type))
        $type = C('DEFAULT_AJAX_RETURN');
    if (strtoupper($type) == 'JSON') {
        // 返回JSON数据格式到客户端 包含状态信息
        header("Content-Type:text/html; charset=utf-8");
        exit(json_encode($result,true));
    } elseif (strtoupper($type) == 'XML') {
        // 返回xml格式数据
        header("Content-Type:text/xml; charset=utf-8");
        exit(xml_encode($result));
    } elseif (strtoupper($type) == 'EVAL') {
        // 返回可执行的js脚本
        header("Content-Type:text/html; charset=utf-8");
        exit($data);
    } else {
        // TODO 增加其它格式
    }
}

原版本操作成功直接关闭标签页。
当发送"closeCurrent" = true时关闭标签页,不起作用。

@JZaaa
Copy link
Owner

JZaaa commented Jul 3, 2020

能否提供具体的情景与返回的json数据?

@IBOXLAB
Copy link
Author

IBOXLAB commented Jul 5, 2020

我的EMALI:254281818@qq.com
我给你发源码。你应该会PHP吧.

@JZaaa
Copy link
Owner

JZaaa commented Jul 5, 2020

可以发送 至 2509642078@qq.com 这个邮箱,或者方便提供线上地址也可以,主要是确定你的使用情景和回调代码,因为这一套系统我也是用于生产环境的,暂时没有出现过上述问题

@JZaaa JZaaa closed this as completed Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants