优化新增用户时默认密码问题
This commit is contained in:
parent
7fb09c5166
commit
3aec63eef9
|
|
@ -1,7 +1,7 @@
|
|||
import { login, logout, getInfo, refreshToken,checkCode,loginByMall } from '@/api/login'
|
||||
import { login, logout, getInfo, refreshToken, checkCode, loginByMall } from '@/api/login'
|
||||
import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth'
|
||||
import { Notification, MessageBox, Message, Loading } from 'element-ui'
|
||||
import { encrypt} from '@/utils/jsencrypt'
|
||||
import { encrypt } from '@/utils/jsencrypt'
|
||||
|
||||
const user = {
|
||||
state: {
|
||||
|
|
@ -44,8 +44,12 @@ const user = {
|
|||
const password = encrypt(userInfo.password)
|
||||
const code = userInfo.code
|
||||
const uuid = userInfo.uuid
|
||||
const textCode = undefined
|
||||
if (userInfo.textCode) {
|
||||
textCode = userInfo.textCode
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password, code, uuid).then(res => {
|
||||
login(username, password, code, uuid, textCode).then(res => {
|
||||
let data = res.data
|
||||
localStorage.setItem('isCode', res.data.code)
|
||||
setToken(data.access_token)
|
||||
|
|
@ -63,13 +67,13 @@ const user = {
|
|||
textLogin({ commit }, userInfo) {
|
||||
console.log(userInfo)
|
||||
let params = {
|
||||
phone:userInfo.phone,
|
||||
code:userInfo.textCode
|
||||
phone: userInfo.phone,
|
||||
code: userInfo.textCode
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
checkCode(params).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
if (res.code == 200) {
|
||||
let data = res.data
|
||||
setToken(data.access_token)
|
||||
commit('SET_TOKEN', data.access_token)
|
||||
|
|
@ -89,14 +93,14 @@ const user = {
|
|||
loginByMall(param).then(res => {
|
||||
console.log(res)
|
||||
let data = res.data
|
||||
if(res.code==200){
|
||||
if (res.code == 200) {
|
||||
// console.log('登录成功1111111')
|
||||
setToken(data.access_token)
|
||||
commit('SET_TOKEN', data.access_token)
|
||||
localStorage.setItem('token', data.access_token)
|
||||
setExpiresIn(data.expires_in)
|
||||
commit('SET_EXPIRES_IN', data.expires_in)
|
||||
}else{
|
||||
} else {
|
||||
// console.log('登录失败22222222')
|
||||
this.$modal.msgError('登录失败');
|
||||
}
|
||||
|
|
@ -131,7 +135,7 @@ const user = {
|
|||
},
|
||||
|
||||
// 刷新token
|
||||
RefreshToken({commit, state}) {
|
||||
RefreshToken({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
refreshToken(state.token).then(res => {
|
||||
setExpiresIn(res.data)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,39 @@
|
|||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 5.29 新增双因子验证 -->
|
||||
<!-- <el-form-item prop="textCode" class="code-container" v-if="loginForm.username === 'admin'">
|
||||
<el-input
|
||||
v-model="phoneLoginParams.textCode"
|
||||
auto-complete="off"
|
||||
placeholder="短信验证码"
|
||||
style="width: 67%"
|
||||
>
|
||||
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
|
||||
</el-input>
|
||||
<div class="login-code">
|
||||
<div
|
||||
class="login-code-img"
|
||||
style="border: 1px solid rgb(220, 223, 230)"
|
||||
v-show="show === 1"
|
||||
@click="getTextCode"
|
||||
>
|
||||
获取验证码
|
||||
</div>
|
||||
<div class="login-code-img" style="border: 1px solid rgb(220, 223, 230)" v-show="show === 2">
|
||||
{{ count }} s
|
||||
</div>
|
||||
<div
|
||||
class="login-code-img"
|
||||
style="border: 1px solid rgb(220, 223, 230)"
|
||||
v-show="show === 3"
|
||||
@click="getTextCode"
|
||||
>
|
||||
重发
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item> -->
|
||||
<el-form-item prop="code" v-if="captchaEnabled" class="code-container">
|
||||
<el-input
|
||||
v-model="loginForm.code"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -46,7 +46,7 @@ module.exports = {
|
|||
// target: `http://10.40.92.8:8080`, //超
|
||||
// target: `http://10.40.92.81:8080`, //韩/
|
||||
// target: `http://10.40.92.74:8080`,//旭/
|
||||
target: `http://10.40.92.136:8080`, //帅
|
||||
target: `http://10.40.92.136:28080`, //帅
|
||||
// target: `http://10.40.92.5:28080`, //福
|
||||
|
||||
//******** 注意事项 ********* */
|
||||
|
|
|
|||
Loading…
Reference in New Issue