提交 9b007cfe authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 65a2fbaa
......@@ -4,26 +4,26 @@ module.exports = {
// apiBaseURL: 'https://zy2.ezijing.com/',
webpack: {
externals: {
'CKEDITOR': 'window.CKEDITOR',
'Base64': 'window.Base64',
'md5': 'window.md5',
'regeneratorRuntime': 'window.regeneratorRuntime',
'wx': 'window.wx',
CKEDITOR: 'window.CKEDITOR',
Base64: 'window.Base64',
md5: 'window.md5',
regeneratorRuntime: 'window.regeneratorRuntime',
wx: 'window.wx'
},
devServer: {
proxy: {
'/api/passport': {
target: 'https://passport.ezijing.com',
pathRewrite: {
'^/api/passport': '/' // 需要rewrite重写的
}
},
'/usercenter': {
target: 'https://api-usercenter.ezijing.com',
pathRewrite: {
'^/usercenter': '/' // 需要rewrite重写的
}
}
// '/api/passport': {
// target: 'https://passport.ezijing.com',
// pathRewrite: {
// '^/api/passport': '/' // 需要rewrite重写的
// }
// },
// '/api/usercenter': {
// target: 'https://api-usercenter.ezijing.com',
// pathRewrite: {
// '^/api/usercenter': '/' // 需要rewrite重写的
// }
// }
/* 多个代理 */
// '/api': {
// target: $GLOBAL.webConf.url,
......@@ -43,10 +43,6 @@ module.exports = {
}
}
},
ProvidePlugin: {
},
others: {
}
ProvidePlugin: {},
others: {}
}
......@@ -47,6 +47,7 @@ export default {
.course-item-pic {
width: 2.4rem;
height: 1.35rem;
margin-right: 10px;
border-radius: 6px;
overflow: hidden;
margin-right: 0.2rem;
......@@ -66,6 +67,7 @@ export default {
overflow: hidden;
}
.course-item__text {
max-height: 0.68rem;
font-size: 0.26rem;
color: #999;
display: -webkit-box;
......
......@@ -50,6 +50,7 @@ export default {
.course-item-pic {
width: 2.4rem;
height: 1.35rem;
margin-left: 10px;
border-radius: 6px;
overflow: hidden;
img {
......
<template>
<div></div>
<div class="messages"></div>
</template>
<script>
import MessageCard from './messageCard.vue'
import * as api from '@/api/course.js'
export default {
props: {},
components: { MessageCard },
data() {
return {}
return {
messageList: []
}
},
getCourseTag() {
api.getCourseTag(this.courseId).then(response => {
console.log(response)
})
}
}
</script>
<style lang="scss" scoped>
.messages {
background: #eee;
}
</style>
<template>
<div class="message-card">
<div class="message-card-hd">
<div class="message-card__title">{{data.name}}</div>
</div>
<div class="message-card-bd">
<ul v-if="data.tag && data.tag.length">
<li v-for="item in data.tag" :key="item.id">{{item.title}}</li>
</ul>
</div>
<div class="message-card-ft">更多</div>
</div>
</template>
<script>
export default {
name: 'MessageCard',
props: {
data: { type: Object }
}
}
</script>
......@@ -6,6 +6,9 @@
<van-swipe-item>
<img src="../../assets/images/banner.png" />
</van-swipe-item>
<van-swipe-item>
<img src="../../assets/images/banner.png" />
</van-swipe-item>
</van-swipe>
</div>
<div class="nav">
......@@ -21,7 +24,7 @@
</li>
</ul>
</div>
<card title="课程试听" style="padding-bottom:50px;">
<card title="课程试听" style="padding-bottom:60px;">
<free-course-item v-for="item in courseList" :data="item" :key="item.course_id"></free-course-item>
</card>
</div>
......
......@@ -2,7 +2,7 @@
<div class="code-login">
<van-form class="login-form" ref="form" v-on="$listeners">
<van-field v-model="ruleForm.account" name="account" label="手机号" placeholder="请输入手机号" />
<van-field v-model="ruleForm.code" name="code" label="验证码" placeholder="请输入验证码">
<van-field v-model="ruleForm.password" name="password" label="验证码" placeholder="请输入验证码">
<template slot="button">
<countdown-button @click.native="onSendCode" ref="countdown"></countdown-button>
</template>
......@@ -20,7 +20,7 @@ export default {
components: { CountdownButton },
data() {
return {
ruleForm: { account: '', code: '' }
ruleForm: { account: '', password: '' }
}
},
methods: {
......@@ -28,7 +28,7 @@ export default {
if (!this.ruleForm.account) {
this.$notify('请输手机号')
return false
} else if (!this.ruleForm.code) {
} else if (!this.ruleForm.password) {
this.$notify('请输入验证码')
return false
}
......
......@@ -11,9 +11,9 @@
<div class="login-bd">
<div class="login-form">
<!-- 账号登录 -->
<account-login ref="form" @submit="onSubmit" v-if="!this.isWechat"></account-login>
<!-- <account-login ref="form" @submit="onSubmit" v-if="!this.isWechat"></account-login> -->
<!-- 验证码登录 -->
<code-login ref="form" @submit="onSubmit" v-if="this.isWechat"></code-login>
<code-login ref="form" @submit="onSubmit"></code-login>
<div class="login-button" @click="handleSubmit">立即绑定</div>
</div>
</div>
......@@ -23,7 +23,7 @@
<img src="../../assets/images/login_wechat.png" alt="微信登录" />微信登录
</li>
</ul>
</div> -->
</div>-->
</div>
</div>
</template>
......@@ -49,8 +49,7 @@ export default {
},
passwordVisible: false,
isWechat: /micromessenger/.test(UA),
unionid: Cookies.get('wechat_login_no_phone_error'),
redirectUrl: ''
unionid: Cookies.get('wechat_login_no_phone_error')
}
},
computed: {
......@@ -69,14 +68,7 @@ export default {
},
// 提交
onSubmit(data) {
if (this.isWechat) {
this.ruleForm.type = 2
this.bindWechat(data)
} else {
this.ruleForm.type = 1
this.loginRequest(data)
}
// !this.isWechat ? this.bindWechat(data) : this.loginRequest(data)
this.unionid ? this.bindWechat(data) : this.loginRequest(data)
},
// 登录
loginRequest(data) {
......@@ -92,8 +84,10 @@ export default {
},
// 绑定微信并登录
bindWechat(data) {
const params = Object.assign({}, this.ruleForm, data, { unionid: this.unionid })
console.log(params)
const params = Object.assign({}, this.ruleForm, data, {
unionid: this.unionid,
code: data.password
})
api
.bindWechat(params)
.then(response => {
......@@ -126,10 +120,9 @@ export default {
}
},
wechatLogin() {
if (this.$route.query.type) { return false }
const appId = 'wx451c01d40d090d7a'
// 回调地址
const redirectURI = `https://passport.ezijing.com/rest/wechat/oauth-callback?needCheck=false&identity=transport&redirectUrl=${this.redirectUrl}`
const redirectURI = `https://passport.ezijing.com/rest/wechat/oauth-callback?needCheck=false&identity=transport&redirectUrl=${window.location.href}`
// 微信的地址
const wechatUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURIComponent(
redirectURI
......@@ -145,12 +138,15 @@ export default {
}
},
created() {
if (this.isWechat) {
this.redirectUrl = `${window.location.origin}/login?type=1`
if (!this.$route.query.type) {
this.$store.dispatch('checkLogin').then(isLogin => {
if (isLogin) {
this.loginSuccess({ code: 1, data: { TGC: Cookies.get('TGC') } })
} else {
if (this.isWechat && !this.checkWechatLogin()) {
this.wechatLogin()
}
}
})
}
}
</script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论