提交 535d4188 authored 作者: 王鹏飞's avatar 王鹏飞

增加登录成功回调地址

上级 55213ad4
......@@ -5,10 +5,10 @@ module.exports = {
// apiBaseURL: '//demo-login.ezijing.com/',
webpack: {
externals: {
'CKEDITOR': 'window.CKEDITOR',
'Base64': 'window.Base64',
'md5': 'window.md5',
'regeneratorRuntime': 'window.regeneratorRuntime'
CKEDITOR: 'window.CKEDITOR',
Base64: 'window.Base64',
md5: 'window.md5',
regeneratorRuntime: 'window.regeneratorRuntime'
},
devServer: {
proxy: {
......@@ -31,10 +31,13 @@ module.exports = {
}
}
},
ProvidePlugin: {
},
ProvidePlugin: {},
others: {
sofia: {
url: 'http://sofia-learning2.ezijing.com'
},
ciis: {
url: 'http://ciis-learning2.ezijing.com'
}
}
}
......@@ -6,16 +6,19 @@ module.exports = {
isEnableToIphoneDebugger: false,
webpack: {
externals: {
'CKEDITOR': 'window.CKEDITOR',
'Base64': 'window.Base64',
'md5': 'window.md5',
'regeneratorRuntime': 'window.regeneratorRuntime'
CKEDITOR: 'window.CKEDITOR',
Base64: 'window.Base64',
md5: 'window.md5',
regeneratorRuntime: 'window.regeneratorRuntime'
}
},
ProvidePlugin: {
},
ProvidePlugin: {},
others: {
sofia: {
url: 'http://sofia-learning.ezijing.com'
},
ciis: {
url: 'http://ciis-learning.ezijing.com'
}
}
}
......@@ -7,16 +7,19 @@ module.exports = {
isEnableToIphoneDebugger: true,
webpack: {
externals: {
'CKEDITOR': 'window.CKEDITOR',
'Base64': 'window.Base64',
'md5': 'window.md5',
'regeneratorRuntime': 'window.regeneratorRuntime'
CKEDITOR: 'window.CKEDITOR',
Base64: 'window.Base64',
md5: 'window.md5',
regeneratorRuntime: 'window.regeneratorRuntime'
}
},
ProvidePlugin: {
},
ProvidePlugin: {},
others: {
sofia: {
url: 'http://sofia-learning2.ezijing.com'
},
ciis: {
url: 'http://ciis-learning2.ezijing.com'
}
}
}
差异被折叠。
......@@ -2,11 +2,7 @@
<div>
<el-form :model="ruleForm" :rules="rules" ref="form" @submit.native.prevent>
<el-form-item prop="account">
<el-input
v-model="ruleForm.account"
placeholder="邮箱/手机号"
@keyup.enter.native="handleSubmit"
>
<el-input v-model="ruleForm.account" placeholder="邮箱/手机号" @keyup.enter.native="handleSubmit">
<i slot="prefix" class="el-input__icon el-icon-user"></i>
</el-input>
</el-form-item>
......@@ -20,7 +16,7 @@
<i slot="prefix" class="el-input__icon el-icon-lock"></i>
</el-input>
</el-form-item>
<el-checkbox v-model="ruleForm.RememberMe" style="margin-bottom:10px;">记住我</el-checkbox>
<el-checkbox v-model="ruleForm.RememberMe" style="margin-bottom: 10px">记住我</el-checkbox>
<el-button type="primary" class="submit-button" :loading="loading" @click="handleSubmit">登录</el-button>
</el-form>
<div class="login-footer">
......@@ -47,9 +43,9 @@ export default {
},
computed: {
// 重定向地址
redirectURI() {
nextUrl() {
const { query } = this.$route
return query.redirect_uri ? decodeURIComponent(query.redirect_uri) : ''
return query.next_url ? decodeURIComponent(query.next_url) : ''
}
},
methods: {
......@@ -68,13 +64,11 @@ export default {
// 登录成功
handleSuccess(response) {
this.$message({ type: 'success', message: '登录成功' })
if (document.referrer) {
window.location.href = document.referrer
if (this.nextUrl) {
window.location.href = this.nextUrl
} else {
this.$emit('success', response)
}
// if (this.redirectURI) {
// } else {
// this.$router.replace('/')
// }
}
}
}
......
......@@ -7,11 +7,7 @@
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="ruleForm.password"
placeholder="请输入登录验证码"
@keyup.enter.native="handleSubmit"
>
<el-input v-model="ruleForm.password" placeholder="请输入登录验证码" @keyup.enter.native="handleSubmit">
<i slot="prefix" class="el-input__icon el-icon-unlock"></i>
<countdown
slot="suffix"
......@@ -22,7 +18,7 @@
></countdown>
</el-input>
</el-form-item>
<el-checkbox v-model="ruleForm.RememberMe" style="margin-bottom:10px;">记住我</el-checkbox>
<el-checkbox v-model="ruleForm.RememberMe" style="margin-bottom: 10px">记住我</el-checkbox>
<el-button type="primary" class="submit-button" @click="handleSubmit">登录</el-button>
</el-form>
<div class="login-footer">
......@@ -51,9 +47,9 @@ export default {
},
computed: {
// 重定向地址
redirectURI() {
nextUrl() {
const { query } = this.$route
return query.redirect_uri ? decodeURIComponent(query.redirect_uri) : ''
return query.next_url ? decodeURIComponent(query.next_url) : ''
},
disabledSend() {
return !/^1[3-9]\d{9}$/.test(this.ruleForm.account)
......@@ -75,15 +71,11 @@ export default {
// 登录成功
handleSuccess(response) {
this.$message({ type: 'success', message: '登录成功' })
if (document.referrer) {
window.location.href = document.referrer
if (this.nextUrl) {
window.location.href = this.nextUrl
} else {
this.$emit('success', response)
}
// if (this.redirectURI) {
// this.$message({ type: 'success', message: '登录成功' })
// window.location.href = this.redirectURI
// } else {
// this.$router.replace('/')
// }
},
// 验证码
sendCodeRequest() {
......
<template>
<router-view></router-view>
<router-view @success="handleSuccess"></router-view>
</template>
<script>
export default { name: 'CiisLogin' }
export default {
name: 'CiisLogin',
methods: {
handleSuccess(response) {
const { url } = webConf.others.ciis
window.location.href = url
}
}
}
</script>
<style lang="scss" scoped>
......
......@@ -4,7 +4,7 @@
<div class="header-logo">
<img src="../assets/logo.png" />
</div>
<div class="header-title">在线学习系统11</div>
<div class="header-title">在线学习系统</div>
</header>
<section class="main">
<router-view></router-view>
......
<template>
<div class="login">
<el-row type="flex" justify="space-between" align="middle" style="width:100%">
<el-row type="flex" justify="space-between" align="middle" style="width: 100%">
<el-col :span="12" class="hidden-xs-only">
<div class="login-logo">
<img src="./assets/login_logo.png" />
......@@ -8,7 +8,7 @@
</el-col>
<el-col :span="12" :xs="24">
<div class="login-box">
<router-view></router-view>
<router-view @success="handleSuccess"></router-view>
</div>
</el-col>
</el-row>
......@@ -16,7 +16,15 @@
</template>
<script>
export default { name: 'SofiaLogin' }
export default {
name: 'SofiaLogin',
methods: {
handleSuccess(response) {
const { url } = webConf.others.sofia
window.location.href = url
}
}
}
</script>
<style lang="scss" scoped>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论