miao33: 从 main 同步 single_uniapp22miao,dart-sass 兼容修复,DEPLOY.md 更新
- 从 main 获取 single_uniapp22miao 子项目 - dart-sass: /deep/ -> ::v-deep,calc 运算符加空格 - DEPLOY.md 采用 shccd159 版本(4 子项目架构说明) Made-with: Cursor
This commit is contained in:
45
single_uniapp22miao/libs/apps.js
Normal file
45
single_uniapp22miao/libs/apps.js
Normal file
@@ -0,0 +1,45 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
import { appAuth } from '../api/public';
|
||||
import { tokenIsExistApi } from '@/api/api.js';
|
||||
class Apps{
|
||||
/**
|
||||
* 校验token是否有效,true为有效,false为无效
|
||||
*/
|
||||
getTokenIsExist(){
|
||||
return new Promise( (resolve,reject) => {
|
||||
tokenIsExistApi().then(res => {
|
||||
resolve(res.data);
|
||||
}).catch(reject);
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权登录获取token
|
||||
* @param {Object} code
|
||||
*/
|
||||
authApp(code) {
|
||||
return new Promise((resolve, reject) => {
|
||||
appAuth(code,{'spread_spid': 0})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
resolve(data);
|
||||
Cache.set(WX_AUTH, code);
|
||||
Cache.clear(STATE_KEY);
|
||||
loginType && Cache.clear(LOGINTYPE);
|
||||
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
||||
}
|
||||
export default new Apps();
|
||||
Reference in New Issue
Block a user