admin 管理员组

文章数量: 887021


2024年2月23日发(作者:嵌入式好不好学)

需求清单

username: user[0].username, nickname: user[0].nickname, type: user[0].type, avatar_url: user[0].avatar_url, create_time: user[0].create_time, expire_time: user[0].expire_time, expires_in: user[0].expires_in, login_time: user[0].login_time, login_times: user[0].login_times, }; ({ code: CODE_SUCCESS, msg: "weibo账号登录成功", data: { token, userinfo, }, }); } else { ({ code: CODE_ERROR, msg: "weibo账号登录失败", data: null, }); } } else { let addAuthUser = await setAuthUser(, 2, accessToken, 1, null); ("addAuthUser===", addAuthUser); if (edRows == 1) { let queryUser = await getAuthUser(Id); let userImage = await addUserImage(queryUser[0].openid); if (userImage) { let userinfo = { id: queryUser[0].id, openid: queryUser[0].openid, user_id: queryUser[0].user_id, username: queryUser[0].username, nickname: queryUser[0].nickname, type: queryUser[0].type, avatar_url: queryUser[0].avatar_url, create_time: queryUser[0].create_time, expire_time: queryUser[0].expire_time, expires_in: queryUser[0].expires_in, login_time: queryUser[0].login_time, login_times: queryUser[0].login_times, };

({ code: CODE_SUCCESS, msg: "weibo账号登录成功", data: { token, userinfo, }, }); } } else { ({ code: CODE_ERROR, msg: "weibo账号登录失败", data: null, }); }

if (accessToken) { let result = await axios({ method: "get", url: `${_url}`, headers: { accept: "application/json", Authorization: `token ${accessToken}`, "User-Agent": "jackchen0120", }, }); let token = getToken(accessToken); if ( == 200) { let user = await validateAuthUser(); if (user) { user[0].login_times += 1; let updateAuthUser = await setAuthUser(, 3, accessToken, 0, user[0].login_times); if (edRows == 1) { let userinfo = { id: user[0].id, openid: user[0].openid, user_id: user[0].user_id, username: user[0].username, nickname: user[0].nickname, type: user[0].type, avatar_url: user[0].avatar_url, create_time: user[0].create_time, expire_time: user[0].expire_time, expires_in: user[0].expires_in, login_time: user[0].login_time, login_times: user[0].login_times, }; ({ code: CODE_SUCCESS, msg: "github账号登录成功", data: { token, userinfo, }, }); } else { ({ code: CODE_ERROR, msg: "github账号登录失败", data: null, }); } } else { let addAuthUser = await setAuthUser(, 3, accessToken, 1, null); if (edRows == 1) { let queryUser = await getAuthUser(Id); let userImage = await addUserImage(queryUser[0].openid);

if (userImage) { let userinfo = { id: queryUser[0].id, openid: queryUser[0].openid, user_id: queryUser[0].user_id, username: queryUser[0].username, nickname: queryUser[0].nickname, type: queryUser[0].type, avatar_url: queryUser[0].avatar_url, create_time: queryUser[0].create_time, expire_time: queryUser[0].expire_time, expires_in: queryUser[0].expires_in, login_time: queryUser[0].login_time,

安装npm install -S qiniu代码实现


本文标签: 账号 登录 实现 代码 失败