管理后台的 uniapp 验证码,增加开关

master
YunaiV 3 years ago
parent 3097192946
commit b6c9f47a0b
  1. 2
      config.js
  2. 17
      pages/login.vue

@ -2,7 +2,7 @@
module.exports = {
// baseUrl: 'http://localhost:8080',
baseUrl: 'http://localhost:48080',
baseApi: 'admin-api',
baseApi: '/admin-api',
// 应用信息
appInfo: {
// 应用名称

@ -39,7 +39,7 @@
},
data() {
return {
captchaEnabled: true,
captchaEnabled: true, // TODO
globalConfig: getApp().globalData.config,
loginForm: {
username: "admin",
@ -66,14 +66,19 @@
} else if (this.loginForm.password === "") {
this.$modal.msgError("请输入您的密码")
} else {
this.$modal.loading("登录中,请耐心等待...")
//
this.$refs.verify.show()
//
if (this.captchaEnabled) {
this.$refs.verify.show()
} else { //
await this.pwdLogin({})
}
}
},
//
async pwdLogin(params) {
this.loginForm.captchaVerification = params.captchaVerification
async pwdLogin(captchaParams) {
this.$modal.loading("登录中,请耐心等待...")
//
this.loginForm.captchaVerification = captchaParams.captchaVerification
this.$store.dispatch('Login', this.loginForm).then(() => {
this.$modal.closeLoading()
this.loginSuccess()

Loading…
Cancel
Save