mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
opt some
This commit is contained in:
parent
231f3c1b0d
commit
ede3bab23f
BIN
client/mp/.app.js.swo
Normal file
BIN
client/mp/.app.js.swo
Normal file
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
const kit = require("utils/kit.js")
|
||||
|
||||
App({
|
||||
data: {}, conf: {serve: "https://shylinux.com/chat"},
|
||||
request: function(cmd, data, cb) {var app = this; data.sessid = app.conf.sessid
|
||||
wx.request({method: "POST", url: app.conf.serve+"/"+cmd, data: data, success(res) {var msg = res.data
|
||||
data: {}, conf: {serve: "https://shylinux.com/chat", space: "mac"},
|
||||
request: function(cmd, data, cb) {var app = this; data.sessid = app.conf.sessid, data.pod = app.conf.space
|
||||
wx.request({method: "POST", url: app.conf.serve+"/"+cmd, data: data, success: function(res) {var msg = res.data
|
||||
console.log("POST", cmd, msg)
|
||||
if (res.statusCode == 401) {
|
||||
app.usercode(function() {app.request(cmd, data, cb)})
|
||||
@ -51,7 +51,12 @@ App({
|
||||
})}})
|
||||
},
|
||||
userinfo: function(cb) {var app = this
|
||||
if (app.conf.userInfo) {return typeof cb == "function" && cb(app.conf.userInfo)}
|
||||
if (app.conf.userInfo) {
|
||||
app.request("mp/login/info", app.conf.userInfo, function(msg) {
|
||||
typeof cb == "function" && cb(app.conf.userInfo)
|
||||
})
|
||||
return
|
||||
}
|
||||
app.usercode(function() {
|
||||
wx.getSetting({success: function(res) {res.authSetting['scope.userInfo'] && wx.getUserInfo({success: function(res) {
|
||||
app.request("mp/login/info", res.userInfo, function(msg) {app.conf.userInfo = res.userInfo
|
@ -3,7 +3,7 @@ const app = getApp()
|
||||
|
||||
Page({
|
||||
data: {
|
||||
action: ["扫码", "刷新", "登录"],
|
||||
action: ["扫码", "刷新", "登录", "授权"],
|
||||
msg: {append: ["key", "name"]},
|
||||
},
|
||||
action: {
|
||||
@ -22,6 +22,11 @@ Page({
|
||||
page.onaction(event, data, "刷新")
|
||||
})
|
||||
},
|
||||
"授权": function(event, page, data, name) {
|
||||
app.userinfo(function(res) {
|
||||
page.onaction(event, res, res.name)
|
||||
})
|
||||
},
|
||||
},
|
||||
onaction: function(event, data, name) {
|
||||
data = data || event.target.dataset, name = name || data.name
|
@ -83,7 +83,7 @@ Volcanos("ondetail", {help: "菜单交互", list: ["添加应用", "添加用户
|
||||
"添加用户": function(event, can, river, button) {
|
||||
can.run(event, ["search", "Search.onimport.select", "user", "", ""], function(list) {
|
||||
var args = []; can.core.List(list, function(item) {
|
||||
args = args.concat([item[4]])
|
||||
args = args.concat([item[5]])
|
||||
})
|
||||
can.run(event, [can.Conf("river"), "action", "user"].concat(args), function(msg) {
|
||||
can.user.Search(can, {"river": can.Conf("river")})
|
||||
|
Loading…
x
Reference in New Issue
Block a user