Commit c6504b13 by hank

更改测试

parent 973945a9
......@@ -10,7 +10,7 @@
"build": "cross-env NODE_ENV=production node build/build.js",
"buildtest": "cross-env NODE_ENV=development node build/build.js",
"rename": "node tools.js",
"postbuild": "npm run rename"
"postbuild": ""
},
"dependencies": {
"axios": "^0.18.0",
......
......@@ -19,10 +19,10 @@ const weburl = '/relay/contest/h5'
// 正式地址
// var url = mode === 'development' ? 'http://web-comment.canskj.cn' : 'http://wanda-qj.iyunfish.com'
// 测试地址
var url = mode === 'development' ? 'http://web-comment.canskj.cn' : 'http://web-comment.canskj.cn'
var url = mode === 'development' ? 'https://wanda-video-tapi.bdideal.com' : 'https://wanda-video-tapi.bdideal.com'
console.log('mode', mode, url)
// api地址
var server = url + '/new';
var server = url;
var extra = '7';
//防封包装的地址
......
import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios'
import { resolve } from 'url';
Vue.use(Vuex);
export default new Vuex.Store({
......@@ -13,7 +13,8 @@ export default new Vuex.Store({
userBoxScroll: 0,
activeInfo:'',
ruweiBoxScroll: 0,
ruweigonggao: null
ruweigonggao: null,
userInfo: localStorage.getItem('userInfo') || {}
},
mutations: {
changeLastBoxScrollY(state, num) {
......@@ -35,6 +36,7 @@ export default new Vuex.Store({
state.ruweiBoxScroll = num;
},
getRuweiInfo(state,num){
console.log('/contest/selected/list')
axios
.get('/contest/selected/list', {
params: {
......@@ -51,6 +53,39 @@ export default new Vuex.Store({
console.log('num');
console.log(num);
state.ruweigonggao = num;
},
getAuth (state, auth) {
},
getUserInfo(state) {
return new Promise((resolve, reject) => {
axios.get('/contest/user/info').then(res => {
state.userInfo = res.data.data
localStorage.setItem('userInfo', JSON.stringify(res.data.data))
alert('获取用户信息成功')
resolve(res)
}).catch(e =>{
reject(e)
})
})
}
},
actions: {
getAuth({commit,state}) {
return new Promise((resolve, reject) => {
axios.get('/weixin/info').then(res => {
window.localStorage.setItem('callbackurl', location.href)
location.href = res.data.data.url + '/video/2.html'
})
})
},
getToken({commit,state}){
return new Promise((resolve, reject) => {
axios.get('weixin/callback').then(res => {
window.localStorage.setItem('callbackurl', location.href)
location.href = res.data.data.url + '/video/2.html'
})
})
}
}
})
\ No newline at end of file
......@@ -37,14 +37,22 @@ export default {
return tranName;
}
},
watch: {
},
created() {
// this.hiddenBar();
this.hiddenBar();
if(localStorage.getItem('token')) {
} else {
store.dispatch('getAuth')
}
// 请求入围信息,提前加载入围的信息防止入围公告闪烁
store.commit('getRuweiInfo');
},
mounted() {
var tar_userinfo = localStorage.getItem('tar_userinfo');
console.log(tar)
if (tar_userinfo) {
var tar_openid = localStorage.getItem('tar-uuid-129831');
tar.init({
......
......@@ -225,7 +225,7 @@ export default {
this.userCenter = api.userCenterHref
this.signHref = api.signHref
this.getUserInfo();
// this.getUserInfo();
this.fucengButton = localStorage.getItem("fucengButton") ? 'close' : 'open';
this.getRuweiList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment