@moshangxc
2019-10-15T18:27:49.000000Z
字数 2731
阅读 575
获取数据(Get):goform/get
formData
数据格式
参数:
module_id=1=wan_info,2=node_info
设置数据(post):goform/set
json
数据格式
'1=login_pwd':{
a:1
}
所有的数字都是字符串形式,没有int型,没有true和false
所有的请求处理失败都会返回如下:
{
errcode: 0 // 0为正常,其它为错误
}
没有错误的情况下,返回的是空对象
{}
,只要当有错误才会返回{errcode:x}
login:set
login:{
pwd:"", // md5 32位加密方式
}
logout:get
goform/get?module_id=21=logout
elink:get/set
elink:{
elink_en: '1' // on 1, off 0
}
wifi:get/set
login_pwd:set
wifi:{
2Gssid: '',
2Gpass: '',
5Gssid: '',
5Gpass: '',
double_band_blend: '1', // on 1, off 0
},
login_pwd:{
old_pwd:'1'
}
sys_status:get/set
wan_info: [{
id: '1',
ip: '',
mac: '',
netmask: '',
gw: '',
first_dns: '',
sec_dns: ''
}],
wan_statistic: [{
id: '1',
up_speed: ''
down_speed: ''
}],
node_info: [{
id: '1',
ip: '',
netmask: '',
role: '1', //1:主节点 2:次节点
gw: '',
first_dns: '',
sec_dns: '',
net_status: '',// on: 1, off: 2
up_speed: '',
down_speed: '',
serial_number: '',
link_status: '', // 1:good, 2:not bad, 3: off line
led: '',
location: '',
lan_mac: '',
wan_mac: '',
5Gwifi_mac: '',
2Gwifi_mac: '',
dut_name: '',
dut_version: '',
sn: '',
groupsn: ''
}]
wan_info:get/set
wan_info:[{
id: '1',
ip: '',
mac: '',
netmask: '',: '',
gw: '',
first_dns: '',
sec_dns: ''
}]
wan_statistic:get
wan_statistic:[{
id: '1',
up_speed: ''
down_speed: ''
}]
node_info:get
node_info: [{
id: '1',
ip: '',
netmask: '',
gw: '',
first_dns: '',
role: '1', //1:主节点 2:次节点
sec_dns: '',
net_status: '',
up_speed: '',
down_speed: '',
serial_number: '',
link_status: '', // 1:good, 2:not bad, 3: off line
led: '',
location: '',
lan_mac: '',
wan_mac: '',
5Gwifi_mac: '',
2Gwifi_mac: '',
dut_name: '',
dut_version: '',
sn: '',
groupsn: ''
}]
link_status
不同值节点显示不同颜色good: 显示绿色
not bad: 显示黄色
off line: 显示红色
与红色节点相连的节点连线为灰色虚线,其余连线为绿色实线
serach_node:get/set
serach_node: [{
sn: '',
mac: ''
}]
add_node:set
add_node: [{
sn: ''
}]
del_node:set
del_node: {
sn: '',
mac: ''
}
led:set
led:{
led_en: '1',
sn: ''
}
locate: set
node_location:{
sn: '',
location: '1' // 或自定义字符串
}
link_module:set/get
联网设置中的数据都为数组,为后续多wan考虑
link_module: [{
id: '1',
link_mode: '1', // dynamic 0, static 1, pppoe 2, bridge 3
}],
net_link_status: [{
id: '1',
net_status: '1', // 0:未插网线 1:未连接 2:连接中 3:已连接
}],
// static
static_wan_info: [{
id: '1',
ip: '',
mac: '',
netmask: '',
gw: '',
first_dns: '',
sec_dns: ''
}],
// dynamic
dynamic_wan_info: [{
id: '1',
ip: '',
mac: '',
netmask: '',
gw: '',
first_dns: '',
sec_dns: ''
}],
pppoe_cfg: [{
id: '1',
account: '',
pass: '',
mtu: ''
}],
// 桥
bridge_info: [{
id:""
ip:""
gw:""
netmask:""
first_dns:""
sec_dns:""
}],
mac_clone: [{
id: "",
clone_type:"", // "0" 默认, "1" 克隆本机mac, "2" 手动输入mac
clone_mac:"",
default_mac:"",
dut_mac:"" //本机mac
}]
net_link_status: get
net_link_status:[{
net_status: '1', // 0:未插网线,1:未联网,2:连接中,3:已联网,4:用户名密码错误
}]
net_link_check:get
net_link_check:[{
link_mode: '1', // dynamic 0, static 1, pppoe 2, bridge 3
... // 如果有其它信息还包含wan口其它配置信息
}]
cfg_migrate: set
cfg_migrate:{}
login_pwd:get/set
login_pwd:{
old_pwd: '',
new_pwd: ''
}
返回值:
{
errcode: 1// 0:修改成功 1:旧密码验证失败 2:设置失败
}
dns_conf:get/set
dns_conf: {
mode: "0", // 自动 0, 手动 1
first_dns:"192.168.0.1"
sec_dns:"192.168.0.2"
}
upgrade:set