killerVS123

3368 经验值

按照以上回复尝试,console.log(response.data)直接打印整个html了。希望jellybool大神有空录个vue-resource与laravel控制器之间的数据交换视频。

*在usersedit.blade.php中:

 new Vue({
        el : '#user_type',
        data : {
            password : ['type','newpassword','repeatpassword'],
            newpassword : ['type','newpassword','repeatpassword']
        },
        ready: function() {
            this.$http.get('showUser').then((response) => {
                console.log(response);
                this.$set('password', response.data)
            }, (response) => {
                console.log(response);
            });
        },
        methods: {
            changePwd:function () {
                this.$http.get('updateUser').then((response) => {
                    console.log(response);
                    this.$set('newpassword', response.data)
                }, (response) => {
                    console.log(response);
                });
            }
        }
    });

*在ConfigController.php中:

 public function showUser()
{
    $user_type = $_GET['type'];
    $result = DB::table('cmt_admin_users')
        ->where('type', $user_type)
        ->get();
    return json_encode($result);
}

public function updateUser(Request $request)
{
    $user_type = $_GET['type'];
    $user_password = $_GET['newpassword'];
    $result = DB::table('cmt_admin_users')
        ->where('type', $user_type)
        ->update(['password' => $user_password]);
    if ($result){
        $msg = "update user success";
        return response()->json(array('msg'=> $msg), 200);
    }else{
        $msg = "update user failure";
        return response()->json(array('msg'=> $msg), 405);
    }
}

ready:function请求有返回数据,chrome打印内容: {url: "showUser", ok: true, status: 200, statusText: "OK", headers: t…},但返回的body内容为整个html页面,求大神们指导。

最近公司的一个项目都是关于snmp,cmip协议

1.通过snmp的get方法去获取KU卫星里面的一些参数(经度,纬度,信号强度等)

2.通过snmp的set方法去设置KU卫星天线的仰角等

3.以前没怎么接触过这方面,有点迷茫

* snmpget:
 * /usr/donica/app/snmp/snmpget -v 2c -t 3 -c public 192.168.2.2 .1.3.6.1.4.1.654.3.30.1.2.7.4.0
 * /usr/donica/app/snmp/snmpget -v 2c -t 3 -c public 192.168.2.3 MERU-CONFIG-AP-MIB::mwApOperationalState.1
 *
 * snmptable:
 * /usr/donica/app/snmp/snmptable -v 2c -t 3 -c public 192.168.2.3 MERU-CONFIG-AP-MIB::mwApTable
 *
 * snmpwalk:
 * /usr/donica/app/snmp/snmpwalk -v 2c -t 3 -c public 192.168.2.3 MERU-CONFIG-AP-MIB::mwApOperationalState