|
@@ -1,6 +1,7 @@
|
|
|
import { REQUEST_CONFIG } from '../../config';
|
|
import { REQUEST_CONFIG } from '../../config';
|
|
|
import { WebOauth2Authorize } from '../../service/base';
|
|
import { WebOauth2Authorize } from '../../service/base';
|
|
|
import { useDomain } from '../use-domain';
|
|
import { useDomain } from '../use-domain';
|
|
|
|
|
+import store from '../../store';
|
|
|
|
|
|
|
|
/** 缓存是否过期 */
|
|
/** 缓存是否过期 */
|
|
|
export const useIsExpiration = async () => {
|
|
export const useIsExpiration = async () => {
|
|
@@ -67,12 +68,11 @@ const smallProgramLoginByMPWEIXIN = async (app: App.AppInstance) => {
|
|
|
},
|
|
},
|
|
|
success(resp: any) {
|
|
success(resp: any) {
|
|
|
if (resp.data.RespCode == '10000') {
|
|
if (resp.data.RespCode == '10000') {
|
|
|
- uni.setStorageSync('token', resp.data.token);
|
|
|
|
|
- getApp().globalData.token = resp.data.token;
|
|
|
|
|
- uni.setStorageSync('openid', resp.data.openId);
|
|
|
|
|
- uni.setStorageSync('unionid', resp.data.unionId);
|
|
|
|
|
- uni.setStorageSync('smallProOpenId', resp.data.smallProOpenId);
|
|
|
|
|
- uni.setStorageSync('wechatOpenid', resp.data.wechatOpenid);
|
|
|
|
|
|
|
+ store.commit('setToken', resp.data.token);
|
|
|
|
|
+ store.commit('setOpenId', resp.data.openId);
|
|
|
|
|
+ store.commit('setUnionId', resp.data.unionId);
|
|
|
|
|
+ store.commit('setSmallProOpenId', resp.data.smallProOpenId);
|
|
|
|
|
+ store.commit('setWechatOpenId', resp.data.wechatOpenid);
|
|
|
uni.setStorageSync('isCall', 0);
|
|
uni.setStorageSync('isCall', 0);
|
|
|
|
|
|
|
|
// publicFn.preserMember();
|
|
// publicFn.preserMember();
|
|
@@ -154,12 +154,11 @@ const smallProgramLoginByGONGZHONGHAO = (app: App.AppInstance) => {
|
|
|
success(resp: any) {
|
|
success(resp: any) {
|
|
|
console.log('1111', resp);
|
|
console.log('1111', resp);
|
|
|
if (resp.data.RespCode == '10000') {
|
|
if (resp.data.RespCode == '10000') {
|
|
|
- uni.setStorageSync('token', resp.data.token);
|
|
|
|
|
- getApp().globalData.token = resp.data.token;
|
|
|
|
|
- uni.setStorageSync('openid', resp.data.openId);
|
|
|
|
|
- uni.setStorageSync('unionid', resp.data.unionId);
|
|
|
|
|
- uni.setStorageSync('smallProOpenId', resp.data.smallProOpenId);
|
|
|
|
|
- uni.setStorageSync('wechatOpenid', resp.data.wechatOpenid);
|
|
|
|
|
|
|
+ store.commit('setToken', resp.data.token);
|
|
|
|
|
+ store.commit('setOpenId', resp.data.openId);
|
|
|
|
|
+ store.commit('setUnionId', resp.data.unionId);
|
|
|
|
|
+ store.commit('setSmallProOpenId', resp.data.smallProOpenId);
|
|
|
|
|
+ store.commit('setWechatOpenId', resp.data.wechatOpenid);
|
|
|
uni.setStorageSync('isCall', 0);
|
|
uni.setStorageSync('isCall', 0);
|
|
|
|
|
|
|
|
// publicFn.preserMember();
|
|
// publicFn.preserMember();
|