|
|
@@ -27,12 +27,12 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<a class="btn finish"
|
|
|
- @click="checkPhone"
|
|
|
- :disabled="!this.checked || !this.mobileChecked || !this.codeChecked">验证手机</a>
|
|
|
+ @click="checkPhone">下一步</a>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-checkbox name="type" v-model="checked" @click="checkboxIsChecked"></el-checkbox>
|
|
|
- <span class="agree">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
|
|
|
+ <span class="agree" v-if="!agreementUrl || (agreementUrl && (JSON.parse(agreementUrl.terms).isUrl))">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
|
|
|
+ <span class="agree" v-else>我已阅读并同意<a :href="`/common/cityAgreement/?appId=${this.$route.query.appId}`">《{{JSON.parse(agreementUrl.terms).name || ''}}》</a></span>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
@@ -46,13 +46,15 @@
|
|
|
placeholder="企业名称"
|
|
|
></el-input>
|
|
|
<span class="tip exist" v-show="isSpaceNameExist">
|
|
|
- {{spaceNameExitMsg}} <i class="fa fa-question-circle" aria-hidden="true"
|
|
|
- v-show="spaceNameExitMsg != '出现异常'"
|
|
|
- @mouseenter='showPopTip =true'
|
|
|
- @mouseleave='showPopTip = false'></i>
|
|
|
+ {{spaceNameExitMsg}}
|
|
|
+ <!--<i class="fa fa-question-circle" aria-hidden="true"-->
|
|
|
+ <!--v-show="spaceNameExitMsg != '出现异常'"-->
|
|
|
+ <!--@mouseenter='showPopTip =true'-->
|
|
|
+ <!--@mouseleave='showPopTip = false'></i>-->
|
|
|
</span>
|
|
|
- <div class="pop-tip" @mouseenter='showPopTip =true'
|
|
|
- @mouseleave='showPopTip = false'> <span class='pop-title' v-show="showPopTip">如果您所属企业的管理员已离职或不再使用优软云,请 <a href="/appeals/changeManagerAppeal">更换管理员</a> </span></div>
|
|
|
+ <!--<div class="pop-tip" @mouseenter='showPopTip =true'-->
|
|
|
+ <!--@mouseleave='showPopTip = false'> <span class='pop-title' v-show="showPopTip">如果您所属企业的管理员已离职或不再使用优软云,请 <a href="/appeals/changeManagerAppeal">更换管理员</a> </span>-->
|
|
|
+ <!--</div>-->
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="businessCode">
|
|
|
<el-input type="text"
|
|
|
@@ -66,7 +68,7 @@
|
|
|
<el-input type="text" v-model="enterprise1.vipName" auto-complete="off" placeholder="管理员姓名"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="password" v-if="!isHasRegister">
|
|
|
- <el-input type="password" v-model="enterprise1.password" auto-complete="off" placeholder="登录密码"></el-input>
|
|
|
+ <el-input type="password" v-model="enterprise1.password" auto-complete="new-password" placeholder="登录密码"></el-input>
|
|
|
<div class="pwd sm" v-show="showMsgTip1">密码强度 <em></em><em></em><em></em><span>弱</span></div>
|
|
|
<div class="pwd md" v-show="showMsgTip2">密码强度 <em></em><em></em><em></em><span>中</span></div>
|
|
|
<div class="pwd lar" v-show="showMsgTip3">密码强度 <em></em><em></em><em></em><span>强</span></div>
|
|
|
@@ -75,14 +77,14 @@
|
|
|
<el-form-item prop="password" v-if="isHasRegister">
|
|
|
<el-input type="password"
|
|
|
v-model="enterprise1.password"
|
|
|
- auto-complete="off"
|
|
|
+ auto-complete="new-password"
|
|
|
placeholder="密码确认"
|
|
|
v-bind:class="{ correct: passwordChecked }"></el-input>
|
|
|
- <span class="sure" v-if="isHasRegister" v-show="phoneIsRegisterTip">手机号已注册,请输入原密码 <a href="/reset/ForgetPasswordValidationAccount">忘记密码?</a></span>
|
|
|
+ <span class="sure" v-if="isHasRegister" v-show="phoneIsRegisterTip">该手机号已有优软账号,请输入原账号的登录密码进行校验确认</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="confirm" v-if="!isHasRegister">
|
|
|
<el-input type="password"
|
|
|
- auto-complete="off"
|
|
|
+ auto-complete="new-password"
|
|
|
placeholder="密码确认"
|
|
|
v-bind:class="{active: showPasswordError}"
|
|
|
v-model="enterprise1.confirm"></el-input>
|
|
|
@@ -96,22 +98,22 @@
|
|
|
v-bind:class="{active: emailHasRegister}"></el-input>
|
|
|
<span class="codeError-tip" v-if="emailHasRegister">该邮箱已被注册</span>
|
|
|
</el-form-item>
|
|
|
- <a class="btn finish"
|
|
|
- :disabled="!isHasRegister ? !spaceNameChecked || !businessCodeChecked || !vipNameChecked || !passwordChecked || !passwordConfirmChecked || !emailChecked || !checked : !isHasEmail ? !spaceNameChecked || !businessCodeChecked || !passwordChecked || !emailChecked || !checked : !spaceNameChecked || !businessCodeChecked || !passwordChecked || !checked"
|
|
|
- @click="sureRegister">确认注册
|
|
|
- </a>
|
|
|
+ <a class="btn finish" @click="sureRegister">确认注册</a>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
<el-checkbox name="type" v-model="checked" @click="checkboxIsChecked"></el-checkbox>
|
|
|
- <span class="agree">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
|
|
|
+ <span class="agree" v-if="!agreementUrl || (agreementUrl && (JSON.parse(agreementUrl.terms).isUrl))">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
|
|
|
+ <span class="agree" v-else>我已阅读并同意<a :href="`/common/cityAgreement/?appId=${this.$route.query.appId}`">《{{JSON.parse(agreementUrl.terms).name || ''}}》</a></span>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="login">已有账号?<a href="/">立即登录</a></div>
|
|
|
+ <div class="login">已有账号?<a :href="returnLogin">立即登录</a></div>
|
|
|
<loading v-show="isShowLoading"/>
|
|
|
</div>
|
|
|
+ <!--尾部-->
|
|
|
+ <div v-html="loginStyle.footUrl" class="footer"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -153,11 +155,57 @@
|
|
|
this.codeErrorChecked = false
|
|
|
this.codeChecked = false
|
|
|
} else {
|
|
|
- if (this.enterprise.code !== '') {
|
|
|
- if (this.enterprise.mobile === '') {
|
|
|
- callback(new Error('请先填写正确的手机号'))
|
|
|
+ if (this.enterprise.mobile === '') {
|
|
|
+ callback(new Error('请先填写正确的手机号'))
|
|
|
+ } else {
|
|
|
+ if (this.token) {
|
|
|
+ if (this.enterprise.code.length === 6) {
|
|
|
+ let param = new FormData()
|
|
|
+ param.append('mobile', this.enterprise.mobile)
|
|
|
+ param.append('code', this.enterprise.code)
|
|
|
+ param.append('token', this.token)
|
|
|
+ let config = {
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'}
|
|
|
+ }
|
|
|
+ this.$http.post(`/sso/userspace/register/checkCode`, param, config)
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.success) {
|
|
|
+ this.codeChecked = true
|
|
|
+ this.codeErrorChecked = false
|
|
|
+ } else {
|
|
|
+ this.codeErrorChecked = true
|
|
|
+ this.codeChecked = false
|
|
|
+ return Promise.reject(response.data)
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.codeErrorChecked = true
|
|
|
+ this.codeErrorMsg = err.errMsg
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ callback(new Error('请输入正确的验证码'))
|
|
|
+ this.codeChecked = false
|
|
|
+ this.codeErrorChecked = false
|
|
|
+ }
|
|
|
} else {
|
|
|
- if (this.token) {
|
|
|
+ callback(new Error('请先获取验证码'))
|
|
|
+ this.codeChecked = false
|
|
|
+ this.codeErrorChecked = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var validateCodeIsEmpty = (rule, value, callback) => {
|
|
|
+ if (value === '') {
|
|
|
+ callback(new Error('请填写正确的验证码'))
|
|
|
+ this.codeErrorChecked = false
|
|
|
+ this.codeChecked = false
|
|
|
+ } else {
|
|
|
+ if (this.enterprise.mobile === '') {
|
|
|
+ callback(new Error('请先填写正确的手机号'))
|
|
|
+ } else {
|
|
|
+ if (this.token) {
|
|
|
+ if (this.enterprise.code.length === 6) {
|
|
|
let param = new FormData()
|
|
|
param.append('mobile', this.enterprise.mobile)
|
|
|
param.append('code', this.enterprise.code)
|
|
|
@@ -165,7 +213,7 @@
|
|
|
let config = {
|
|
|
headers: {'Content-Type': 'multipart/form-data'}
|
|
|
}
|
|
|
- this.$http.post(`/sso/personal/register/checkCode`, param, config)
|
|
|
+ this.$http.post(`/sso/userspace/register/checkCode`, param, config)
|
|
|
.then(response => {
|
|
|
if (response.data.success) {
|
|
|
this.codeChecked = true
|
|
|
@@ -178,13 +226,16 @@
|
|
|
}).catch(err => {
|
|
|
this.codeErrorChecked = true
|
|
|
this.codeErrorMsg = err.errMsg
|
|
|
- // this.$message.error(err.errMsg)
|
|
|
})
|
|
|
} else {
|
|
|
- callback(new Error('请先获取验证码'))
|
|
|
+ callback(new Error('请输入正确的验证码'))
|
|
|
this.codeChecked = false
|
|
|
this.codeErrorChecked = false
|
|
|
}
|
|
|
+ } else {
|
|
|
+ callback(new Error('请先获取验证码'))
|
|
|
+ this.codeChecked = false
|
|
|
+ this.codeErrorChecked = false
|
|
|
}
|
|
|
}
|
|
|
callback()
|
|
|
@@ -214,7 +265,7 @@
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
this.spaceNameExitMsg = err.errMsg
|
|
|
-// this.$message.error(err.errMsg)
|
|
|
+ // this.$message.error(err.errMsg)
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -270,6 +321,7 @@
|
|
|
if (this.enterprise1.vipName !== '') {
|
|
|
if (value.length > 20) {
|
|
|
callback(new Error('输入长度过长,20个字符以内'))
|
|
|
+ this.vipNameChecked = false
|
|
|
} else {
|
|
|
this.vipNameChecked = true
|
|
|
}
|
|
|
@@ -375,43 +427,40 @@
|
|
|
} else {
|
|
|
this.passwordConfirmChecked = true
|
|
|
this.showPasswordError = false
|
|
|
- callback()
|
|
|
}
|
|
|
}
|
|
|
+ callback()
|
|
|
}
|
|
|
var validateEmail = (rule, value, callback) => {
|
|
|
if (this.isHasEmail) {
|
|
|
this.emailChecked = true
|
|
|
this.emailHasRegister = false
|
|
|
} else {
|
|
|
- if (!value) {
|
|
|
- callback(new Error('请填写正确的联系邮箱'))
|
|
|
- this.emailChecked = false
|
|
|
- this.emailHasRegister = false
|
|
|
- } else {
|
|
|
- if (this.enterprise1.email) {
|
|
|
- var reg = /^([\w-])+(\.\w+)*@([\w-])+((\.\w{2,3}){1,3})$/
|
|
|
- if (!reg.test(value)) {
|
|
|
- callback(new Error('请输入正确的邮箱地址格式'))
|
|
|
- this.emailChecked = false
|
|
|
- this.emailHasRegister = false
|
|
|
- } else {
|
|
|
- this.$http.get(`/api/user/checkEmail`, {params: {email: this.enterprise1.email}})
|
|
|
- .then(response => {
|
|
|
- if (response.data.hasRegister) {
|
|
|
- this.emailChecked = false
|
|
|
- this.emailHasRegister = true
|
|
|
- } else {
|
|
|
- this.emailChecked = true
|
|
|
- this.emailHasRegister = false
|
|
|
- return Promise.reject(response.data)
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- this.$message.error(err.errMsg)
|
|
|
- })
|
|
|
- }
|
|
|
+ if (this.enterprise1.email) {
|
|
|
+ var reg = /^([\w-])+(\.\w+)*@([\w-])+((\.\w{2,3}){1,3})$/
|
|
|
+ if (!reg.test(value)) {
|
|
|
+ callback(new Error('请输入正确的邮箱地址格式'))
|
|
|
+ this.emailChecked = false
|
|
|
+ this.emailHasRegister = false
|
|
|
+ } else {
|
|
|
+ this.$http.get(`/api/user/checkEmail`, {params: {email: this.enterprise1.email}})
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.hasRegister) {
|
|
|
+ this.emailChecked = false
|
|
|
+ this.emailHasRegister = true
|
|
|
+ } else {
|
|
|
+ this.emailChecked = true
|
|
|
+ this.emailHasRegister = false
|
|
|
+ return Promise.reject(response.data)
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.$message.error(err.errMsg)
|
|
|
+ })
|
|
|
}
|
|
|
callback()
|
|
|
+ } else {
|
|
|
+ this.emailChecked = true
|
|
|
+ this.emailHasRegister = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -453,7 +502,7 @@
|
|
|
vipNameChecked: false,
|
|
|
passwordChecked: false,
|
|
|
passwordConfirmChecked: false,
|
|
|
- emailChecked: false,
|
|
|
+ emailChecked: true,
|
|
|
isHasRegister: false,
|
|
|
isHasEmail: false,
|
|
|
goNextStep: true,
|
|
|
@@ -463,13 +512,15 @@
|
|
|
emailHasRegister: false,
|
|
|
queryLink: '',
|
|
|
appId: '',
|
|
|
+ returnLogin: '',
|
|
|
// 企业注册第一步
|
|
|
rules: {
|
|
|
mobile: [
|
|
|
{validator: validateMobile, trigger: 'blur'}
|
|
|
],
|
|
|
code: [
|
|
|
- {validator: validateCode, trigger: 'blur'}
|
|
|
+ {validator: validateCode, trigger: 'change'},
|
|
|
+ {validator: validateCodeIsEmpty, trigger: 'blur'}
|
|
|
]
|
|
|
},
|
|
|
// 企业注册第二步
|
|
|
@@ -491,11 +542,19 @@
|
|
|
{validator: validateConfirm, trigger: 'blur'}
|
|
|
],
|
|
|
email: [
|
|
|
- {validator: validateEmail, trigger: 'blur'}
|
|
|
+ {validator: validateEmail, trigger: 'change'}
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ loginStyle () {
|
|
|
+ return this.$store.state.login.loginStyle.data.content
|
|
|
+ },
|
|
|
+ agreementUrl () {
|
|
|
+ return this.$store.state.login.agreementUrl.data.content
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted () {
|
|
|
// 获取链接
|
|
|
this.$nextTick(() => {
|
|
|
@@ -506,6 +565,8 @@
|
|
|
// 获取链接
|
|
|
getUrl () {
|
|
|
var url = window.location.search
|
|
|
+ var origin = window.location.origin
|
|
|
+ this.returnLogin = origin + url
|
|
|
var request = {}
|
|
|
if (url.indexOf('?' !== -1)) {
|
|
|
var str = url.substr(1)
|
|
|
@@ -591,104 +652,225 @@
|
|
|
}).catch(err => {
|
|
|
this.$message.error(err.errMsg)
|
|
|
this.isShowLoading = false
|
|
|
- // this.codeErrorChecked = true
|
|
|
- // this.codeChecked = false
|
|
|
this.enterprise_time = 0
|
|
|
})
|
|
|
+ } else {
|
|
|
+ if (!this.enterprise.mobile) {
|
|
|
+ this.$message.error('手机号不能为空')
|
|
|
+ } else if (!this.mobileChecked) {
|
|
|
+ this.$message.error('手机号输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.token) {
|
|
|
+ this.$message.error('请先获取验证码')
|
|
|
+ } else if (!this.enterprise.code) {
|
|
|
+ this.$message.error('验证码不能为空')
|
|
|
+ } else if (!this.codeChecked) {
|
|
|
+ this.$message.error('验证码输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.checked) {
|
|
|
+ this.$message.error('您对阅读条款未做勾选')
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 确认注册
|
|
|
sureRegister () {
|
|
|
if (!this.isHasRegister) {
|
|
|
if (this.spaceNameChecked && this.businessCodeChecked && this.vipNameChecked && this.passwordChecked && this.passwordConfirmChecked && this.emailChecked && this.checked) {
|
|
|
- this.isShowLoading = true
|
|
|
- let param = new FormData()
|
|
|
- param.append('spaceName', this.enterprise1.spaceName)
|
|
|
- param.append('businessCode', this.enterprise1.businessCode)
|
|
|
- param.append('vipName', this.enterprise1.vipName || '')
|
|
|
- param.append('password', this.enterprise1.password)
|
|
|
- param.append('email', this.enterprise1.email || '')
|
|
|
- param.append('appId', this.$store.state.option.appId)
|
|
|
- param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
|
|
|
- param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
|
|
|
- param.append('invitationTime', this.$store.state.option.invitationTime)
|
|
|
- let config = {
|
|
|
- headers: {'Content-Type': 'multipart/form-data'}
|
|
|
+ this.submitRegister()
|
|
|
+ } else {
|
|
|
+ if (!this.enterprise1.spaceName) {
|
|
|
+ this.$message.error('企业名不能为空')
|
|
|
+ } else if (!this.spaceNameChecked) {
|
|
|
+ this.$message.error('企业名称输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.enterprise1.businessCode) {
|
|
|
+ this.$message.error('营业执照号不能为空')
|
|
|
+ } else if (!this.businessCodeChecked) {
|
|
|
+ this.$message.error('营业执照号输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.enterprise1.vipName) {
|
|
|
+ this.$message.error('管理员姓名不能为空')
|
|
|
+ } else if (!this.vipNameChecked) {
|
|
|
+ this.$message.error('管理员姓名输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.enterprise1.password) {
|
|
|
+ this.$message.error('密码不能为空')
|
|
|
+ } else if (!this.passwordChecked) {
|
|
|
+ this.$message.error('密码输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.enterprise1.confirm) {
|
|
|
+ this.$message.error('请再次输入密码')
|
|
|
+ } else if (this.enterprise1.password !== this.enterprise1.confirm) {
|
|
|
+ this.$message.error('请确认两次填写密码是否一致')
|
|
|
+ } else if (this.enterprise1.email && !this.emailChecked) {
|
|
|
+ this.$message.error('邮箱输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.checked) {
|
|
|
+ this.$message.error('您对阅读条款未做勾选')
|
|
|
}
|
|
|
- this.$http.post('/sso/userspace/register', param, config)
|
|
|
- .then(response => {
|
|
|
- this.isShowLoading = false
|
|
|
- if (response.data.success) {
|
|
|
- window.location.href = '/overRegister/overEnterprise'
|
|
|
- } else {
|
|
|
- return Promise.reject(response.data)
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- this.isShowLoading = false
|
|
|
- this.$message.error(err.errMsg)
|
|
|
- })
|
|
|
}
|
|
|
} else {
|
|
|
if (this.isHasEmail) {
|
|
|
- if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked) {
|
|
|
- this.isShowLoading = true
|
|
|
- let param = new FormData()
|
|
|
- param.append('spaceName', this.enterprise1.spaceName)
|
|
|
- param.append('businessCode', this.enterprise1.businessCode)
|
|
|
- param.append('vipName', this.enterprise1.vipName || '')
|
|
|
- param.append('password', this.enterprise1.password)
|
|
|
- param.append('email', this.enterprise1.email || '')
|
|
|
- param.append('appId', this.$store.state.option.appId)
|
|
|
- param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
|
|
|
- param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
|
|
|
- param.append('invitationTime', this.$store.state.option.invitationTime)
|
|
|
- let config = {
|
|
|
- headers: {'Content-Type': 'multipart/form-data'}
|
|
|
- }
|
|
|
- this.$http.post('/sso/userspace/register', param, config)
|
|
|
- .then(response => {
|
|
|
- this.isShowLoading = false
|
|
|
- if (response.data.success) {
|
|
|
- window.location.href = '/overRegister/overEnterprise'
|
|
|
- } else {
|
|
|
- return Promise.reject(response.data)
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- this.isShowLoading = false
|
|
|
- this.$message.error(err.errMsg)
|
|
|
- })
|
|
|
+ if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.checked) {
|
|
|
+ this.submitRegister()
|
|
|
+ } else {
|
|
|
+ if (!this.enterprise1.spaceName) {
|
|
|
+ this.$message.error('企业名不能为空')
|
|
|
+ } else if (!this.spaceNameChecked) {
|
|
|
+ this.$message.error('企业名称输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.enterprise1.businessCode) {
|
|
|
+ this.$message.error('营业执照号不能为空')
|
|
|
+ } else if (!this.businessCodeChecked) {
|
|
|
+ this.$message.error('营业执照号输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.enterprise1.password) {
|
|
|
+ this.$message.error('密码不能为空')
|
|
|
+ } else if (!this.checked) {
|
|
|
+ this.$message.error('您对阅读条款未做勾选')
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
- if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.emailChecked) {
|
|
|
- this.isShowLoading = true
|
|
|
- let param = new FormData()
|
|
|
- param.append('spaceName', this.enterprise1.spaceName)
|
|
|
- param.append('businessCode', this.enterprise1.businessCode)
|
|
|
- param.append('vipName', this.enterprise1.vipName || '')
|
|
|
- param.append('password', this.enterprise1.password)
|
|
|
- param.append('email', this.enterprise1.email || '')
|
|
|
- param.append('appId', this.$store.state.option.appId)
|
|
|
- param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
|
|
|
- param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
|
|
|
- param.append('invitationTime', this.$store.state.option.invitationTime)
|
|
|
- let config = {
|
|
|
- headers: {'Content-Type': 'multipart/form-data'}
|
|
|
- }
|
|
|
- this.$http.post('/sso/userspace/register', param, config)
|
|
|
- .then(response => {
|
|
|
- this.isShowLoading = false
|
|
|
- if (response.data.success) {
|
|
|
- window.location.href = '/overRegister/overEnterprise'
|
|
|
+ if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.emailChecked && this.checked) {
|
|
|
+ this.submitRegister()
|
|
|
+ } else {
|
|
|
+ if (!this.enterprise1.spaceName) {
|
|
|
+ this.$message.error('企业名不能为空')
|
|
|
+ } else if (!this.spaceNameChecked) {
|
|
|
+ this.$message.error('企业名称输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.enterprise1.businessCode) {
|
|
|
+ this.$message.error('营业执照号不能为空')
|
|
|
+ } else if (!this.businessCodeChecked) {
|
|
|
+ this.$message.error('营业执照号输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.enterprise1.password) {
|
|
|
+ this.$message.error('密码不能为空')
|
|
|
+ } else if (this.enterprise1.email && !this.emailChecked) {
|
|
|
+ this.$message.error('邮箱输入有误,请按提示重新输入')
|
|
|
+ } else if (!this.checked) {
|
|
|
+ this.$message.error('您对阅读条款未做勾选')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submitRegister () {
|
|
|
+ this.isShowLoading = true
|
|
|
+ let param = new FormData()
|
|
|
+ param.append('spaceName', this.enterprise1.spaceName)
|
|
|
+ param.append('businessCode', this.enterprise1.businessCode)
|
|
|
+ param.append('vipName', this.enterprise1.vipName || '')
|
|
|
+ param.append('password', this.enterprise1.password)
|
|
|
+ param.append('email', this.enterprise1.email || '')
|
|
|
+ param.append('appId', this.$store.state.option.appId)
|
|
|
+ param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
|
|
|
+ param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
|
|
|
+ param.append('invitationTime', this.$store.state.option.invitationTime)
|
|
|
+ let config = {
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'}
|
|
|
+ }
|
|
|
+ this.$http.post('/sso/userspace/register', param, config)
|
|
|
+ .then(response => {
|
|
|
+ this.isShowLoading = false
|
|
|
+ if (response.data.success) {
|
|
|
+ console.log(response.data)
|
|
|
+ if (response.data.content) {
|
|
|
+ if (response.data.content.type === 'mall') {
|
|
|
+ let param = response.data.content.data
|
|
|
+ let a = ''
|
|
|
+ for (let n in param) {
|
|
|
+ a += (n + '=' + encodeURIComponent(param[n]) + '&')
|
|
|
+ }
|
|
|
+ let params = a.substr(0, a.length - 1)
|
|
|
+ this.isShowLoading = true
|
|
|
+ if (response.data.content.currentUrl) {
|
|
|
+ this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
|
|
|
+ name: 'successCallback',
|
|
|
+ timeout: 3000
|
|
|
+ }, (err, data) => {
|
|
|
+ if (err) {
|
|
|
+ this.$message.error('注册成功,请点击下方“立即登录”完成登录')
|
|
|
+ this.isShowLoading = false
|
|
|
+ throw err
|
|
|
+ } else {
|
|
|
+ this.loginOther(response, params)
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
- return Promise.reject(response.data)
|
|
|
+ this.loginOther(response, params, 3000)
|
|
|
}
|
|
|
- }).catch(err => {
|
|
|
- this.isShowLoading = false
|
|
|
- this.$message.error(err.errMsg)
|
|
|
- })
|
|
|
+ } else if (response.data.content.type === 'city') {
|
|
|
+ let param = response.data.content.data
|
|
|
+ let a = ''
|
|
|
+ for (let n in param) {
|
|
|
+ a += (n + '=' + encodeURIComponent(param[n]) + '&')
|
|
|
+ }
|
|
|
+ let params = a.substr(0, a.length - 1)
|
|
|
+ this.isShowLoading = true
|
|
|
+ if (response.data.content.currentUrl) {
|
|
|
+ this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
|
|
|
+ name: 'successCallback',
|
|
|
+ timeout: 3000
|
|
|
+ }, (err, data) => {
|
|
|
+ if (err) {
|
|
|
+ this.$message.error('注册成功,请点击下方“立即登录”完成登录')
|
|
|
+ this.isShowLoading = false
|
|
|
+ throw err
|
|
|
+ } else {
|
|
|
+ this.loginCityOther(response, params)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.loginCityOther(response, params, 3000)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ window.location.href = '/overRegister/overEnterprise'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return Promise.reject(response.data)
|
|
|
}
|
|
|
- }
|
|
|
+ }).catch(err => {
|
|
|
+ this.isShowLoading = false
|
|
|
+ this.$message.error(err.errMsg)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getJsonp: function (url, timeout = 500) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$jsonp(url, {
|
|
|
+ name: 'successCallback',
|
|
|
+ timeout: timeout
|
|
|
+ }, function (err, data) {
|
|
|
+ if (err) {
|
|
|
+ reject(err)
|
|
|
+ throw err
|
|
|
+ } else {
|
|
|
+ resolve(data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ crossAfter (url) {
|
|
|
+ try {
|
|
|
+ window.location.href = url
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err)
|
|
|
}
|
|
|
+ },
|
|
|
+ loginOther (response, a, timeout) {
|
|
|
+ const crossAfter = this.crossAfter
|
|
|
+ let promises = []
|
|
|
+ for (let i in response.data.content.loginUrls) {
|
|
|
+ promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
|
|
|
+ }
|
|
|
+ let returnUrl = decodeURIComponent(this.$route.query.returnURL)
|
|
|
+ Promise.all(promises).then(() => {
|
|
|
+ crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
|
|
|
+ }).catch(() => {
|
|
|
+ crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ loginCityOther (response, a, timeout) {
|
|
|
+ const crossAfter = this.crossAfter
|
|
|
+ let promises = []
|
|
|
+ for (let i in response.data.content.loginUrls) {
|
|
|
+ promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
|
|
|
+ }
|
|
|
+ Promise.all(promises).then(() => {
|
|
|
+ crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
|
|
|
+ }).catch(() => {
|
|
|
+ crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -735,7 +917,10 @@
|
|
|
span.sure{
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
- right: -240px;
|
|
|
+ right: -271px;
|
|
|
+ width: 250px;
|
|
|
+ text-align: left;
|
|
|
+ line-height: 21px;
|
|
|
font-size: 13px;
|
|
|
color: #8c8c8c;
|
|
|
}
|
|
|
@@ -934,4 +1119,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .footer{
|
|
|
+ padding: 50px 0;
|
|
|
+ }
|
|
|
</style>
|