改了一个小漏洞

smart_class
educoder_weapp 5 years ago
parent ca083688ca
commit ac723f3c05

@ -1,3 +1,5 @@
const AV = require("../lib/av-live-query-weapp-min")
function login() { function login() {
return AV.Promise.resolve(AV.User.current()).then(user => return AV.Promise.resolve(AV.User.current()).then(user =>
user ? (user.isAuthenticated().then(authed => authed ? user : null)) : null user ? (user.isAuthenticated().then(authed => authed ? user : null)) : null

@ -1,5 +1,5 @@
const { Class } = require("../../model/class"); const { Class } = require("../../model/class");
const { login } = require("../../model/user"); const login = require("../../model/user");
const AV = require("../../lib/av-live-query-weapp-min.js"); const AV = require("../../lib/av-live-query-weapp-min.js");
const { jsonify } = require('../../utils/leancloudutils'); const { jsonify } = require('../../utils/leancloudutils');
// pages/class/class.js // pages/class/class.js
@ -37,7 +37,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
login();
}, },
/** /**

Loading…
Cancel
Save