文件
NHCshopro/shopro/permission/index.js
可乐加冰 9d2488a631 chore: 纳入小程序完整源码
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-23 20:25:01 +08:00

38 行
685 B
JavaScript

/**
* 权限入口文件
* @param {String} authType -权限种类
*/
// #ifdef MP
import MpAuth from './mp.js' //微信小程序
// #endif
// #ifdef H5
import H5Auth from './h5.js' //H5相关
// #endif
// #ifdef APP-VUE
import AppAuth from './app.js' //APP相关
// #endif
export default class Auth {
constructor(authType) {
this.authType = authType
}
async check() {
let state = 0
// #ifdef MP
state = await new MpAuth(this.authType).checkAuth()
// #endif
// #ifdef H5
state = await new H5Auth(this.authType).checkAuth()
// #endif
// #ifdef APP-VUE
state = await new AppAuth(this.authType).checkAuth()
// #endif
return Promise.resolve(state)
}
}