提交 c98b0fed authored 作者: lihuihui's avatar lihuihui

Merge branch 'enterprise-wmp' of…

Merge branch 'enterprise-wmp' of https://gitlab.ezijing.com/zhangyanxin/learn-mbaOnline into enterprise-wmp
......@@ -23,6 +23,7 @@ export default class OtherAction extends BaseACTION {
*/
getInfo () { return Other.getInfo().then(res => res) }
examAutoLogin (obj) { return Other.examAutoLogin(obj).then(res => res) }
/* 调用退出登录接口 */
outLogin () { return Other.outLogin().then(res => res) }
/**
......
......@@ -95,6 +95,9 @@ export default class API {
const _vIn = this.getVueInstance()
const { status, data } = res
if (status === 200) {
if (/util\/kaosx/gi.test(res.config.url)) {
return data
}
/* 针对 不同的 接口做一下 统一处理 */
/* 带 code 参数,新接口模型 */
if (data && data.code !== undefined) {
......
......@@ -11,7 +11,7 @@ export default class OtherAPI extends BaseAPI {
*/
getMyMsg = () => this.get('/v2/education/message/my', {})
/* 支持三方登录 */
examAutoLogin = (obj) => this.post('https://api.kaoshixing.com/api/company/data/177165/?jwt=', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
examAutoLogin = (obj) => this.post('/util/kaosx', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 调用退出登录
*/
......
......@@ -28,7 +28,7 @@
</div>
</div>
<div class="btn-block">
<div>我已阅读,开始考试</div>
<div @click="goExam">我已阅读,开始考试</div>
</div>
</div>
</div>
......@@ -36,6 +36,8 @@
</template>
<script>
import cAction from '@action'
export default {
data () {
return {
......@@ -66,6 +68,20 @@ export default {
},
popHide () {
this.dialogVisible = false
},
goExam () {
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Other.examAutoLogin({
user_id: window.G.UserInfo.id,
user_name: (window.G.UserInfo && window.G.UserInfo.student_info && window.G.UserInfo.student_info.personal_name) || '匿名',
password: md5('000000'),
department: '部门分类'
}).then(res => {
loading.close()
if (res.msg === 'success') {
window.open(res.url)
}
})
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论