()
| 27 | |
| 28 | // 检测sessionkey是否过期 1未过期 0已过期 |
| 29 | const 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 | // 登录授权 |
| 49 | const login = (params)=> { |
nothing calls this directly
no test coverage detected