feat: 验证码调整,数字验证
This commit is contained in:
parent
e14af524f7
commit
334627804d
26
src/components.d.ts
vendored
26
src/components.d.ts
vendored
@ -5,19 +5,19 @@
|
|||||||
// Read more: https://github.com/vuejs/core/pull/3399
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
export {}
|
export {}
|
||||||
|
|
||||||
declare module 'vue' {
|
declare module "vue" {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
CodeView: typeof import('./components/code-view/index.vue')['default']
|
CodeView: (typeof import("./components/code-view/index.vue"))["default"];
|
||||||
ExternalLinkPage: typeof import('./components/external-link-page/index.vue')['default']
|
ExternalLinkPage: (typeof import("./components/external-link-page/index.vue"))["default"];
|
||||||
FillPage: typeof import('./components/fill-page/index.vue')['default']
|
FillPage: (typeof import("./components/fill-page/index.vue"))["default"];
|
||||||
InternalLinkPage: typeof import('./components/internal-link-page/index.vue')['default']
|
InternalLinkPage: (typeof import("./components/internal-link-page/index.vue"))["default"];
|
||||||
LangProvider: typeof import('./components/lang-provider/index.vue')['default']
|
LangProvider: (typeof import("./components/lang-provider/index.vue"))["default"];
|
||||||
MainTransition: typeof import('./components/main-transition/index.vue')['default']
|
MainTransition: (typeof import("./components/main-transition/index.vue"))["default"];
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: (typeof import("vue-router"))["RouterLink"];
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: (typeof import("vue-router"))["RouterView"];
|
||||||
SelectIcon: typeof import('./components/select-icon/index.vue')['default']
|
SelectIcon: (typeof import("./components/select-icon/index.vue"))["default"];
|
||||||
SvgAndIcon: typeof import('./components/svg-and-icon/index.vue')['default']
|
SvgAndIcon: (typeof import("./components/svg-and-icon/index.vue"))["default"];
|
||||||
SvgIcon: typeof import('./components/svg-icon/index.vue')['default']
|
SvgIcon: (typeof import("./components/svg-icon/index.vue"))["default"];
|
||||||
VerifyCode: typeof import('./components/verify-code/index.vue')['default']
|
VerifyCode: (typeof import("./components/verify-code/index.vue"))["default"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ const props = defineProps({
|
|||||||
identifyCodes: {
|
identifyCodes: {
|
||||||
//验证码从该字段中抽取生成
|
//验证码从该字段中抽取生成
|
||||||
type: String,
|
type: String,
|
||||||
default: "1234567890abcdefghijklmnopqrstuvwxyz"
|
default: "1234567890"
|
||||||
},
|
},
|
||||||
fontSizeMin: {
|
fontSizeMin: {
|
||||||
// 字体最小值
|
// 字体最小值
|
||||||
@ -93,8 +93,8 @@ const drawPic = () => {
|
|||||||
const drawText = (ctx: any, txt: any, i: any) => {
|
const drawText = (ctx: any, txt: any, i: any) => {
|
||||||
ctx.fillStyle = randomColor(50, 160); //随机生成字体颜色
|
ctx.fillStyle = randomColor(50, 160); //随机生成字体颜色
|
||||||
ctx.font = randomNum(props.fontSizeMin, props.fontSizeMax) + "px SimHei"; //随机生成字体大小
|
ctx.font = randomNum(props.fontSizeMin, props.fontSizeMax) + "px SimHei"; //随机生成字体大小
|
||||||
let x = (i + 1) * (props.contentWidth / (identifyCode.value.length + 1));
|
let x = (i + 1) * (props.contentWidth / (identifyCode.value.length + 1)); // x轴
|
||||||
let y = randomNum(props.fontSizeMax, props.contentHeight - 5);
|
let y = randomNum(props.fontSizeMax, props.contentHeight); // y轴
|
||||||
let deg = randomNum(-30, 30);
|
let deg = randomNum(-30, 30);
|
||||||
// 修改坐标原点和旋转角度
|
// 修改坐标原点和旋转角度
|
||||||
ctx.translate(x, y);
|
ctx.translate(x, y);
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
<a-form-item field="verifyCode" :hide-asterisk="true">
|
<a-form-item field="verifyCode" :hide-asterisk="true">
|
||||||
<div class="verifyCode">
|
<div class="verifyCode">
|
||||||
<a-input style="width: 160px" v-model="form.verifyCode" allow-clear placeholder="请输入验证码" />
|
<a-input style="width: 160px" v-model="form.verifyCode" allow-clear placeholder="请输入验证码" />
|
||||||
<VerifyCode :content-height="30" :content-width="100" @verify-code-change="verifyCodeChange" />
|
<VerifyCode :content-height="30" :font-size-max="30" :content-width="110" @verify-code-change="verifyCodeChange" />
|
||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item field="remember">
|
<a-form-item field="remember">
|
||||||
|
|||||||
2
src/vite-env.d.ts
vendored
2
src/vite-env.d.ts
vendored
@ -18,3 +18,5 @@ declare module "@wangeditor/editor-for-vue";
|
|||||||
declare module "@/directives/modules/custom";
|
declare module "@/directives/modules/custom";
|
||||||
declare module "mockjs";
|
declare module "mockjs";
|
||||||
declare module "@/store/modules/route-config";
|
declare module "@/store/modules/route-config";
|
||||||
|
declare module "@arco-design/*";
|
||||||
|
declare module "vue-router";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user