123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- // store/index.js
- import Vue from 'vue';
- import Vuex from 'vuex';
- Vue.use(Vuex);
- import {
- getConfigByKey
- } from '@/api/index.js'
- export default new Vuex.Store({
- state: {
- webviewUrl: '',
- wsDanmuUrl: 'wss://userappkyt.ylrzcloud.com', // 弹幕评论接口地址
- //红包领取规则:
- answerType: 1, //红包领取规则 0:完课且最后一分钟(第二次无需最后一分钟), 1:按完课百分比答题领红包
- isSpare:1, // 0,主要小程序,1:备选
- uploadFile: 'https://userappkyt.ylrzcloud.com',
- // imgpath: 'https://hylj-1323137866.cos.ap-chongqing.myqcloud.com',//云联融智图片请求地址
- // logoname:'云联融智优选',
- // appid:'wxd70f99287830cb51',
- // imgpath: 'https://fbylive.obs.cn-southwest-2.myhuaweicloud.com',//福本源图片请求地址
- // logoname:'乐氏本源',
- // appid:'wxb9b453d37c5fad45',
- // imgpath: 'https://zkzh-2025.oss-cn-beijing.aliyuncs.com',//中康未来智慧药房图片请求地址
- // //https://zkzh-2025.oss-cn-beijing.aliyuncs.com/shop 中康商城图片链接
- // logoname:'中康未来智慧',
- // appid:'wxedde588767b358b1',//中康未来智慧药房
- // imgpath: 'https://zkzh-2025.oss-cn-beijing.aliyuncs.com',//新中康图片请求地址
- // logoname:'中康未来智慧店',
- // // appid:'wxd8a19174bfd936fe',//洪恬百货店
- // appid:'wx83024d042825b5d4',
- // imgpath: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com',//医健宝图片请求地址
- // logoname:'医建宝',
- // appid:'wx9e61312fe7ac85c4',//福康瑞祥广告传媒
- // appid:'wxb20b7f91a35859e5',//欣能开发
- // appid:'wx2df3bca30e7dba75',//欣能用品
- // appid:'wx664a3b14808e010b',//上雅工具
- // imgpath: 'https://whhm-1361716159.cos.ap-chongqing.myqcloud.com',//惠名大药房图片请求地址
- // logoname:'惠名大药房',
- // appid:'wxc9553ad82d0d61b8'//h5,
- // imgpath: 'https://liangmiao.obs.cn-southwest-2.myhuaweicloud.com',//良苗图片请求地址
- // logoname:'良苗',
- // appid:'wx80dc06697b583cd9',
- // imgpath: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com',//倍力优图片请求地址
- // logoname:'倍力优',
- // appid:'wx301ab2fad04c658a',
- // imgpath: 'https://bnkc-1323137866.cos.ap-chongqing.myqcloud.com',//百年康城图片请求地址
- // logoname:'百年康成',
- // appid:'wx65e5d520e35bf3f5'//,
- // imgpath: 'https://drk-1363981074.cos.ap-chongqing.myqcloud.com',//德瑞康图片请求地址
- // logoname:'青岛市德瑞康',
- // appid:'wx29d26f63f836be7f',
- // imgpath: 'https://bjczwh.oss-cn-beijing.aliyuncs.com',//北京存在文化
- // logoname:'食养生活',
- // appid:'wx94951f52d3ac5e25',
- imgpath: 'https://kuanyitang-1317640934.cos.ap-shanghai.myqcloud.com', //宽益堂
- logoname: '宽益堂',
- appid: 'wx776911549d9b5545',
- // appid:'wx0fee9948ae1f0cb1', // 涵翡阅读社
- // appid:'wxe71231197bc54634', // 伴慧阅读社
- // appid:'wxf9d43e667e4a80e3', // 梦婵阅读社
- // appid:'wxb37b9255f770fd9a', // 雪菲阅读社
- // appid:'wx2e637d61b84080c0', // 芮矜阅读社
- // imgpath: 'https://hcl-1b2b.obs.cn-south-1.myhuaweicloud.com',//恒春来
- // logoname:'恒春来',
- // appid:'', //空入尚服装铺
- // imgpath: 'https://qdtst-1360717104.cos.ap-nanjing.myqcloud.com', //四季智慧理养
- // logoname: '四季智慧理养',
- // appid: 'wx4c7d16230312168f',
- },
- mutations: {
- setCount(state, value) {
- state.count = value;
- },
- setUserInfo(state, info) {
- state.userInfo = info;
- },
- setWebviewUrl(state, value) {
- state.webviewUrl = value;
- },
- },
- actions: {
- fetchUser({commit}) {
- // const res = await uni.request({ url: '/api/user' });
- commit('setUserInfo', 'noe');
- },
- getWebviewUrl({commit}) {
- var that = this;
- var data = {
- key: 'course.config'
- }
- return new Promise((resolve, reject) => {
- getConfigByKey(data).then(res => {
- if (res.code == 200) {
- console.log("getConfigByKey====", JSON.parse(res.data))
- let data = JSON.parse(res.data)
- commit('setWebviewUrl', data.userCourseAuthDomain);
- resolve()
- }
- }).catch(error => {
- reject(error)
- });
- })
- }
- }
- });
|