MCPcopy Create free account
hub / github.com/CoderOpen/waimai / checkSessionKey

Function checkSessionKey

front/common/authorize.js:29–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27
28// 检测sessionkey是否过期 1未过期 0已过期
29const checkSessionKey=()=>{
30
31 return new Promise((resolve,reject) => {
32 const user = getStorageSync('user');// 用户缓存信息
33 if(user){
34 uni.checkSession({
35 success() {
36 resolve(user); //状态未过期
37 }
38 ,fail() {
39 resolve(false); //状态已过期
40 }
41 })
42 }else{
43 resolve(false); //未存贮
44 }
45 })
46}
47
48// 登录授权
49const login = (params)=> {

Callers

nothing calls this directly

Calls 1

getStorageSyncFunction · 0.85

Tested by

no test coverage detected