Skip to content

Commit

Permalink
Features: add api
Browse files Browse the repository at this point in the history
  • Loading branch information
cnyet committed Feb 26, 2020
1 parent e67534d commit 4f3417e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/api/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
wechatRedirect: '/wechat/redirect?url=http%3A%2F%2Fm.imooc.com%2F%23%2Findex&scope=snsapi_userinfo',
wechatConfig: '/wechat/jssdk',
getUserInfo: '/wechat/getUserInfo',
payWallet: '/wechat/paywallet'
wechatRedirect: '/api/wechat/redirect?url=http%3A%2F%2Fm.yates.com&scope=snsapi_userinfo',
wechatConfig: '/api/wechat/jssdk',
getUserInfo: '/api/wechat/getUserInfo',
payWallet: '/api/wechat/paywallet'
};
1 change: 0 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Vue.use(VueCookie);
Vue.use(VueAxios, axios);
// 在请求或响应被 then 或 catch 处理前添加拦截器
axios.interceptors.request.use(function(config) {
console.log(config);
return config;
}, function(error) {
console.log(error);
Expand Down
2 changes: 1 addition & 1 deletion src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const routes = [
];

const router = new VueRouter({
mode: 'hash',
mode: 'history',
base: process.env.BASE_URL,
routes
});
Expand Down
4 changes: 2 additions & 2 deletions src/views/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export default {
checkuserAuth() {
const openId = this.$cookie.get('openId');
if (!openId) {
location.href = API.wechatRedirect;
location.href = 'http://m.yates.com' + API.wechatRedirect;
} else {
this.getWechatConfig();
// this.getWechatConfig();
}
},
getWechatConfig() {
Expand Down

0 comments on commit 4f3417e

Please sign in to comment.