登录等修复

dev_2022-04-07
yujialong 3 years ago
parent 3e56616c63
commit 49f72f6cdd
  1. 2
      src/layouts/header/index.vue
  2. 77
      src/pages/account/login/index.vue
  3. 2
      src/pages/setting/person/info.vue
  4. 9
      src/pages/user/list/index.vue
  5. 2
      src/setting.js

@ -167,7 +167,7 @@ export default {
},
//
getLogStatus() {
this.$get(this.api.logNotification).then(({ notification }) => {
this.token && this.$get(this.api.logNotification).then(({ notification }) => {
this.SET_LOG() // true
if (notification) {
this.logVisible = true // true

@ -15,7 +15,7 @@
<el-option v-for="(item, i) in schoolList" :key="i" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="workNumber">
<el-form-item class="flex-1" prop="workNumber">
<label class="label account"></label>
<el-input v-model.trim="form.workNumber" :placeholder="'请输入学号/工号'" @keyup.enter.native="submit"></el-input>
</el-form-item>
@ -32,9 +32,9 @@
</el-form-item>
<el-form-item prop="code">
<label class="label code"></label>
<div class="flex">
<div class="ver-code">
<el-input v-model="form.code" placeholder="请输入验证码" maxlength="6" @keyup.enter.native="submit"></el-input>
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }}
<el-button type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }}
</el-button>
</div>
</el-form-item>
@ -71,14 +71,14 @@
<el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" width="576px">
<p class="tips">依据国家政策法规需绑定手机号进行网络实名才可登录使用本平台</p>
<el-form ref="form" label-width="60px">
<el-form label-width="60px">
<el-form-item label="手机号">
<el-input style="width: 394px;" placeholder="请输入手机号" v-model="phone" maxlength="11" @change="phoneChange"></el-input>
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11" @change="phoneChange"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div class="flex">
<div class="ver-code">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{phoneBtnText}}</el-button>
<el-button style="top: 1px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{phoneBtnText}}</el-button>
</div>
</el-form-item>
</el-form>
@ -96,6 +96,24 @@
</li>
</ul>
</el-dialog>
<el-dialog :visible.sync="infoVisible" :close-on-click-modal="false" custom-class="info-dia" width="400px">
<div class="info-header">
<i class="el-icon-warning"></i>
提示
</div>
<div class="info-wrap">
<p class="tips">该手机号已与以下用户绑定</p>
<ul class="users">
<li v-for="(user, i) in infos" :key="i">
<span>{{ user.userName }}{{ user.schoolName }}</span>
</li>
</ul>
<div class="info-footer">
<el-button size="small" type="primary" @click="bindPhone">是本人继续绑定</el-button>
<el-button class="unbind" size="small" @click="unbindPhone">不是本人解绑以上用户并绑定新用户</el-button>
</div>
</div>
</el-dialog>
<div class="footer">
<div class="copyright">
@ -163,7 +181,9 @@ export default {
userVisible: false,
users: [],
accountIds: [],
binding: ''
binding: '',
infoVisible: false,
infos: []
};
},
components: {vHead,vFooter},
@ -332,27 +352,30 @@ export default {
this.phoneCountdownLogin()
}).catch(res => {})
},
//
bindPhone() {
this.infoVisible = false
this.binding = true
this.sendPhoneCode(1)
},
//
unbindPhone() {
this.infoVisible = false
this.binding = false
this.sendPhoneCode(0)
},
//
phoneChange() {
this.$post(`${this.api.getOtherAccountByPhone}?phone=${this.phone}&platform=${Setting.platformId}`).then(({ userAccounts }) => {
const list = userAccounts
if (list) {
const msg = []
list.map(e => {
msg.push(`${e.userName}${e.schoolName},学号${e.workNumber}`)
const { userName } = e
if (userName.length > 1) e.userName = userName[0] + '*' + userName.substring(2)
})
this.infos = list
this.accountIds = list.map(e => e.id)
this.$confirm(`该手机号已与${msg.join(';')}的用户绑定,是否为本人?选择否,则解绑以上用户信息,并授权手机号绑定新用户信息。`, '提示', {
type: 'warning',
confirmButtonText: '是',
cancelButtonText: '否'
}).then(() => {
this.binding = true
this.sendPhoneCode(1)
}).catch(() => {
this.binding = false
this.sendPhoneCode(0)
})
this.infoVisible = true
} else {
this.binding = true
}
@ -424,6 +447,7 @@ export default {
const { phone, phoneCode } = this
if (!this.verifyPhone(phone)) return false
if (!phoneCode) return util.warningMsg('请输入验证码')
const { workNumber, schoolId } = this.form
if (this.binding) {
this.$post(this.api.bindPhoneOrEmail, {
phone,
@ -431,7 +455,8 @@ export default {
code: phoneCode,
opener: this.phoneOpener,
platform: Setting.platformId,
account: this.form.workNumber
account: workNumber,
schoolId
}).then(({ token }) => {
this.token = token
this.setLogin()
@ -449,6 +474,14 @@ export default {
min-height: 100%;
background-color: #F3F6FA;
}
.ver-code {
position: relative;
.el-button {
position: absolute;
top: 10px;
right: 10px;
}
}
.login{
min-height: calc(100vh - 70px);
padding-top: calc((100vh - 611px) / 2);

@ -176,7 +176,7 @@
<el-dialog :title="form.phone ? '更换手机号' : '绑定手机号'" :visible.sync="phoneVisible" :close-on-click-modal="false" @close="closePhone" width="30%">
<el-form ref="form" :model="form" label-width="60px">
<el-form-item label="手机号">
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
<el-input style="width: 394px;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div class="flex">

@ -121,7 +121,7 @@
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" @close="closeImport" :close-on-click-modal="false">
<div class="upload-wrap" :class="{lg: uploadFaild}">
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button>
<el-upload ref="import" accept=".xls,.xlsx" :headers="{token}" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.uploadFile" :file-list="uploadList" :data="{schoolId: this.schoolId}" name="file" :auto-upload="false">
<el-upload ref="import" accept=".xls,.xlsx" :headers="{token}" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.uploadFile" :file-list="uploadList" :data="{schoolId: this.schoolId}" name="file">
<el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button>
</el-upload>
<div class="link" v-if="uploadFaild">
@ -545,10 +545,6 @@ export default {
util.errorMsg('导入失败,请下载失败模板查看原因')
this.importToken = res.data.token
this.uploadFaild = true
}else{
util.successMsg('上传成功')
this.importVisible = false
this.initData()
}
}else{
res.data.message ? util.errorMsg(res.data.message) : util.errorMsg('上传失败,请检查数据')
@ -572,7 +568,8 @@ export default {
this.uploadList = []
},
confirmImport(){
this.$refs.import.submit()
this.importVisible = false
this.initData()
}
}
};

@ -25,7 +25,7 @@ const Setting = {
* 正式http://www.dataforward.cn:9000
* */
// apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://39.108.250.202:9000',
apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000/' : `${location.origin}:9000/`,
apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000/' : `${location.origin}:9000/`,
// 加密货币接口地址
cryptoBaseURL: `http://159.138.53.111/`,
// 接口请求返回错误时,弹窗的持续时间,单位:秒

Loading…
Cancel
Save