|
@@ -29,7 +29,7 @@
|
|
|
<div class="valid-code">
|
|
<div class="valid-code">
|
|
|
<input type="text"
|
|
<input type="text"
|
|
|
v-model="enterprise.ImgCode">
|
|
v-model="enterprise.ImgCode">
|
|
|
- <img id="captchaImage2" :src="`${address}/sso/login/checkCode`" alt="">
|
|
|
|
|
|
|
+ <img id="captchaImage2" alt="">
|
|
|
<span @click="getImgCode">看不清换一张</span>
|
|
<span @click="getImgCode">看不清换一张</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="valid-btn">
|
|
<div class="valid-btn">
|
|
@@ -39,7 +39,7 @@
|
|
|
<button class="code-btn"
|
|
<button class="code-btn"
|
|
|
slot="reference"
|
|
slot="reference"
|
|
|
v-show="sendEnterpriseCode"
|
|
v-show="sendEnterpriseCode"
|
|
|
- :disabled="mobileChecked">获取验证码</button>
|
|
|
|
|
|
|
+ :disabled="!mobileChecked">获取验证码</button>
|
|
|
</el-popover>
|
|
</el-popover>
|
|
|
</template>
|
|
</template>
|
|
|
<button class="code-btn" v-show="!sendEnterpriseCode">已发送({{enterprise_time}}s)</button>
|
|
<button class="code-btn" v-show="!sendEnterpriseCode">已发送({{enterprise_time}}s)</button>
|
|
@@ -86,55 +86,61 @@
|
|
|
@blur="checkVipName(enterprise.vipName)"/>
|
|
@blur="checkVipName(enterprise.vipName)"/>
|
|
|
<span class="help-list" v-text="vipNameErrMsg"></span>
|
|
<span class="help-list" v-text="vipNameErrMsg"></span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="form-group">
|
|
|
|
|
- <input type="text" class="form-control"
|
|
|
|
|
|
|
+ <div class="form-group" v-if="!isHasRegister">
|
|
|
|
|
+ <input type="password" class="form-control"
|
|
|
placeholder="登录密码"
|
|
placeholder="登录密码"
|
|
|
v-model="enterprise.password"
|
|
v-model="enterprise.password"
|
|
|
maxlength="20"
|
|
maxlength="20"
|
|
|
|
|
+ :class="{'err': !passwordChecked}"
|
|
|
@blur="checkPassword(enterprise.password)"
|
|
@blur="checkPassword(enterprise.password)"
|
|
|
- @change="passwordStrength(enterprise.password)"/>
|
|
|
|
|
- <span class="help-list" v-text="mobileErrMsg"></span>
|
|
|
|
|
|
|
+ @input="passwordStrength(enterprise.password)"/>
|
|
|
|
|
+ <span class="help-list" v-text="passwordErrMsg"></span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="pwd" v-if="!isHasRegister"
|
|
|
|
|
- :class="{sm: strength === '弱', md: strength === '中', lar: strength === '强', low: strength === ''}">
|
|
|
|
|
- 密码强度 <em></em><em></em><em></em>
|
|
|
|
|
- <span v-text="strength === '弱' ? '弱' : strength === '中' ? '中' : strength === '强' ? '强' : ''">弱</span>
|
|
|
|
|
|
|
+ <div v-if="enterprise.password">
|
|
|
|
|
+ <div class="pwd" v-if="!isHasRegister"
|
|
|
|
|
+ :class="{sm: strength === '弱', md: strength === '中', lar: strength === '强', low: strength === ''}">
|
|
|
|
|
+ 密码强度 <em></em><em></em><em></em>
|
|
|
|
|
+ <span v-text="strength === '弱' ? '弱' : strength === '中' ? '中' : strength === '强' ? '强' : ''">弱</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-group" v-if="isHasRegister">
|
|
<div class="form-group" v-if="isHasRegister">
|
|
|
- <input type="text" class="form-control"
|
|
|
|
|
|
|
+ <input type="password" class="form-control"
|
|
|
placeholder="密码确认"
|
|
placeholder="密码确认"
|
|
|
v-model="enterprise.password"
|
|
v-model="enterprise.password"
|
|
|
maxlength="20"
|
|
maxlength="20"
|
|
|
|
|
+ :class="{'err': !passwordChecked}"
|
|
|
@blur="checkRegisterPassword(enterprise.password)"/>
|
|
@blur="checkRegisterPassword(enterprise.password)"/>
|
|
|
<span class="help-list" v-text="phoneIsRegisterTip"></span>
|
|
<span class="help-list" v-text="phoneIsRegisterTip"></span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-group" v-if="!isHasRegister">
|
|
<div class="form-group" v-if="!isHasRegister">
|
|
|
- <input type="text" class="form-control"
|
|
|
|
|
|
|
+ <input type="password" class="form-control"
|
|
|
placeholder="密码确认"
|
|
placeholder="密码确认"
|
|
|
v-model="enterprise.confirm"
|
|
v-model="enterprise.confirm"
|
|
|
maxlength="20"
|
|
maxlength="20"
|
|
|
|
|
+ :class="{'err': !passwordConfirmChecked}"
|
|
|
@blur="checkConfirm(enterprise.confirm)"/>
|
|
@blur="checkConfirm(enterprise.confirm)"/>
|
|
|
- <span class="help-list" v-text="mobileErrMsg"></span>
|
|
|
|
|
|
|
+ <span class="help-list" v-text="confirmErrMsg"></span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-group" v-if="!isHasEmail">
|
|
<div class="form-group" v-if="!isHasEmail">
|
|
|
<input type="text" class="form-control"
|
|
<input type="text" class="form-control"
|
|
|
placeholder="联系邮箱"
|
|
placeholder="联系邮箱"
|
|
|
v-model="enterprise.email"
|
|
v-model="enterprise.email"
|
|
|
maxlength="20"
|
|
maxlength="20"
|
|
|
|
|
+ :class="{'err': !emailChecked}"
|
|
|
@blur="checkEmail(enterprise.email)"/>
|
|
@blur="checkEmail(enterprise.email)"/>
|
|
|
- <span class="help-list" v-text="mobileErrMsg"></span>
|
|
|
|
|
|
|
+ <span class="help-list" v-text="emailErrMsg"></span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
<label class="check-box-wrap">
|
|
<label class="check-box-wrap">
|
|
|
<input type="checkbox"
|
|
<input type="checkbox"
|
|
|
id="check-boxes"
|
|
id="check-boxes"
|
|
|
- v-model="isRead"
|
|
|
|
|
- :checked="isRead">
|
|
|
|
|
|
|
+ v-model="isReads"
|
|
|
|
|
+ :checked="isReads">
|
|
|
<label class="agr" for="check-box">我已阅读并同意<a :href="`${address}/common/agreement`" target="_blank">《优软云服务条款》</a></label>
|
|
<label class="agr" for="check-box">我已阅读并同意<a :href="`${address}/common/agreement`" target="_blank">《优软云服务条款》</a></label>
|
|
|
</label>
|
|
</label>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
- <span class="next-btn" @click="nextStep">确认注册</span>
|
|
|
|
|
|
|
+ <span class="next-btn" @click="sureRegister">确认注册</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -172,16 +178,23 @@
|
|
|
confirm: '',
|
|
confirm: '',
|
|
|
email: ''
|
|
email: ''
|
|
|
},
|
|
},
|
|
|
|
|
+ imageCode: `${this.address}/sso/login/checkCode`,
|
|
|
mobileErrMsg: '一个手机可注册多个企业',
|
|
mobileErrMsg: '一个手机可注册多个企业',
|
|
|
codeErrMsg: '',
|
|
codeErrMsg: '',
|
|
|
spaceNameErrMsg: '',
|
|
spaceNameErrMsg: '',
|
|
|
businessCodeErrMsg: '',
|
|
businessCodeErrMsg: '',
|
|
|
vipNameErrMsg: '',
|
|
vipNameErrMsg: '',
|
|
|
- mobileChecked: true,
|
|
|
|
|
|
|
+ passwordErrMsg: '',
|
|
|
|
|
+ confirmErrMsg: '',
|
|
|
|
|
+ emailErrMsg: '',
|
|
|
|
|
+ mobileChecked: false,
|
|
|
codeChecked: false,
|
|
codeChecked: false,
|
|
|
spaceNameChecked: false,
|
|
spaceNameChecked: false,
|
|
|
businessCodeChecked: false,
|
|
businessCodeChecked: false,
|
|
|
vipNameChecked: false,
|
|
vipNameChecked: false,
|
|
|
|
|
+ passwordChecked: false,
|
|
|
|
|
+ passwordConfirmChecked: false,
|
|
|
|
|
+ emailChecked: true,
|
|
|
showLoading: false,
|
|
showLoading: false,
|
|
|
visible: false,
|
|
visible: false,
|
|
|
address: '',
|
|
address: '',
|
|
@@ -189,17 +202,18 @@
|
|
|
token: '',
|
|
token: '',
|
|
|
enterprise_time: 0,
|
|
enterprise_time: 0,
|
|
|
isRead: true,
|
|
isRead: true,
|
|
|
|
|
+ isReads: true,
|
|
|
isHasRegister: false,
|
|
isHasRegister: false,
|
|
|
isHasEmail: false,
|
|
isHasEmail: false,
|
|
|
- goNextStep: false,
|
|
|
|
|
|
|
+ goNextStep: true,
|
|
|
phoneIsRegisterTip: '该手机号已有优软账号,请输入原账号的登录密码进行校验确认',
|
|
phoneIsRegisterTip: '该手机号已有优软账号,请输入原账号的登录密码进行校验确认',
|
|
|
strength: ''
|
|
strength: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted () {
|
|
mounted () {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
- this.getImgCode()
|
|
|
|
|
this.getAddress()
|
|
this.getAddress()
|
|
|
|
|
+ this.getImgCode()
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -214,15 +228,15 @@
|
|
|
checkMobile (flg) {
|
|
checkMobile (flg) {
|
|
|
let reg = /^1[0-9]{10}$/
|
|
let reg = /^1[0-9]{10}$/
|
|
|
if (flg === '' && !flg) {
|
|
if (flg === '' && !flg) {
|
|
|
- this.mobileChecked = true
|
|
|
|
|
|
|
+ this.mobileChecked = false
|
|
|
this.mobileErrMsg = '请填写正确的手机号'
|
|
this.mobileErrMsg = '请填写正确的手机号'
|
|
|
} else {
|
|
} else {
|
|
|
if (!reg.test(flg)) {
|
|
if (!reg.test(flg)) {
|
|
|
- this.mobileChecked = true
|
|
|
|
|
|
|
+ this.mobileChecked = false
|
|
|
this.mobileErrMsg = '请填写正确的手机号'
|
|
this.mobileErrMsg = '请填写正确的手机号'
|
|
|
} else {
|
|
} else {
|
|
|
this.mobileErrMsg = ''
|
|
this.mobileErrMsg = ''
|
|
|
- this.mobileChecked = false
|
|
|
|
|
|
|
+ this.mobileChecked = true
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -235,7 +249,7 @@
|
|
|
},
|
|
},
|
|
|
getCode () {
|
|
getCode () {
|
|
|
this.showLoading = true
|
|
this.showLoading = true
|
|
|
- if (!this.mobileChecked) {
|
|
|
|
|
|
|
+ if (this.mobileChecked) {
|
|
|
this.$http.get(`${this.address}/sso/userspace/register/checkCode`, {params: {mobile: this.enterprise.mobile, timestamp: new Date().getTime() + '', code: this.enterprise.ImgCode}})
|
|
this.$http.get(`${this.address}/sso/userspace/register/checkCode`, {params: {mobile: this.enterprise.mobile, timestamp: new Date().getTime() + '', code: this.enterprise.ImgCode}})
|
|
|
.then(response => {
|
|
.then(response => {
|
|
|
this.showLoading = false
|
|
this.showLoading = false
|
|
@@ -320,47 +334,54 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
nextStep () {
|
|
nextStep () {
|
|
|
- if (this.mobileChecked && !this.codeChecked) {
|
|
|
|
|
- this.checkMobile(this.enterprise.mobile)
|
|
|
|
|
- this.checkMsgCode(this.enterprise.code)
|
|
|
|
|
- } else {
|
|
|
|
|
- if(!this.isRead) {
|
|
|
|
|
- this.$message.error('您对阅读条款未做勾选')
|
|
|
|
|
- } else {
|
|
|
|
|
- this.showLoading = true
|
|
|
|
|
- let param = new FormData()
|
|
|
|
|
- param.append('mobile', this.enterprise.mobile)
|
|
|
|
|
- param.append('code', this.enterprise.code)
|
|
|
|
|
- param.append('appId', 'mall')
|
|
|
|
|
- param.append('token', this.token)
|
|
|
|
|
- let config = {
|
|
|
|
|
- headers: {'Content-Type': 'multipart/form-data'}
|
|
|
|
|
- }
|
|
|
|
|
- this.$http.post(`${this.address}/sso/userspace/register/checkAdminTel`, param, config)
|
|
|
|
|
- .then(response => {
|
|
|
|
|
- this.showLoading = false
|
|
|
|
|
- if (response.data.success) {
|
|
|
|
|
- this.goNextStep = false
|
|
|
|
|
- if (response.data.content.hasRegister) {
|
|
|
|
|
- this.isHasRegister = true
|
|
|
|
|
- if (response.data.content.hasEmail) {
|
|
|
|
|
- this.isHasEmail = true
|
|
|
|
|
- } else {
|
|
|
|
|
- this.isHasEmail = false
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (this.mobileChecked && this.codeChecked && this.isRead) {
|
|
|
|
|
+ this.showLoading = true
|
|
|
|
|
+ let param = new FormData()
|
|
|
|
|
+ param.append('mobile', this.enterprise.mobile)
|
|
|
|
|
+ param.append('code', this.enterprise.code)
|
|
|
|
|
+ param.append('appId', 'mall')
|
|
|
|
|
+ param.append('token', this.token)
|
|
|
|
|
+ let config = {
|
|
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'}
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$http.post(`${this.address}/sso/userspace/register/checkAdminTel`, param, config)
|
|
|
|
|
+ .then(response => {
|
|
|
|
|
+ this.showLoading = false
|
|
|
|
|
+ if (response.data.success) {
|
|
|
|
|
+ this.goNextStep = false
|
|
|
|
|
+ if (response.data.content.hasRegister) {
|
|
|
|
|
+ this.isHasRegister = true
|
|
|
|
|
+ if (response.data.content.hasEmail) {
|
|
|
|
|
+ this.isHasEmail = true
|
|
|
} else {
|
|
} else {
|
|
|
- this.isHasRegister = false
|
|
|
|
|
this.isHasEmail = false
|
|
this.isHasEmail = false
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- this.goNextStep = true
|
|
|
|
|
- return Promise.reject(response.data)
|
|
|
|
|
|
|
+ this.isHasRegister = false
|
|
|
|
|
+ this.isHasEmail = false
|
|
|
}
|
|
}
|
|
|
- }).catch(err => {
|
|
|
|
|
- this.$message.error(err.errMsg)
|
|
|
|
|
- this.showLoading = false
|
|
|
|
|
- this.enterprise_time = 0
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.goNextStep = true
|
|
|
|
|
+ return Promise.reject(response.data)
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.$message.error(err.errMsg)
|
|
|
|
|
+ this.showLoading = 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.isRead) {
|
|
|
|
|
+ this.$message.error('您对阅读条款未做勾选')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -393,7 +414,7 @@
|
|
|
this.businessCodeErrMsg = '请填写正确的营业执照号'
|
|
this.businessCodeErrMsg = '请填写正确的营业执照号'
|
|
|
this.businessCodeChecked = false
|
|
this.businessCodeChecked = false
|
|
|
} else {
|
|
} else {
|
|
|
- this.$http.get(`${this.address}/api/userspace/checkBusinessCode`, {params: {spaceName: this.enterprise.businessCode}})
|
|
|
|
|
|
|
+ this.$http.get(`${this.address}/api/userspace/checkBusinessCode`, {params: {businessCode: this.enterprise.businessCode}})
|
|
|
.then(response => {
|
|
.then(response => {
|
|
|
if (response.data.success) {
|
|
if (response.data.success) {
|
|
|
this.businessCodeChecked = true
|
|
this.businessCodeChecked = true
|
|
@@ -422,20 +443,289 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
passwordStrength (flg) {
|
|
passwordStrength (flg) {
|
|
|
|
|
+ console.log(flg)
|
|
|
let reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
|
|
let reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
|
|
|
let reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
|
|
let reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
|
|
|
- if (reg1.test(flg)) {
|
|
|
|
|
- this.strength = '强'
|
|
|
|
|
- } else if (reg2.test(flg)) {
|
|
|
|
|
- this.strength = '中'
|
|
|
|
|
|
|
+ if (flg.length <= 20 && flg.length >= 8) {
|
|
|
|
|
+ if (reg1.test(flg)) {
|
|
|
|
|
+ this.strength = '强'
|
|
|
|
|
+ } else if (reg2.test(flg)) {
|
|
|
|
|
+ this.strength = '中'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.strength = '弱'
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
- this.strength = '弱'
|
|
|
|
|
|
|
+ this.strength = ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- checkPassword (flg) {},
|
|
|
|
|
- checkRegisterPassword (flg) {},
|
|
|
|
|
- checkConfirm (flg) {},
|
|
|
|
|
- checkEmail (flg) {}
|
|
|
|
|
|
|
+ checkPassword (flg) {
|
|
|
|
|
+ if (!flg && flg === '') {
|
|
|
|
|
+ this.passwordErrMsg = '请输入密码'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (flg.length <= 20 && flg.length >= 8) {
|
|
|
|
|
+ let reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
|
|
|
|
|
+ let reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
|
|
|
|
|
+ if (reg1.test(flg)) {
|
|
|
|
|
+ this.passwordChecked = true
|
|
|
|
|
+ this.passwordErrMsg = ''
|
|
|
|
|
+ } else if (reg2.test(flg)) {
|
|
|
|
|
+ this.passwordChecked = true
|
|
|
|
|
+ this.passwordErrMsg = ''
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.passwordErrMsg = '密码强度弱'
|
|
|
|
|
+ this.passwordChecked = false
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.passwordErrMsg = '密码须为8-20字符的英文、数字混合'
|
|
|
|
|
+ this.passwordChecked = false
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ checkRegisterPassword (flg) {
|
|
|
|
|
+ if (this.isHasRegister) {
|
|
|
|
|
+ if (!flg && flg === '') {
|
|
|
|
|
+ this.phoneIsRegisterTip = '请输入密码'
|
|
|
|
|
+ this.passwordChecked = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.passwordChecked = true
|
|
|
|
|
+ this.phoneIsRegisterTip = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (!flg && flg === '') {
|
|
|
|
|
+ this.phoneIsRegisterTip = '请输入密码'
|
|
|
|
|
+ this.passwordChecked = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (flg.length <= 20 && flg.length >= 8) {
|
|
|
|
|
+ let reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
|
|
|
|
|
+ let reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
|
|
|
|
|
+ if (reg1.test(flg)) {
|
|
|
|
|
+ this.passwordChecked = true
|
|
|
|
|
+ } else if (reg2.test(flg)) {
|
|
|
|
|
+ this.passwordChecked = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.phoneIsRegisterTip = '密码须为8-20字符的英文、数字混合'
|
|
|
|
|
+ this.passwordChecked = false
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.phoneIsRegisterTip = '密码须为8-20字符的英文、数字混合'
|
|
|
|
|
+ this.passwordChecked = false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.enterprise.confirm && this.enterprise.confirm !== '') {
|
|
|
|
|
+ if (flg !== this.enterprise.confirm) {
|
|
|
|
|
+ this.phoneIsRegisterTip = '两次输入密码不一致!'
|
|
|
|
|
+ this.passwordConfirmChecked = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.passwordConfirmChecked = true
|
|
|
|
|
+ this.phoneIsRegisterTip = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ checkConfirm (flg) {
|
|
|
|
|
+ if (this.isHasRegister) {
|
|
|
|
|
+ this.passwordConfirmChecked = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (!flg && flg === '') {
|
|
|
|
|
+ this.confirmErrMsg = '请再次输入密码'
|
|
|
|
|
+ this.passwordConfirmChecked = false
|
|
|
|
|
+ } else if (flg !== this.enterprise.password) {
|
|
|
|
|
+ this.confirmErrMsg = '两次输入密码不一致!'
|
|
|
|
|
+ this.passwordConfirmChecked = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.passwordConfirmChecked = true
|
|
|
|
|
+ this.confirmErrMsg = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ checkEmail (flg) {
|
|
|
|
|
+ if (this.isHasEmail) {
|
|
|
|
|
+ this.emailChecked = true
|
|
|
|
|
+ this.emailErrMsg = ''
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (flg) {
|
|
|
|
|
+ let reg = /^([\w-])+(\.\w+)*@([\w-])+((\.\w{2,3}){1,3})$/
|
|
|
|
|
+ if (!reg.test(flg)) {
|
|
|
|
|
+ this.emailErrMsg = '请输入正确的邮箱地址格式'
|
|
|
|
|
+ this.emailChecked = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$http.get(`${this.address}/api/user/checkEmail`, {params: {email: this.enterprise.email}})
|
|
|
|
|
+ .then(response => {
|
|
|
|
|
+ if (response.data.hasRegister) {
|
|
|
|
|
+ this.emailChecked = false
|
|
|
|
|
+ this.emailErrMsg = '该邮箱已被注册'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.emailChecked = true
|
|
|
|
|
+ this.emailErrMsg = ''
|
|
|
|
|
+ return Promise.reject(response.data)
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.$message.error(err.errMsg)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.emailChecked = true
|
|
|
|
|
+ this.emailErrMsg = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ sureRegister () {
|
|
|
|
|
+ if (!this.isHasRegister) {
|
|
|
|
|
+ if (this.spaceNameChecked && this.businessCodeChecked && this.vipNameChecked && this.passwordChecked && this.passwordConfirmChecked && this.emailChecked && this.isReads) {
|
|
|
|
|
+ this.submitRegister()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (!this.enterprise.spaceName) {
|
|
|
|
|
+ this.$message.error('企业名不能为空')
|
|
|
|
|
+ } else if (!this.spaceNameChecked) {
|
|
|
|
|
+ this.$message.error('企业名称输入有误,请按提示重新输入')
|
|
|
|
|
+ } else if (!this.enterprise.businessCode) {
|
|
|
|
|
+ this.$message.error('营业执照号不能为空')
|
|
|
|
|
+ } else if (!this.businessCodeChecked) {
|
|
|
|
|
+ this.$message.error('营业执照号输入有误,请按提示重新输入')
|
|
|
|
|
+ } else if (!this.enterprise.vipName) {
|
|
|
|
|
+ this.$message.error('管理员姓名不能为空')
|
|
|
|
|
+ } else if (!this.vipNameChecked) {
|
|
|
|
|
+ this.$message.error('管理员姓名输入有误,请按提示重新输入')
|
|
|
|
|
+ } else if (!this.enterprise.password) {
|
|
|
|
|
+ this.$message.error('密码不能为空')
|
|
|
|
|
+ } else if (!this.passwordChecked) {
|
|
|
|
|
+ this.$message.error('密码输入有误,请按提示重新输入')
|
|
|
|
|
+ } else if (!this.enterprise.confirm) {
|
|
|
|
|
+ this.$message.error('请再次输入密码')
|
|
|
|
|
+ } else if (this.enterprise.password !== this.enterprise.confirm) {
|
|
|
|
|
+ this.$message.error('请确认两次填写密码是否一致')
|
|
|
|
|
+ } else if (this.enterprise.email && !this.emailChecked) {
|
|
|
|
|
+ this.$message.error('邮箱输入有误,请按提示重新输入')
|
|
|
|
|
+ } else if (!this.isReads) {
|
|
|
|
|
+ this.$message.error('您对阅读条款未做勾选')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (this.isHasEmail) {
|
|
|
|
|
+ if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.isReads) {
|
|
|
|
|
+ this.submitRegister()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (!this.enterprise.spaceName) {
|
|
|
|
|
+ this.$message.error('企业名不能为空')
|
|
|
|
|
+ } else if (!this.spaceNameChecked) {
|
|
|
|
|
+ this.$message.error('企业名称输入有误,请按提示重新输入')
|
|
|
|
|
+ } else if (!this.enterprise.businessCode) {
|
|
|
|
|
+ this.$message.error('营业执照号不能为空')
|
|
|
|
|
+ } else if (!this.businessCodeChecked) {
|
|
|
|
|
+ this.$message.error('营业执照号输入有误,请按提示重新输入')
|
|
|
|
|
+ } else if (!this.enterprise.password) {
|
|
|
|
|
+ this.$message.error('密码不能为空')
|
|
|
|
|
+ } else if (!this.isReads) {
|
|
|
|
|
+ this.$message.error('您对阅读条款未做勾选')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.emailChecked && this.isReads) {
|
|
|
|
|
+ this.submitRegister()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (!this.enterprise.spaceName) {
|
|
|
|
|
+ this.$message.error('企业名不能为空')
|
|
|
|
|
+ } else if (!this.spaceNameChecked) {
|
|
|
|
|
+ this.$message.error('企业名称输入有误,请按提示重新输入')
|
|
|
|
|
+ } else if (!this.enterprise.businessCode) {
|
|
|
|
|
+ this.$message.error('营业执照号不能为空')
|
|
|
|
|
+ } else if (!this.businessCodeChecked) {
|
|
|
|
|
+ this.$message.error('营业执照号输入有误,请按提示重新输入')
|
|
|
|
|
+ } else if (!this.enterprise.password) {
|
|
|
|
|
+ this.$message.error('密码不能为空')
|
|
|
|
|
+ } else if (this.enterprise.email && !this.emailChecked) {
|
|
|
|
|
+ this.$message.error('邮箱输入有误,请按提示重新输入')
|
|
|
|
|
+ } else if (!this.isReads) {
|
|
|
|
|
+ this.$message.error('您对阅读条款未做勾选')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ submitRegister () {
|
|
|
|
|
+ this.showLoading = true
|
|
|
|
|
+ let param = new FormData()
|
|
|
|
|
+ param.append('spaceName', this.enterprise.spaceName)
|
|
|
|
|
+ param.append('businessCode', this.enterprise.businessCode)
|
|
|
|
|
+ param.append('vipName', this.enterprise.vipName || '')
|
|
|
|
|
+ param.append('password', this.enterprise.password)
|
|
|
|
|
+ param.append('email', this.enterprise.email || '')
|
|
|
|
|
+ param.append('appId', 'mall')
|
|
|
|
|
+ param.append('returnUrl', window.location.origin)
|
|
|
|
|
+ param.append('t', '')
|
|
|
|
|
+ let config = {
|
|
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'}
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$http.post(`${this.address}/sso/userspace/register`, param, config)
|
|
|
|
|
+ .then(response => {
|
|
|
|
|
+ this.showLoading = false
|
|
|
|
|
+ if (response.data.success) {
|
|
|
|
|
+ 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.showLoading = true
|
|
|
|
|
+ response.data.content.currentUrl = window.location.hash + '/newLogin/other'
|
|
|
|
|
+ this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
|
|
|
|
|
+ name: 'successCallback',
|
|
|
|
|
+ timeout: 3000
|
|
|
|
|
+ }, (err, data) => {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ this.$message.error('注册成功,返回首页完成登录')
|
|
|
|
|
+ this.showLoading = false
|
|
|
|
|
+ throw err
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.loginOther(response, params)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Promise.reject(response.data)
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.showLoading = 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 {
|
|
|
|
|
+ console.log(url, 'url')
|
|
|
|
|
+ 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) {
|
|
|
|
|
+ if (response.data.content.currentUrl !== response.data.content.loginUrls[i]) {
|
|
|
|
|
+ promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ let returnUrl = decodeURIComponent(window.location.origin)
|
|
|
|
|
+ Promise.all(promises).then(() => {
|
|
|
|
|
+ crossAfter(returnUrl, timeout)
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ crossAfter(returnUrl, timeout)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -525,9 +815,9 @@
|
|
|
input.code{
|
|
input.code{
|
|
|
width: 208px;
|
|
width: 208px;
|
|
|
}
|
|
}
|
|
|
- input.err{
|
|
|
|
|
- border-color: #f56c6c;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /*input.err{*/
|
|
|
|
|
+ /*border-color: #f56c6c;*/
|
|
|
|
|
+ /*}*/
|
|
|
.code-btn{
|
|
.code-btn{
|
|
|
float: left;
|
|
float: left;
|
|
|
margin-left: 10px;
|
|
margin-left: 10px;
|
|
@@ -586,6 +876,7 @@
|
|
|
color: #3d00ff;
|
|
color: #3d00ff;
|
|
|
background-color: #ffffff;
|
|
background-color: #ffffff;
|
|
|
border-radius: 5px;
|
|
border-radius: 5px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
}
|
|
|
&:first-child {
|
|
&:first-child {
|
|
|
margin-bottom: 14px;
|
|
margin-bottom: 14px;
|