Jeecg Boot 2.2.1 版本发布,低代码平台

This commit is contained in:
zhangdaiscott
2020-07-11 12:54:57 +08:00
parent 1c8911af2c
commit 8dc0125c2a
191 changed files with 28087 additions and 26880 deletions

View File

@ -9,16 +9,16 @@
<a-form-item>
<a-input
size="large"
v-decorator="['username',{initialValue:'admin', rules: validatorRules.username.rules}]"
v-decorator="['username',validatorRules.username,{ validator: this.handleUsernameOrEmail }]"
type="text"
placeholder="请输入帐户名 / admin">
placeholder="请输入帐户名 / jeecg">
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
</a-input>
</a-form-item>
<a-form-item>
<a-input
v-decorator="['password',{initialValue:'123456', rules: validatorRules.password.rules}]"
v-decorator="['password',validatorRules.password]"
size="large"
type="password"
autocomplete="false"
@ -118,46 +118,7 @@
:visible="stepCaptchaVisible"
@success="stepCaptchaSuccess"
@cancel="stepCaptchaCancel"></two-step-captcha>
<a-modal
title="登录部门选择"
:width="450"
:visible="departVisible"
:closable="false"
:maskClosable="false">
<template slot="footer">
<a-button type="primary" @click="departOk">确认</a-button>
</template>
<a-form>
<a-form-item
:labelCol="{span:4}"
:wrapperCol="{span:20}"
style="margin-bottom:10px"
:validate-status="validate_status">
<a-tooltip placement="topLeft" >
<template slot="title">
<span>您隶属于多部门,请选择登录部门</span>
</template>
<a-avatar style="backgroundColor:#87d068" icon="gold" />
</a-tooltip>
<a-select @change="departChange" :class="{'valid-error':validate_status=='error'}" placeholder="请选择登录部门" style="margin-left:10px;width: 80%">
<a-icon slot="suffixIcon" type="gold" />
<a-select-option
v-for="d in departList"
:key="d.id"
:value="d.orgCode">
{{ d.departName }}
</a-select-option>
</a-select>
</a-form-item>
</a-form>
</a-modal>
<login-select-modal ref="loginSelect" @success="loginSelectOk"></login-select-modal>
</div>
</template>
@ -173,10 +134,12 @@
import { encryption , getEncryptedString } from '@/utils/encryption/aesEncrypt'
import store from '@/store/'
import { USER_INFO } from "@/store/mutation-types"
import LoginSelectModal from './LoginSelectModal.vue'
export default {
components: {
TwoStepCaptcha
TwoStepCaptcha,
LoginSelectModal
},
data () {
return {
@ -205,12 +168,7 @@
verifiedCode:"",
inputCodeContent:"",
inputCodeNull:true,
departList:[],
departVisible:false,
departSelected:"",
currentUsername:"",
validate_status:"",
currdatetime:'',
randCodeImage:'',
requestCodeSuccess:false
@ -281,7 +239,7 @@
loginParams.checkKey = that.currdatetime
console.log("登录参数",loginParams)
that.Login(loginParams).then((res) => {
this.departConfirm(res)
this.$refs.loginSelect.show(res.result)
}).catch((err) => {
that.requestFailed(err);
});
@ -300,7 +258,7 @@
loginParams.remember_me = values.rememberMe
that.PhoneLogin(loginParams).then((res) => {
console.log(res.result);
this.departConfirm(res)
this.$refs.loginSelect.show(res.result)
}).catch((err) => {
that.requestFailed(err);
})
@ -376,7 +334,9 @@
// update-begin- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
// this.loginBtn = false
// update-end- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
this.$router.push({ path: "/dashboard/analysis" })
this.$router.push({ path: "/dashboard/analysis" }).catch(()=>{
console.log('登录跳转首页出错,这个错误从哪里来的')
})
this.$notification.success({
message: '欢迎',
description: `${timeFix()},欢迎回来`,
@ -418,64 +378,8 @@
inputCodeChange(e){
this.inputCodeContent = e.target.value
},
departConfirm(res){
if(res.success){
let multi_depart = res.result.multi_depart
//0:无部门 1:一个部门 2:多个部门
if(multi_depart==0){
this.loginSuccess()
this.$notification.warn({
message: '提示',
description: `您尚未归属部门,请确认账号信息`,
duration:3
});
}else if(multi_depart==2){
this.departVisible=true
this.currentUsername=this.form.getFieldValue("username")
this.departList = res.result.departs
}else {
this.loginSuccess()
}
}else{
this.requestFailed(res)
this.Logout();
}
},
departOk(){
if(!this.departSelected){
this.validate_status='error'
return false
}
let obj = {
orgCode:this.departSelected,
username:this.form.getFieldValue("username")
}
putAction("/sys/selectDepart",obj).then(res=>{
if(res.success){
const userInfo = res.result.userInfo;
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000);
store.commit('SET_INFO', userInfo);
//console.log("---切换组织机构---userInfo-------",store.getters.userInfo.orgCode);
this.departClear()
this.loginSuccess()
}else{
this.requestFailed(res)
this.Logout().then(()=>{
this.departClear()
});
}
})
},
departClear(){
this.departList=[]
this.departSelected=""
this.currentUsername=""
this.departVisible=false
this.validate_status=''
},
departChange(value){
this.validate_status='success'
this.departSelected = value
loginSelectOk(){
this.loginSuccess()
},
getRouterData(){
this.$nextTick(() => {