mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt arg
This commit is contained in:
parent
ed7e31e2a1
commit
93ca4afb46
15
lib/misc.js
15
lib/misc.js
@ -40,9 +40,9 @@ Volcanos("misc", {help: "工具模块",
|
||||
msg.option && msg.option.forEach(function(item) {
|
||||
msg[item] && (option[item] = msg[item])
|
||||
})
|
||||
for (var k in dataset) {
|
||||
option[k] = dataset[k].toLowerCase().split(",")
|
||||
}
|
||||
// for (var k in dataset) {
|
||||
// option[k] = dataset[k].toLowerCase().split(",")
|
||||
// }
|
||||
|
||||
var what = ++arguments.callee.meta.order
|
||||
|
||||
@ -56,17 +56,10 @@ Volcanos("misc", {help: "工具模块",
|
||||
// kit.Log(msg.detail.concat([msg]))
|
||||
|
||||
// kit.History("run", -1, option)
|
||||
if (can.user.Search(can, "feature") == "ice") {
|
||||
this.POST(can, msg, can.Conf("context")+msg.Option("names"), option, function(msg) {
|
||||
this.POST(can, msg, can.Conf("context")+dataset.names.toLowerCase(), option, function(msg) {
|
||||
// kit.Log("run", what, "result", msg.result? msg.result[0]: "", msg)
|
||||
typeof cb == "function" && cb(msg)
|
||||
}), delete(event.msg)
|
||||
} else {
|
||||
this.POST(can, msg, can.Conf("context"), option, function(msg) {
|
||||
// kit.Log("run", what, "result", msg.result? msg.result[0]: "", msg)
|
||||
typeof cb == "function" && cb(msg)
|
||||
}), delete(event.msg)
|
||||
}
|
||||
}),
|
||||
})
|
||||
|
||||
|
@ -174,7 +174,7 @@ Volcanos("page", {help: "网页模块",
|
||||
})
|
||||
}),
|
||||
AppendField: shy("添加插件", function(can, target, type, item) {
|
||||
var dataset = {}; item && item.name && (dataset.names = item.name); item && item.group && (dataset.group = item.group);
|
||||
var dataset = {}; item && item.name && (dataset.names = item.name);
|
||||
var field = can.page.Append(can, target, [{view: [type, "fieldset"], list: [
|
||||
item.pos? undefined: {text: [(item.nick||item.name||"")+"("+(item.help||"")+")", "legend"]},
|
||||
{view: ["option", "form"], dataset: dataset, list: [{type: "input", style: {display: "none"}}]},
|
||||
|
@ -7,7 +7,6 @@ Volcanos("onimport", {help: "导入数据", list: [],
|
||||
if (!ui.username.value) {ui.username.focus(); return}
|
||||
if (!ui.password.value) {ui.password.focus(); return}
|
||||
|
||||
if (can.user.Search(can, "feature") == "ice") {
|
||||
can.run(event, ["login", ui.username.value, ui.password.value], function(msg) {
|
||||
if (msg.result && msg.result.length > 0) {
|
||||
can.Hide(), can.Export(event, "", "login")
|
||||
@ -15,15 +14,6 @@ if (can.user.Search(can, "feature") == "ice") {
|
||||
can.user.toast("用户或密码错误")
|
||||
}
|
||||
})
|
||||
} else {
|
||||
can.run(event, [ui.username.value, ui.password.value], function(msg) {
|
||||
if (msg.result && msg.result.length > 0) {
|
||||
can.Hide(), can.Export(event, "", "login")
|
||||
} else {
|
||||
can.user.toast("用户或密码错误")
|
||||
}
|
||||
})
|
||||
}
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
return true
|
||||
@ -32,17 +22,9 @@ if (can.user.Search(can, "feature") == "ice") {
|
||||
},
|
||||
login: function(event, can, value, cmd, output) {
|
||||
if (!can.user.Cookie("sessid")) {can.Show(event, 400, 400); return}
|
||||
|
||||
if (can.user.Search(can, "feature") == "ice") {
|
||||
can.run(event||{}, ["check"], function(msg) {var user = msg.Result()
|
||||
user? can.Export(event, user, "username"): can.Show(event, -1, -1)
|
||||
})
|
||||
} else {
|
||||
can.run(event||{}, [], function(msg) {
|
||||
msg.nickname && msg.nickname.length > 0?
|
||||
can.Export(event, msg.nickname[0], "username"): can.Show(event, -1, -1)
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
Volcanos("onaction", {help: "组件交互", list: []})
|
||||
|
Loading…
x
Reference in New Issue
Block a user