23 lines
394 B
JavaScript
23 lines
394 B
JavaScript
import { appAuth } from '../api/public';
|
|
|
|
class Apps{
|
|
/**
|
|
* 授权登录获取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);
|
|
})
|
|
.catch(reject);
|
|
});
|
|
}
|
|
}
|
|
export default new Apps();
|