禁用login 获取验证码功能 使页面不需要验证码即可登录
| | |
| | | type="index" |
| | | width="60" |
| | | align="center" |
| | | /> <template v-for="col in columns" :key="col.prop"> |
| | | <el-table-column |
| | | v-bind="col" |
| | | align="center" |
| | | > |
| | | /> |
| | | <template v-for="col in columns" :key="col.prop"> |
| | | <el-table-column v-bind="col" align="center"> |
| | | <template #default="scope"> |
| | | <template v-if="col.slot"> |
| | | <slot |
| | |
| | | :column="scope.column" |
| | | :index="scope.$index" |
| | | ></slot> |
| | | </template> <template v-else> |
| | | </template> |
| | | <template v-else> |
| | | <div |
| | | class="cell-edit" |
| | | @dblclick="handleCellEdit(scope.row, col.prop)" |
| | |
| | | class="cell-text" |
| | | > |
| | | {{ |
| | | formatCellValue(scope.row, scope.column, scope.row[col.prop], col) |
| | | formatCellValue( |
| | | scope.row, |
| | | scope.column, |
| | | scope.row[col.prop], |
| | | col |
| | | ) |
| | | }} |
| | | </span> |
| | | <!-- ç¼è¾ç¶æï¼ä½¿ç¨åå§å¼ï¼ä¸ç»è¿æ ¼å¼å --> |
| | |
| | | // æ ¼å¼ååå
æ ¼å¼ |
| | | const formatCellValue = (row, column, cellValue, col) => { |
| | | // 妿åæèªå®ä¹æ ¼å¼åå¨ï¼ä½¿ç¨èªå®ä¹æ ¼å¼åå¨ |
| | | if (col.formatter && typeof col.formatter === 'function') { |
| | | if (col.formatter && typeof col.formatter === "function") { |
| | | return col.formatter(row, column, cellValue); |
| | | } |
| | | // å¦å使ç¨é»è®¤æ ¼å¼åå¨ |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getCodeImg } from "@/api/login" |
| | | // import { getCodeImg } from "@/api/login" |
| | | import Cookies from "js-cookie" |
| | | import { encrypt, decrypt } from "@/utils/jsencrypt" |
| | | import useUserStore from '@/store/modules/user' |
| | |
| | | }).catch(() => { |
| | | loading.value = false |
| | | // éæ°è·åéªè¯ç |
| | | if (captchaEnabled.value) { |
| | | getCode() |
| | | } |
| | | // if (captchaEnabled.value) { |
| | | // getCode() |
| | | // } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function getCode() { |
| | | getCodeImg().then(res => { |
| | | captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled |
| | | if (captchaEnabled.value) { |
| | | codeUrl.value = "data:image/gif;base64," + res.img |
| | | loginForm.value.uuid = res.uuid |
| | | } |
| | | }) |
| | | } |
| | | // function getCode() { |
| | | // getCodeImg().then(res => { |
| | | // captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled |
| | | // if (captchaEnabled.value) { |
| | | // codeUrl.value = "data:image/gif;base64," + res.img |
| | | // loginForm.value.uuid = res.uuid |
| | | // } |
| | | // }) |
| | | // } |
| | | |
| | | function getCookie() { |
| | | const username = Cookies.get("username") |
| | |
| | | } |
| | | } |
| | | |
| | | getCode() |
| | | // getCode() |
| | | getCookie() |
| | | </script> |
| | | |
| | |
| | | > |
| | | <template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template> |
| | | </el-input> |
| | | <div class="register-code"> |
| | | <!-- <div class="register-code"> |
| | | <img :src="codeUrl" @click="getCode" class="register-code-img"/> |
| | | </div> |
| | | </div> --> |
| | | </el-form-item> |
| | | <el-form-item style="width:100%;"> |
| | | <el-button |
| | |
| | | |
| | | <script setup> |
| | | import { ElMessageBox } from "element-plus" |
| | | import { getCodeImg, register } from "@/api/login" |
| | | // import { getCodeImg, register } from "@/api/login" |
| | | |
| | | const title = import.meta.env.VITE_APP_TITLE |
| | | const router = useRouter() |
| | |
| | | }).catch(() => {}) |
| | | }).catch(() => { |
| | | loading.value = false |
| | | if (captchaEnabled) { |
| | | getCode() |
| | | } |
| | | // if (captchaEnabled) { |
| | | // getCode() |
| | | // } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function getCode() { |
| | | getCodeImg().then(res => { |
| | | captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled |
| | | if (captchaEnabled.value) { |
| | | codeUrl.value = "data:image/gif;base64," + res.img |
| | | registerForm.value.uuid = res.uuid |
| | | } |
| | | }) |
| | | } |
| | | // function getCode() { |
| | | // getCodeImg().then(res => { |
| | | // captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled |
| | | // if (captchaEnabled.value) { |
| | | // codeUrl.value = "data:image/gif;base64," + res.img |
| | | // registerForm.value.uuid = res.uuid |
| | | // } |
| | | // }) |
| | | // } |
| | | |
| | | getCode() |
| | | // getCode() |
| | | </script> |
| | | |
| | | <style lang='scss' scoped> |