Commit c6504b13 by hank

更改测试

parent 973945a9
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"build": "cross-env NODE_ENV=production node build/build.js", "build": "cross-env NODE_ENV=production node build/build.js",
"buildtest": "cross-env NODE_ENV=development node build/build.js", "buildtest": "cross-env NODE_ENV=development node build/build.js",
"rename": "node tools.js", "rename": "node tools.js",
"postbuild": "npm run rename" "postbuild": ""
}, },
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
......
...@@ -19,10 +19,10 @@ const weburl = '/relay/contest/h5' ...@@ -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://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) console.log('mode', mode, url)
// api地址 // api地址
var server = url + '/new'; var server = url;
var extra = '7'; var extra = '7';
//防封包装的地址 //防封包装的地址
......
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import axios from 'axios' import axios from 'axios'
import { resolve } from 'url';
Vue.use(Vuex); Vue.use(Vuex);
export default new Vuex.Store({ export default new Vuex.Store({
...@@ -13,7 +13,8 @@ export default new Vuex.Store({ ...@@ -13,7 +13,8 @@ export default new Vuex.Store({
userBoxScroll: 0, userBoxScroll: 0,
activeInfo:'', activeInfo:'',
ruweiBoxScroll: 0, ruweiBoxScroll: 0,
ruweigonggao: null ruweigonggao: null,
userInfo: localStorage.getItem('userInfo') || {}
}, },
mutations: { mutations: {
changeLastBoxScrollY(state, num) { changeLastBoxScrollY(state, num) {
...@@ -35,6 +36,7 @@ export default new Vuex.Store({ ...@@ -35,6 +36,7 @@ export default new Vuex.Store({
state.ruweiBoxScroll = num; state.ruweiBoxScroll = num;
}, },
getRuweiInfo(state,num){ getRuweiInfo(state,num){
console.log('/contest/selected/list')
axios axios
.get('/contest/selected/list', { .get('/contest/selected/list', {
params: { params: {
...@@ -51,6 +53,39 @@ export default new Vuex.Store({ ...@@ -51,6 +53,39 @@ export default new Vuex.Store({
console.log('num'); console.log('num');
console.log(num); console.log(num);
state.ruweigonggao = 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 { ...@@ -37,14 +37,22 @@ export default {
return tranName; return tranName;
} }
}, },
watch: {
},
created() { created() {
// this.hiddenBar(); this.hiddenBar();
if(localStorage.getItem('token')) {
} else {
store.dispatch('getAuth')
}
// 请求入围信息,提前加载入围的信息防止入围公告闪烁 // 请求入围信息,提前加载入围的信息防止入围公告闪烁
store.commit('getRuweiInfo'); store.commit('getRuweiInfo');
}, },
mounted() { mounted() {
var tar_userinfo = localStorage.getItem('tar_userinfo'); var tar_userinfo = localStorage.getItem('tar_userinfo');
console.log(tar)
if (tar_userinfo) { if (tar_userinfo) {
var tar_openid = localStorage.getItem('tar-uuid-129831'); var tar_openid = localStorage.getItem('tar-uuid-129831');
tar.init({ tar.init({
......
...@@ -225,7 +225,7 @@ export default { ...@@ -225,7 +225,7 @@ export default {
this.userCenter = api.userCenterHref this.userCenter = api.userCenterHref
this.signHref = api.signHref this.signHref = api.signHref
this.getUserInfo(); // this.getUserInfo();
this.fucengButton = localStorage.getItem("fucengButton") ? 'close' : 'open'; this.fucengButton = localStorage.getItem("fucengButton") ? 'close' : 'open';
this.getRuweiList(); 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