提交 1245bf42 编写于 作者: guangjun.yang's avatar guangjun.yang

去掉日志

上级 e50220ad
...@@ -57,11 +57,11 @@ const router = new VueRouter({ ...@@ -57,11 +57,11 @@ const router = new VueRouter({
// 过滤路由 // 过滤路由
function fliterRoute(query, path) { function fliterRoute(query, path) {
alert('fliterRoute 111' + JSON.stringify(query) + path); console.log('fliterRoute 111' + JSON.stringify(query) + path);
let has = false; let has = false;
// 登录token保存并替换路径 // 登录token保存并替换路径
if (query.token && query.token != 'undefined') { if (query.token && query.token != 'undefined') {
alert('fliterRoute 222 ' + JSON.stringify(query) + path); console.log('fliterRoute 222 ' + JSON.stringify(query) + path);
store.dispatch('setToken', query.token); store.dispatch('setToken', query.token);
delete query.token; delete query.token;
has = true; has = true;
...@@ -85,7 +85,7 @@ function fliterRoute(query, path) { ...@@ -85,7 +85,7 @@ function fliterRoute(query, path) {
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
alert('beforeEach @@@@@@'); console.log('beforeEach @@@@@@');
// 商品页授权登录路由处理 // 商品页授权登录路由处理
if (to.path === '/goods-detail') { if (to.path === '/goods-detail') {
let searchQuery = querystring(location.search); let searchQuery = querystring(location.search);
......
...@@ -17,7 +17,7 @@ const user = { ...@@ -17,7 +17,7 @@ const user = {
mutations: { mutations: {
SET_TOKEN: (state, payload) => { SET_TOKEN: (state, payload) => {
state.token = payload; state.token = payload;
alert('state.token ' + state.token); console.log('state.token ' + state.token);
}, },
SET_USER_INFO_2: (state, payload) => { SET_USER_INFO_2: (state, payload) => {
state.info = payload; state.info = payload;
...@@ -32,11 +32,11 @@ const user = { ...@@ -32,11 +32,11 @@ const user = {
actions: { actions: {
// 外部登陆返回设置token // 外部登陆返回设置token
setToken({ commit, dispatch }, params) { setToken({ commit, dispatch }, params) {
alert('setToken 1', params); console.log('setToken 1', params);
if( typeof(params) == 'object') { if( typeof(params) == 'object') {
params = params.join(""); params = params.join("");
} }
alert('setToken 2', params); console.log('setToken 2', params);
commit('SET_TOKEN', params); commit('SET_TOKEN', params);
localStorage.setItem('couponToken', params); localStorage.setItem('couponToken', params);
setCookie('couponToken', params) setCookie('couponToken', params)
......
...@@ -16,7 +16,7 @@ module.exports = { ...@@ -16,7 +16,7 @@ module.exports = {
if (this.$route !== undefined) { if (this.$route !== undefined) {
query = this.$route.query query = this.$route.query
} }
// alert('this.token' + this.token) // console.log('this.token' + this.token)
this.token = this.getUrlKey('token') || (query && query.token) this.token = this.getUrlKey('token') || (query && query.token)
}, },
computed: { computed: {
...@@ -231,16 +231,16 @@ module.exports = { ...@@ -231,16 +231,16 @@ module.exports = {
// 校验token,有效则调用回调函数,否则调起原生登陆页面 // 校验token,有效则调用回调函数,否则调起原生登陆页面
commonCheckToken(cb) { commonCheckToken(cb) {
alert('5555 this.token' + this.token); console.log('5555 this.token', this.token);
let param = { let param = {
token: this.token || this.$store.state.user.token || this.$store.state.coop.userInfo.userToken || localStorage.getItem("couponToken") || getCookie("couponToken"), token: this.token || this.$store.state.user.token || this.$store.state.coop.userInfo.userToken || localStorage.getItem("couponToken") || getCookie("couponToken"),
// token: this.token || this.$store.state.user.token || this.$store.state.coop.userInfo.userToken, // token: this.token || this.$store.state.user.token || this.$store.state.coop.userInfo.userToken,
setEntry: true setEntry: true
}; };
alert('this.token || this.$store.state.user.token || this.$store.state.coop.userInfo.userToken', this.token, this.$store.state.user.token, this.$store.state.coop.userInfo.userToken); console.log('this.token || this.$store.state.user.token || this.$store.state.coop.userInfo.userToken', this.token, this.$store.state.user.token, this.$store.state.coop.userInfo.userToken);
this.GET("campaign/admin/task/checkToken", param).then(res => { this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") { if (res.code !== "000000") {
alert('commonCheckToken', window.__isWeb); console.log('commonCheckToken', window.__isWeb);
if(window.__isWeb) { if(window.__isWeb) {
this.goLogin(); this.goLogin();
} else { } else {
......
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
watch: { watch: {
webUserInfo: { webUserInfo: {
handler(userInfo) { handler(userInfo) {
alert("userInfo", userInfo); console.log("userInfo", userInfo);
if (userInfo.id) { if (userInfo.id) {
this.getAllCoupons(); this.getAllCoupons();
} }
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
} }
window.__getUserInfo4CouponList = function(param) { window.__getUserInfo4CouponList = function(param) {
alert("__getUserInfo4CouponList", param); console.log("__getUserInfo4CouponList", param);
_this.token = param.userToken; _this.token = param.userToken;
_this.setUserInfo(param); _this.setUserInfo(param);
_this.getAllCoupons(); _this.getAllCoupons();
...@@ -96,16 +96,13 @@ export default { ...@@ -96,16 +96,13 @@ export default {
let { token, info } = this.$store.state.user; let { token, info } = this.$store.state.user;
token = token || localStorage.getItem("couponToken") || getCookie("couponToken"); token = token || localStorage.getItem("couponToken") || getCookie("couponToken");
this.token = token; this.token = token;
alert("1111 token" + token);
alert("222" + localStorage.getItem("couponToken"));
alert("333" + getCookie("couponToken"));
// if (!token) { // if (!token) {
// alert('this.goLogin()'); // console.log('this.goLogin()');
// this.goLogin(); // this.goLogin();
// return; // return;
// } // }
if (token && !info.id) { if (token && !info.id) {
alert('4444 this.token' + this.token); console.log('4444 this.token' + this.token);
// this.commonCheckToken(() => { // this.commonCheckToken(() => {
this.$store.dispatch("getUserInfo"); this.$store.dispatch("getUserInfo");
// }); // });
...@@ -146,7 +143,7 @@ export default { ...@@ -146,7 +143,7 @@ export default {
this.POST(`trade/coupon/app/receive/${couponId}`, {}).then( this.POST(`trade/coupon/app/receive/${couponId}`, {}).then(
({ code, data }) => { ({ code, data }) => {
if (code == "000000") { if (code == "000000") {
alert("data.description", data.description); console.log("data.description", data.description);
data.description && Toast(data.description); data.description && Toast(data.description);
this.searchCoupons(); this.searchCoupons();
} }
...@@ -169,13 +166,13 @@ export default { ...@@ -169,13 +166,13 @@ export default {
item.disabled = item.couponStatus == 0 || item.couponStatus == 1 || item.couponStatus == 4; item.disabled = item.couponStatus == 0 || item.couponStatus == 1 || item.couponStatus == 4;
newList.push(item); newList.push(item);
}); });
alert(newList); console.log(newList);
return newList; return newList;
}, },
// 获取所有优惠券列表 // 获取所有优惠券列表
getAllCoupons() { getAllCoupons() {
alert('getAllCoupons'); console.log('getAllCoupons');
this.commonCheckToken(() => { this.commonCheckToken(() => {
let couponId = this.couponId; let couponId = this.couponId;
if (couponId) { if (couponId) {
...@@ -204,7 +201,7 @@ export default { ...@@ -204,7 +201,7 @@ export default {
imgUrl: "https://file.yunqueyi.com/logo.png" imgUrl: "https://file.yunqueyi.com/logo.png"
}, },
() => { () => {
alert("share success..."); console.log("share success...");
} }
); );
if(this.fromPage) { if(this.fromPage) {
......
...@@ -268,10 +268,10 @@ export default { ...@@ -268,10 +268,10 @@ export default {
this.token = token; this.token = token;
console.log("token && !info.id", !info.id, token); console.log("token && !info.id", !info.id, token);
if (!token) { // if (!token) {
this.goLogin(); // this.goLogin();
return; // return;
} // }
if (token && !info.id) { if (token && !info.id) {
this.commonCheckToken(() => { this.commonCheckToken(() => {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册