12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import { appAuth } from '../api/public';
- import { tokenIsExistApi } from '@/api/api.js';
- class Apps{
-
- getTokenIsExist(){
- return new Promise( (resolve,reject) => {
- tokenIsExistApi().then(res => {
- resolve(res.data);
- }).catch(reject);
- })
- }
-
-
- 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();
|