mirror of
https://shylinux.com/x/volcanos
synced 2025-04-26 01:04:06 +08:00
opt chat
This commit is contained in:
parent
4ecd492927
commit
8bcbafa368
@ -214,7 +214,7 @@ Volcanos("user", {info: {}, agent: {
|
|||||||
}) })
|
}) })
|
||||||
},
|
},
|
||||||
|
|
||||||
login: function(can, cb, method, auto) { var trans = kit.Dict(aaa.USERNAME, "用户", aaa.PASSWORD, "密码", aaa.LOGIN, "登录")
|
login: function(can, cb, method) { var trans = kit.Dict(aaa.USERNAME, "用户", aaa.PASSWORD, "密码", aaa.LOGIN, "登录")
|
||||||
function layout() { can.page.style(can, ui._target, {left: (window.innerWidth-ui._target.offsetWidth)/2, top: window.innerHeight/6}) }
|
function layout() { can.page.style(can, ui._target, {left: (window.innerWidth-ui._target.offsetWidth)/2, top: window.innerHeight/6}) }
|
||||||
function button(list) { return {view: [html.ITEM, html.TR], list: [{type: html.TD}, {type: html.TD, list: can.core.Item(list, function(key, cb) {
|
function button(list) { return {view: [html.ITEM, html.TR], list: [{type: html.TD}, {type: html.TD, list: can.core.Item(list, function(key, cb) {
|
||||||
return {type: html.INPUT, value: can.user.trans(can, key, trans), data: {type: html.BUTTON}, onclick: cb}
|
return {type: html.INPUT, value: can.user.trans(can, key, trans), data: {type: html.BUTTON}, onclick: cb}
|
||||||
@ -225,7 +225,7 @@ Volcanos("user", {info: {}, agent: {
|
|||||||
]} }
|
]} }
|
||||||
|
|
||||||
var ui = can.onappend.tabview(can, {
|
var ui = can.onappend.tabview(can, {
|
||||||
"扫码授权": function(target) { can.misc.WSS(can, {type: html.CHROME, cmd: cli.PWD}, function(cmd, arg) {
|
"扫码授权": function(target) { can.misc.WSS(can, {type: aaa.LOGIN}, function(cmd, arg) {
|
||||||
if (cmd == cli.PWD) { return can.page.Modify(can, target, arg[2]), can.page.Append(can, target, [{text: "<br/>请授权: "+arg[0]}]), layout() }
|
if (cmd == cli.PWD) { return can.page.Modify(can, target, arg[2]), can.page.Append(can, target, [{text: "<br/>请授权: "+arg[0]}]), layout() }
|
||||||
if (cmd == ice.MSG_SESSID) { return can.misc.CookieSessid(can, arg[0]), can.page.Remove(can, ui._target), can.base.isFunc(cb) && cb() }
|
if (cmd == ice.MSG_SESSID) { return can.misc.CookieSessid(can, arg[0]), can.page.Remove(can, ui._target), can.base.isFunc(cb) && cb() }
|
||||||
}) },
|
}) },
|
||||||
@ -239,10 +239,7 @@ Volcanos("user", {info: {}, agent: {
|
|||||||
})),
|
})),
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
"网关授权": function(target) { can.misc.WSS(can, {type: html.CHROME, cmd: chat.SSO, back: location.href}, function(cmd, arg) {
|
}, can.base.Obj(method, can.user.isMobile? ["密码登录"]: ["扫码授权"]), can.page.Append(can, document.body, [{view: "input login"}])._target); layout()
|
||||||
if (cmd == cli.PWD) { return can.onmotion.delay(can, function() { location.href = arg[1] }) }
|
|
||||||
}) },
|
|
||||||
}, auto? ["网关授权"]: can.base.Obj(method, can.user.isMobile? ["密码登录"]: ["扫码授权"]), can.page.Append(can, document.body, [{view: "input login"}])._target); layout()
|
|
||||||
},
|
},
|
||||||
logout: function(can, force) { if (force||can.user.confirm("logout?")) { can.runAction({}, aaa.LOGOUT, [], function(msg) {
|
logout: function(can, force) { if (force||can.user.confirm("logout?")) { can.runAction({}, aaa.LOGOUT, [], function(msg) {
|
||||||
can.misc.Search(can, chat.SHARE)? can.misc.Search(can, chat.SHARE, ""): can.user.reload(true)
|
can.misc.Search(can, chat.SHARE)? can.misc.Search(can, chat.SHARE, ""): can.user.reload(true)
|
||||||
|
@ -66,7 +66,8 @@ Volcanos(chat.ONACTION, {
|
|||||||
),
|
),
|
||||||
onmain: function(can) { can.onimport.topic(can)
|
onmain: function(can) { can.onimport.topic(can)
|
||||||
can.run({}, [], function(msg) { if (!can.Conf(aaa.USERNICK, msg.Option(aaa.USERNICK)||msg.Option(ice.MSG_USERNICK)||msg.Option(ice.MSG_USERNAME))) {
|
can.run({}, [], function(msg) { if (!can.Conf(aaa.USERNICK, msg.Option(aaa.USERNICK)||msg.Option(ice.MSG_USERNICK)||msg.Option(ice.MSG_USERNAME))) {
|
||||||
return msg.Option(chat.SSO)? can.user.jumps(msg.Option(chat.SSO)): can.user.login(can, function() { can.onengine.signal(can, chat.ONMAIN, msg) }, msg.Option(aaa.LOGIN), msg.Option(ice.DEV))
|
debugger
|
||||||
|
return msg.Option(chat.SSO)? can.user.jumps(msg.Option(chat.SSO)): can.user.login(can, function() { can.onengine.signal(can, chat.ONMAIN, msg) }, msg.Option(aaa.LOGIN))
|
||||||
} can.user.info.usernick = can.Conf(aaa.USERNICK), can.user.info.language = can.misc.Search(can, aaa.LANGUAGE)||msg.Option(aaa.LANGUAGE)
|
} can.user.info.usernick = can.Conf(aaa.USERNICK), can.user.info.language = can.misc.Search(can, aaa.LANGUAGE)||msg.Option(aaa.LANGUAGE)
|
||||||
can.user.info.background = msg.Option(aaa.BACKGROUND), can.user.info.avatar = msg.Option(aaa.AVATAR)
|
can.user.info.background = msg.Option(aaa.BACKGROUND), can.user.info.avatar = msg.Option(aaa.AVATAR)
|
||||||
msg.Option(nfs.SCRIPT) && can.require(can.base.Obj(msg.Option(nfs.SCRIPT)), function(can) { can.onaction.source(can, msg) })
|
msg.Option(nfs.SCRIPT) && can.require(can.base.Obj(msg.Option(nfs.SCRIPT)), function(can) { can.onaction.source(can, msg) })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user