Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
47ead385
提交
47ead385
authored
2月 04, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add
上级
b51bb84c
全部展开
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
44 行增加
和
10 行删除
+44
-10
library.dart
lib/apis/library.dart
+1
-1
mine.dart
lib/apis/mine.dart
+2
-2
controller.dart
lib/pages/read_web/controller.dart
+2
-0
controller.dart
lib/pages/user_discuss_des/controller.dart
+1
-0
list.dart
lib/pages/user_discuss_des/widgets/list.dart
+1
-0
http.dart
lib/services/http.dart
+2
-2
app_config.dart
lib/utils/app_config.dart
+7
-3
constants.dart
lib/utils/constants.dart
+1
-0
encrypt_util.dart
lib/utils/encrypt_util.dart
+22
-0
index.dart
lib/utils/index.dart
+2
-1
sign.dart
lib/utils/sign.dart
+1
-1
pubspec.lock
pubspec.lock
+0
-0
pubspec.yaml
pubspec.yaml
+2
-0
没有找到文件。
lib/apis/library.dart
浏览文件 @
47ead385
...
...
@@ -276,7 +276,7 @@ abstract class LibraryAPI {
String
types
=
'3'
,
required
String
content
,
required
String
isOpen
,
String
color
=
''
,
String
color
=
'
#FF0000
'
,
required
String
positioning
,
required
String
noteContent
,
})
async
{
...
...
lib/apis/mine.dart
浏览文件 @
47ead385
...
...
@@ -215,7 +215,7 @@ abstract class MineAPI {
});
}
/// 13、
笔记
详情列表
/// 13、
讨论
详情列表
///
static
Future
<
List
<
DiscussModel
>>
discussList
(
{
int
page
=
1
,
...
...
@@ -228,7 +228,7 @@ abstract class MineAPI {
'page'
:
page
,
'page_size'
:
limit
,
'book_id'
:
bookId
,
'type
s
'
:
types
'type'
:
types
},
);
if
(
result
.
data
is
!
Map
&&
result
.
data
[
'list'
]
is
!
List
)
return
[];
...
...
lib/pages/read_web/controller.dart
浏览文件 @
47ead385
...
...
@@ -246,6 +246,8 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
void
chooseTool
(
ToolModel
selectedModel
){
for
(
var
model
in
tools
)
{
// 如果当前遍历到的工具是选中的,并且不是点击的工具,则取消选中
...
...
lib/pages/user_discuss_des/controller.dart
浏览文件 @
47ead385
...
...
@@ -54,6 +54,7 @@ class UserDiscussDesController extends GetxController {
refreshController
.
finishRefresh
(
IndicatorResult
.
success
);
refreshController
.
resetFooter
();
}
catch
(
error
)
{
Console
.
log
(
'------------onRefresh-----------------
$error
'
);
refreshController
.
finishRefresh
(
IndicatorResult
.
fail
);
}
}
...
...
lib/pages/user_discuss_des/widgets/list.dart
浏览文件 @
47ead385
...
...
@@ -22,6 +22,7 @@ class _BuildListPageState extends State<BuildListPage> with AutomaticKeepAliveCl
init:
UserDiscussDesController
(
widget
.
tag
,
widget
.
model
),
builder:
(
controller
)
=>
CustomPullScrollView
(
controller:
controller
.
refreshController
,
// onRefresh: controller.onRefresh,
onLoading:
controller
.
onLoading
,
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
...
...
lib/services/http.dart
浏览文件 @
47ead385
...
...
@@ -24,8 +24,8 @@ class HttpService extends GetxService {
/// 组织 headers 参数
Map
<
String
,
dynamic
>?
_getHeaders
({
bool
excludeToken
=
false
,
Map
<
String
,
dynamic
>?
params
,
String
?
url
})
{
final
headers
=
<
String
,
dynamic
>{};
headers
[
'appId'
]
=
AppConfig
.
A
ppID
;
headers
[
'appSecret'
]
=
AppConfig
.
A
ppSecret
;
headers
[
'appId'
]
=
AppConfig
.
a
ppID
;
headers
[
'appSecret'
]
=
AppConfig
.
a
ppSecret
;
headers
[
'timestamp'
]
=
(
DateTime
.
now
().
millisecondsSinceEpoch
~/
1000
).
toString
();
headers
[
'url'
]
=
kServerUrl
+
url
.
toString
();
...
...
lib/utils/app_config.dart
浏览文件 @
47ead385
...
...
@@ -2,10 +2,14 @@ part of utils;
class
AppConfig
{
//app在服务端注册的id,由后端直接提供
static
const
String
A
ppID
=
'dkFv6OwWyQhSeaZG'
;
static
const
String
a
ppID
=
'dkFv6OwWyQhSeaZG'
;
//app在服务端的秘钥串,由后端直接提供
static
const
String
A
ppSecret
=
'd34cea92316d1da113e95158bed9ca97'
;
static
const
String
a
ppSecret
=
'd34cea92316d1da113e95158bed9ca97'
;
//签名时使用的加密串,由后端直接提供
static
const
String
AppEncodeKey
=
'&4F6g4Y6b5L4R9'
;
static
const
String
appEncodeKey
=
'&4F6g4Y6b5L4R9'
;
// 下载需要的key
static
const
String
aesKey
=
'e8a83e801cf85d90b69556b0cb1e0c8a'
;
static
const
String
aesIV
=
'13e801c8901b6955'
;
}
lib/utils/constants.dart
浏览文件 @
47ead385
...
...
@@ -14,6 +14,7 @@ const String kFailOrder = 'failOrder';
abstract
class
C
{
static
const
String
localAccount
=
'storage_account'
;
static
const
String
localThemeMode
=
'storage_theme_mode'
;
...
...
lib/utils/encrypt_util.dart
浏览文件 @
47ead385
...
...
@@ -7,4 +7,25 @@ class EncryptUtil {
var
digest
=
md5
.
convert
(
content
);
return
hex
.
encode
(
digest
.
bytes
);
}
/// AES 加密
static
aesEncrypt
(
String
content
,[
String
aesKey
=
AppConfig
.
aesKey
,])
{
final
key
=
encrypt
.
Key
.
fromUtf8
(
aesKey
);
final
iv
=
encrypt
.
IV
.
fromBase64
(
base64Encode
(
utf8
.
encode
(
AppConfig
.
aesIV
)));
final
encryptor
=
encrypt
.
Encrypter
(
encrypt
.
AES
(
key
,
mode:
encrypt
.
AESMode
.
cbc
),);
final
encrypted
=
encryptor
.
encrypt
(
content
,
iv:
iv
);
return
encrypted
.
base64
;
}
/// AES 解密
static
aesDecrypt
(
String
content
,[
String
aesKey
=
AppConfig
.
aesKey
,])
{
final
key
=
encrypt
.
Key
.
fromUtf8
(
aesKey
);
final
iv
=
encrypt
.
IV
.
fromBase64
(
base64Encode
(
utf8
.
encode
(
AppConfig
.
aesIV
)));
final
encryptor
=
encrypt
.
Encrypter
(
encrypt
.
AES
(
key
,
mode:
encrypt
.
AESMode
.
cbc
));
final
encrypted
=
encrypt
.
Encrypted
.
fromBase64
(
content
);
final
decrypted
=
encryptor
.
decrypt
(
encrypted
,
iv:
iv
);
return
decrypted
;
}
}
\ No newline at end of file
lib/utils/index.dart
浏览文件 @
47ead385
...
...
@@ -4,6 +4,8 @@ import 'dart:convert';
import
'dart:io'
;
import
'dart:ui'
;
// import 'package:encrypt/encrypt.dart';
import
'package:encrypt/encrypt.dart'
as
encrypt
;
// 使用别名 'encrypt'
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
...
...
@@ -16,7 +18,6 @@ import 'package:convert/convert.dart';
import
'package:oktoast/oktoast.dart'
;
import
'package:path_provider/path_provider.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
import
'../widgets/index.dart'
;
...
...
lib/utils/sign.dart
浏览文件 @
47ead385
...
...
@@ -8,7 +8,7 @@ class SignTool {
tempArr
.
add
(
"
$key
=
${tempParams[key]}
"
);
}
String
tempStr
=
tempArr
.
join
(
"&"
);
String
finalString
=
tempStr
+
AppConfig
.
A
ppEncodeKey
;
String
finalString
=
tempStr
+
AppConfig
.
a
ppEncodeKey
;
String
finalEncodeStr
=
EncryptUtil
.
encodeMd5
(
EncryptUtil
.
encodeMd5
(
finalString
));
return
finalEncodeStr
;
}
...
...
pubspec.lock
浏览文件 @
47ead385
差异被折叠。
点击展开。
pubspec.yaml
浏览文件 @
47ead385
...
...
@@ -103,6 +103,8 @@ dependencies:
tobias
:
^3.3.0
# 内购
flutter_inapp_purchase
:
^5.6.1
encrypt
:
^5.0.3
dev_dependencies
:
flutter_test
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论