mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
opt sso
This commit is contained in:
parent
64c8574b64
commit
fd9ddf682d
12
lib/user.js
12
lib/user.js
@ -136,6 +136,7 @@ Volcanos("user", {help: "用户操作", agent: {
|
||||
"扫码": function() {
|
||||
can.misc.WSS(can, {type: "chrome", cmd: "pwd"}, function(event, msg, cmd, arg) { if (!msg) { return }
|
||||
if (cmd == "pwd") {
|
||||
can.page.Append(can, document.body, [{type: "iframe", src: arg[1], height: 400, width: window.innerWidth-4}])
|
||||
return can.user.toast(can, arg[2], arg[1], -1), msg.Reply()
|
||||
}
|
||||
if (cmd == ice.MSG_SESSID) {
|
||||
@ -144,6 +145,17 @@ Volcanos("user", {help: "用户操作", agent: {
|
||||
can.search(event, msg[ice.MSG_DETAIL]||[], function(msg) { msg.Reply() })
|
||||
})
|
||||
},
|
||||
"授权": function() {
|
||||
can.misc.WSS(can, {type: "chrome", cmd: "sso", "user.web": location.href}, function(event, msg, cmd, arg) { if (!msg) { return }
|
||||
if (cmd == "pwd") {
|
||||
return location.href = arg[1]
|
||||
}
|
||||
if (cmd == ice.MSG_SESSID) {
|
||||
return can.misc.CookieSessid(can, arg[0]), msg.Reply(), can.user.reload(true)
|
||||
}
|
||||
can.search(event, msg[ice.MSG_DETAIL]||[], function(msg) { msg.Reply() })
|
||||
})
|
||||
},
|
||||
"飞书": function() {
|
||||
location.href = "/chat/lark/sso"
|
||||
},
|
||||
|
@ -151,6 +151,10 @@ Volcanos("onaction", {help: "交互数据", list: [], _init: function(can, meta,
|
||||
},
|
||||
onmain: function(can, msg) {
|
||||
function init() { can.run({}, [], function(msg) {
|
||||
if (can.misc.Search(can, "sessid")) {
|
||||
can.misc.Cookie(can, "sessid", can.misc.Search(can, "sessid"))
|
||||
return can.misc.Search(can, "sessid", "")
|
||||
}
|
||||
can.base.Copy(can.onaction._trans, can.base.Obj(msg.Option(chat.TRANS), {}))
|
||||
can.onimport._init(can, msg, [], function(msg) { can.onengine.signal(can, chat.ONLOGIN, msg) }, can._output)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user