Git Product home page Git Product logo

bjui's People

Contributors

jzaaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bjui's Issues

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

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时关闭标签页,不起作用。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.