flutter_aliyun_captcha
Плагин для Flutter, обеспечивающий человеко-машинную верификацию.
Поддерживает скользящую верификацию и интеллектуальную верификацию (интеллектуальная верификация в настоящее время не поддерживает формы типа «проведите картой»).
Добавьте это в файл pubspec.yaml пакета:
dependencies:
flutter_aliyun_captcha: ^1.0.5
Вы можете установить пакет из командной строки:
$ flutter packages get
Импортируйте flutter_aliyun_captcha
:
import 'package:flutter_aliyun_captcha/flutter_aliyun_captcha.dart';
AliyunCaptchaButton
автоматически адаптируется к размеру верхнего слоя. Обязательно установите ширину и высоту для верхнего слоя.
Container(
width: double.infinity,
height: 48,
margin: EdgeInsets.only(
top: 10,
bottom: 10,
left: 16,
right: 16,
),
child: AliyunCaptchaButton(
controller: _captchaController,
type: AliyunCaptchaType.slide, // Важно: установите правильный тип
option: AliyunCaptchaOption(
appKey: '<appKey>',
scene: 'scene',
language: 'cn',
// Дополнительные параметры см.: https://help.aliyun.com/document_detail/193141.html
),
customStyle: '''
.nc_scale {
background: #eeeeee !important;
/* Цвет фона по умолчанию */
}
.nc_scale div.nc_bg {
background: #4696ec !important;
/* Фон после скольжения */
}
.nc_scale .scale_text2 {
color: #fff !important;
/* Цвет шрифта после скольжения */
}
.errloading {
border: #ff0000 1px solid !important;
color: #ef9f06 !important;
}
''',
onSuccess: (dynamic data) {
// {"sig": "...", "token": "..."}
_addLog('onSuccess', data);
},
onFailure: (String failCode) {
_addLog('onFailure', 'failCode: $failCode');
},
onError: (String errorCode) {
_addLog('onError', 'errorCode: $errorCode');
},
),
)
AliyunCaptchaButton(
controller: _captchaController,
type: AliyunCaptchaType.smart, // Важно: установите правильный тип
option: AliyunCaptchaOption(
appKey: '<appKey>',
scene: 'scene',
language: 'cn',
// Дополнительные параметры см.: https://help.aliyun.com/document_detail/193144.html
),
onSuccess: (dynamic data) {
// {"sig": "...", "token": "..."}
_addLog('onSuccess', data);
},
onFailure: (String failCode) {
_addLog('onFailure', 'failCode: $failCode');
},
onError: (String errorCode) {
_addLog('onError', 'errorCode: $errorCode');
},
),
)
String sdkVersion = await AliyunCaptcha.sdkVersion;
MIT License
Copyright (c) 2021 LiJianying <lijy91@foxmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT
*Примечание: в данном переводе могут быть неточности.*
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Комментарии ( 0 )