更新状态

This commit is contained in:
tcubic 2022-08-02 10:38:29 +08:00
parent 2431ca5a89
commit 3d2c065a0f
5 changed files with 38 additions and 25 deletions

View File

@ -5,7 +5,7 @@ NODE_ENV = 'test'
VUE_APP_BASE_URL = 'https://test.szxgl.cn/zszq-celebration/activity/' VUE_APP_BASE_URL = 'https://test.szxgl.cn/zszq-celebration/activity/'
// 业务接口 // 业务接口
VUE_APP_API = 'https://test.szxgl.cn/zszq-celebration' VUE_APP_API = 'https://wealth.newone.com.cn'
// CDN地址 // CDN地址
VUE_APP_CDN = 'https://test.szxgl.cn/zszq-celebration/activity/' VUE_APP_CDN = 'https://test.szxgl.cn/zszq-celebration/activity/'

View File

@ -1,6 +1,8 @@
import axios from 'axios' import axios from 'axios'
import QS from 'qs'; import QS from 'qs';
console.log("API:",process.env.VUE_APP_API);
// 创建axios // 创建axios
const service = axios.create({ const service = axios.create({
// baseURL: 'https://hd.xglpa.com/pars-training', //生产环境 // baseURL: 'https://hd.xglpa.com/pars-training', //生产环境

View File

@ -185,27 +185,14 @@ const btn = () => {
const drawBtn = () => { const drawBtn = () => {
console.log("抽奖:"); console.log("抽奖:");
// console.log("",getAuthorize(1)); // console.log("",getAuthorize(1));
// let href = window.location.href;
// let h_idx = window.location.href.indexOf("#");
// let out_href = href.slice(0, h_idx);
// service.get(process.env.VUE_APP_ZS_DOMAIN + '/wxauth/official/account/authorize',{params:{ // if (h5plugin.getQueryString("forceauth")) {
// redirectUrl: out_href, // console.log("yes-forceauth");
// scope: 1, // getAuthorize(0);
// }}).then((res) => { // } else {
// console.log("no-forceauth");
// console.log("",res); // getAuthorize(1);
// }) // }
if (h5plugin.getQueryString("forceauth")) {
// H5P.getSetCookie('authState',1,{expires:0.5})
console.log("yes-forceauth");
getAuthorize(0);
} else {
// H5P.getSetCookie('authState',1,{expires:0.5})
console.log("no-forceauth");
getAuthorize(1);
}
}; };
// //

View File

@ -35,8 +35,7 @@ const authCode = ref('')
// //
onBeforeMount(() => { onBeforeMount(() => {
console.log("用户活动信息1", store.state.userAccount); console.log("link",window.location.href);
console.log("授权链接:",window.location.href);
// //
// if (h5plugin.isWX()) { // if (h5plugin.isWX()) {
@ -49,9 +48,18 @@ onBeforeMount(() => {
// } else { // } else {
// getCode() // getCode()
// } // }
// } // }
// let token = h5plugin.getQueryString('token')
// openid
store.commit({ type: "updateToken", token: h5plugin.getQueryString('token') });
store.commit({ type: "updateCardId", cardId: h5plugin.getQueryString('cardId') });
store.commit({ type: "updateNkh", cardId: h5plugin.getQueryString('nkh') });
console.log("用户活动信息:", store.state.userAccount);
}); });

View File

@ -7,6 +7,8 @@ export default createStore({
userAccount: { userAccount: {
xglOpenid: 'openid12138', //用户openid xglOpenid: 'openid12138', //用户openid
token: 'token12138', //用户token token: 'token12138', //用户token
cardId: '', //carid
nkh: '', //牛卡号
isDraw: false, //是否抽过奖 isDraw: false, //是否抽过奖
isHasAccount: false, //是否存在牛卡号 isHasAccount: false, //是否存在牛卡号
isAddCustomer: false, //是否添加过服务人员 isAddCustomer: false, //是否添加过服务人员
@ -24,7 +26,21 @@ export default createStore({
// 更新信广龙openid // 更新信广龙openid
updateXGLOpenid(state, val) { updateXGLOpenid(state, val) {
state.userAccount.xglOpenid = val.openid state.userAccount.xglOpenid = val.openid
} },
// 更新token
updateToken(state,val){
state.userAccount.token = val.token
},
updateCardId(state,val){
state.userAccount.cardId = val.cardId
},
updateNkh(state,val){
state.userAccount.nkh = val.nkh
},
}, },
// 改变方法:异步 // 改变方法:异步
actions: {}, actions: {},