修改登录页
This commit is contained in:
parent
ad0f0e5cfc
commit
a1f6029dc5
2
.env
2
.env
|
|
@ -4,7 +4,7 @@ VUE_APP_TOKEN_KEY=token
|
||||||
#前端项目路径地址
|
#前端项目路径地址
|
||||||
VUE_APP_PUBLICPATH=
|
VUE_APP_PUBLICPATH=
|
||||||
|
|
||||||
VUE_APP_SYSTEM_TITLE=广州市市场监督管理局信用监管综合系统
|
VUE_APP_SYSTEM_TITLE=内蒙古自治区市场监督管理局信用监管综合系统
|
||||||
VUE_APP_SYSTEM_TITLE_LOGIN=信用监管综合系统
|
VUE_APP_SYSTEM_TITLE_LOGIN=信用监管综合系统
|
||||||
|
|
||||||
# 信创门户cas地址
|
# 信创门户cas地址
|
||||||
|
|
|
||||||
|
|
@ -64,15 +64,16 @@ export function casLogin(params) {
|
||||||
*/
|
*/
|
||||||
export function logManage(params) {
|
export function logManage(params) {
|
||||||
return request({
|
return request({
|
||||||
url: process.env.VUE_APP_AICEPS_URL + '/loginManageController/loginManage.do',
|
url: '/gz-aiceps-manage/loginManageController/loginManage.do',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCode(phone) {
|
export function getCode(phone, captcha) {
|
||||||
const params = new FormData()
|
const params = new FormData()
|
||||||
params.append('phone', phone)
|
params.append('phone', phone)
|
||||||
|
params.append('captcha', captcha)
|
||||||
return request({
|
return request({
|
||||||
url: '/aiccs-api/user/getCode',
|
url: '/aiccs-api/user/getCode',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
|
@ -80,10 +81,11 @@ export function getCode(phone) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function loginByCode(phone, code) {
|
export function loginByCode(phone, code, captchadl) {
|
||||||
const params = new FormData()
|
const params = new FormData()
|
||||||
params.append('phone', phone)
|
params.append('phone', phone)
|
||||||
params.append('code', code)
|
params.append('code', code)
|
||||||
|
params.append('captchadl', captchadl)
|
||||||
return request({
|
return request({
|
||||||
url: '/aiccs-api/user/loginByCode',
|
url: '/aiccs-api/user/loginByCode',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
|
@ -91,6 +93,18 @@ export function loginByCode(phone, code) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function loginByPwd(phone, code, captchadl) {
|
||||||
|
const params = new FormData()
|
||||||
|
params.append('phone', phone)
|
||||||
|
params.append('code', code)
|
||||||
|
params.append('captchadl', captchadl)
|
||||||
|
return request({
|
||||||
|
url: '/aiccs-api/user/loginByPwd',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统一门户单点登录 ticket
|
* 统一门户单点登录 ticket
|
||||||
*/
|
*/
|
||||||
|
|
@ -102,6 +116,17 @@ export function casLogin_Unite(params) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一门户单点登录 ticket
|
||||||
|
*/
|
||||||
|
export function casLogin_LangChao(params) {
|
||||||
|
return request({
|
||||||
|
url: '/aiccs-api/user/casLogin_LangChao',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统一门户单点登录 ticket
|
* 统一门户单点登录 ticket
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<navbar />
|
<navbar />
|
||||||
</div>
|
</div>
|
||||||
<app-main />
|
<app-main />
|
||||||
<footer>© {{ new Date().getFullYear() }} 广州市市场监督管理局 | 技术支持:广东众望通科技股份有限公司
|
<footer>© {{ new Date().getFullYear() }} 内蒙古自治区市场监督管理局 | 技术支持:广东众望通科技股份有限公司
|
||||||
<span v-if="currentUpgrade" style="cursor:pointer" @click="toVersion">
|
<span v-if="currentUpgrade" style="cursor:pointer" @click="toVersion">
|
||||||
版本号:v{{ currentUpgrade.version }}
|
版本号:v{{ currentUpgrade.version }}
|
||||||
<span v-if="logNew" class="back">new</span>
|
<span v-if="logNew" class="back">new</span>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<span class="feet" />
|
<span class="feet" />
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
© {{ new Date().getFullYear() }} 广州市市场监督管理局 | 技术支持:广东众望通科技股份有限公司
|
© {{ new Date().getFullYear() }} 内蒙古自治区市场监督管理局 | 技术支持:广东众望通科技股份有限公司
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
<div>
|
<div>
|
||||||
<div class="logo_content">
|
<div class="logo_content">
|
||||||
<div class="sysName">广州市市场监督管理局</div>
|
<div class="sysName">内蒙古自治区市场监督管理局</div>
|
||||||
<img src="../../assets/images/login_bg.png" alt="" srcset="">
|
<img src="../../assets/images/login_bg.png" alt="" srcset="">
|
||||||
<div class="copyRight">
|
<div class="copyRight">
|
||||||
© 2021 广州市市场监督管理局 | 技术支持:广东众望通科技股份有限公司
|
© {{ new Date().getFullYear() }} 内蒙古自治区市场监督管理局 | 技术支持:广东众望通科技股份有限公司
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form">
|
<div class="form">
|
||||||
|
|
@ -39,6 +39,28 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- <el-form-item prop="captcha">-->
|
||||||
|
<!-- <el-col span="12">-->
|
||||||
|
<!-- <span class="svg-container">-->
|
||||||
|
<!-- <svg-icon icon-class="example" />-->
|
||||||
|
<!-- </span>-->
|
||||||
|
<!-- <el-input-->
|
||||||
|
<!-- ref="password"-->
|
||||||
|
<!-- v-model="loginForm.captcha"-->
|
||||||
|
<!-- placeholder="短信图形验证码"-->
|
||||||
|
<!-- name="password"-->
|
||||||
|
<!-- tabindex="2"-->
|
||||||
|
<!-- auto-complete="on"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<!-- <el-col span="7">-->
|
||||||
|
<!-- <el-image style="position: relative; top: 10px;" :src="captchaSrc" fit="cover"></el-image>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<!-- <el-col span="5">-->
|
||||||
|
<!-- <el-button style="margin-top: 8px" type="primary" plain icon="el-icon-refresh" @click="refreshCaptcha">刷新</el-button>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-col span="17">
|
<el-col span="17">
|
||||||
<span class="svg-container">
|
<span class="svg-container">
|
||||||
|
|
@ -49,42 +71,44 @@
|
||||||
ref="password"
|
ref="password"
|
||||||
v-model="loginForm.password"
|
v-model="loginForm.password"
|
||||||
:type="passwordType"
|
:type="passwordType"
|
||||||
placeholder="验证码"
|
placeholder="密码"
|
||||||
name="password"
|
name="password"
|
||||||
tabindex="2"
|
tabindex="2"
|
||||||
auto-complete="on"
|
auto-complete="on"
|
||||||
@keyup.enter.native="handleLogin"
|
@keyup.enter.native="handleLogin"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col span="7">
|
<!-- <el-col span="7">-->
|
||||||
<el-button
|
<!-- <el-button-->
|
||||||
style="margin-top: 5px"
|
<!-- style="margin-top: 5px"-->
|
||||||
:loading="codeloading"
|
<!-- :loading="codeloading"-->
|
||||||
type="primary"
|
<!-- type="primary"-->
|
||||||
plain
|
<!-- plain-->
|
||||||
@click="getcode"
|
<!-- @click="getCode"-->
|
||||||
>获取短信验证码</el-button>
|
<!-- >密码</el-button>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
|
</el-form-item>
|
||||||
<!-- <span class="show-pwd" @click="showPwd">-->
|
<el-form-item prop="captchadl">
|
||||||
<!-- <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />-->
|
<el-col span="12">
|
||||||
<!-- </span>-->
|
<span class="svg-container">
|
||||||
|
<svg-icon icon-class="example" />
|
||||||
|
</span>
|
||||||
|
<el-input
|
||||||
|
ref="password"
|
||||||
|
v-model="loginForm.captchadl"
|
||||||
|
placeholder="登录图形验证码"
|
||||||
|
name="password"
|
||||||
|
tabindex="2"
|
||||||
|
auto-complete="on"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="7">
|
||||||
|
<el-image style="position: relative; top: 10px;" :src="captchaSrcdl" fit="cover"></el-image>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="5">
|
||||||
|
<el-button style="margin-top: 8px" type="primary" plain icon="el-icon-refresh" @click="refreshCaptchadl">刷新</el-button>
|
||||||
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item prop="code">-->
|
|
||||||
<!-- <span class="svg-container">-->
|
|
||||||
<!-- <svg-icon icon-class="code" />-->
|
|
||||||
<!-- </span>-->
|
|
||||||
<!-- <el-input-->
|
|
||||||
<!-- ref="vcode"-->
|
|
||||||
<!-- v-model="loginForm.vcode"-->
|
|
||||||
<!-- :type="passwordType"-->
|
|
||||||
<!-- placeholder="验证码"-->
|
|
||||||
<!-- name="vcode"-->
|
|
||||||
<!-- tabindex="2"-->
|
|
||||||
<!-- auto-complete="on"-->
|
|
||||||
<!-- @keyup.enter.native="handleLogin"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-button
|
<el-button
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
size="medium"
|
size="medium"
|
||||||
|
|
@ -103,9 +127,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Cookie from 'js-cookie'
|
import Cookie from 'js-cookie'
|
||||||
import request from '@/utils/request'
|
import { logManage, getCode, isHaveUser, loginByPwd } from '@/api/user.js'
|
||||||
// import { asyncRoutes } from '../../router/index'
|
|
||||||
import { logManage, getCode, loginByCode, isHaveUser } from '@/api/user.js'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -114,14 +136,22 @@ export default {
|
||||||
systemTitleLogin: process.env.VUE_APP_SYSTEM_TITLE_LOGIN,
|
systemTitleLogin: process.env.VUE_APP_SYSTEM_TITLE_LOGIN,
|
||||||
loginForm: {
|
loginForm: {
|
||||||
username,
|
username,
|
||||||
password
|
password,
|
||||||
|
captcha: '',
|
||||||
|
captchadl: ''
|
||||||
},
|
},
|
||||||
loginRules: {
|
loginRules: {
|
||||||
username: [
|
username: [
|
||||||
{ required: true, trigger: 'blur', message: '用户名不能为空' }
|
{ required: true, trigger: 'blur', message: '用户名不能为空' }
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{ required: true, trigger: 'blur', message: '验证码不能为空' }
|
{ required: true, trigger: 'blur', message: '短信验证码不能为空' }
|
||||||
|
],
|
||||||
|
captcha: [
|
||||||
|
{ required: true, trigger: 'blur', message: '图形验证码不能为空' }
|
||||||
|
],
|
||||||
|
captchadl: [
|
||||||
|
{ required: true, trigger: 'blur', message: '登录图形验证码不能为空' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
@ -130,7 +160,9 @@ export default {
|
||||||
reload: false,
|
reload: false,
|
||||||
auditUserName: '',
|
auditUserName: '',
|
||||||
auditPassWordHid: '',
|
auditPassWordHid: '',
|
||||||
codeloading: false
|
codeloading: false,
|
||||||
|
captchaSrc: '',
|
||||||
|
captchaSrcdl: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -158,7 +190,7 @@ export default {
|
||||||
const { code, msg } = response
|
const { code, msg } = response
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
this.loginForm.username = jiem
|
this.loginForm.username = jiem
|
||||||
this.getcode()
|
this.getCode()
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(msg)
|
this.$message.warning(msg)
|
||||||
}
|
}
|
||||||
|
|
@ -168,29 +200,30 @@ export default {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// console.log(jiam)
|
this.refreshCaptcha()
|
||||||
|
this.refreshCaptchadl()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showPwd() {
|
refreshCaptcha() {
|
||||||
if (this.passwordType === 'password') {
|
this.captchaSrc = '/aiccs-api/user/captcha' + '?' + new Date().getTime()
|
||||||
this.passwordType = ''
|
},
|
||||||
} else {
|
refreshCaptchadl() {
|
||||||
this.passwordType = 'password'
|
this.captchaSrcdl = '/aiccs-api/user/captchadl' + '?' + new Date().getTime()
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.password.focus()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
isEmpty(str) {
|
isEmpty(str) {
|
||||||
return !str || str.length === 0 || str === null || str === 'null'
|
return !str || str.length === 0 || str === null || str === 'null'
|
||||||
},
|
},
|
||||||
getcode() {
|
getCode() {
|
||||||
if (this.isEmpty(this.loginForm.username)) {
|
if (this.isEmpty(this.loginForm.username)) {
|
||||||
this.codeloading = false
|
this.codeloading = false
|
||||||
return this.$message.warning('账号不能为空')
|
return this.$message.warning('账号不能为空')
|
||||||
}
|
}
|
||||||
|
if (this.isEmpty(this.loginForm.captcha)) {
|
||||||
|
this.codeloading = false
|
||||||
|
return this.$message.warning('图形验证码不能为空')
|
||||||
|
}
|
||||||
this.codeloading = true
|
this.codeloading = true
|
||||||
getCode(this.loginForm.username).then((response) => {
|
getCode(this.loginForm.username, this.loginForm.captcha).then((response) => {
|
||||||
const { code, msg } = response
|
const { code, msg } = response
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
this.$message.success('验证码已发送')
|
this.$message.success('验证码已发送')
|
||||||
|
|
@ -198,20 +231,21 @@ export default {
|
||||||
this.$message.warning(msg)
|
this.$message.warning(msg)
|
||||||
}
|
}
|
||||||
this.codeloading = false
|
this.codeloading = false
|
||||||
|
}).finally(() => {
|
||||||
|
this.refreshCaptcha()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleLogin() {
|
handleLogin() {
|
||||||
this.$refs.loginForm.validate(valid => {
|
this.$refs.loginForm.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
loginByCode(this.loginForm.username, this.loginForm.password)
|
loginByPwd(this.loginForm.username, this.loginForm.password, this.loginForm.captchadl)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
const { code, msg } = response
|
const { code, msg } = response
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
this.loginManage()
|
this.loginManage()
|
||||||
this.loginManage()
|
this.loginManage()
|
||||||
Cookie.set('loginInfo', this.loginForm, { expires: 30 })
|
Cookie.set('loginInfo', this.loginForm, { expires: 30 })
|
||||||
// this.$router.push({ path: this.redirect || '/' })
|
|
||||||
if (this.loginForm.password === '123456') {
|
if (this.loginForm.password === '123456') {
|
||||||
this.$router.push({ path: '/redirect', query: { queryOlderP: '1' }})
|
this.$router.push({ path: '/redirect', query: { queryOlderP: '1' }})
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -219,14 +253,20 @@ export default {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(msg)
|
this.$message.warning(msg)
|
||||||
|
this.refreshCaptcha()
|
||||||
|
this.refreshCaptchadl()
|
||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
this.refreshCaptcha()
|
||||||
|
this.refreshCaptchadl()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
console.log('error submit!!')
|
console.log('error submit!!')
|
||||||
|
this.refreshCaptcha()
|
||||||
|
this.refreshCaptchadl()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-footer style="height: 30px; line-height: 30px" class="el-footer">
|
<el-footer style="height: 30px; line-height: 30px" class="el-footer">
|
||||||
<div>
|
<div>
|
||||||
© {{ new Date().getFullYear() }} 广州市市场监督管理局 | 技术支持:广东众望通科技股份有限公司
|
© {{ new Date().getFullYear() }} 内蒙古自治区市场监督管理局 | 技术支持:广东众望通科技股份有限公司
|
||||||
</div>
|
</div>
|
||||||
</el-footer>
|
</el-footer>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue