Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 679a6948
authored
2025-12-10 14:50:35 +0800
by
Administrator
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
关于obs的文件上传,优化处理规则
1 parent
ee39088f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
3 deletions
README.md
lib/config/constant.dart
lib/data/repositories/message/upload_file.dart
README.md
View file @
679a694
...
@@ -14,7 +14,7 @@ flutter run -d 00008140-001068C93AB8801C --release
...
@@ -14,7 +14,7 @@ flutter run -d 00008140-001068C93AB8801C --release
gao 00008130-0010788A2E01001C
gao 00008130-0010788A2E01001C
yongosng 00008110-000A284C2178801E
yongosng 00008110-000A284C2178801E
flutter build ios --build-number=2511061
flutter build ios --build-number=2511061
flutter build ipa --export-method ad-hoc
flutter build ipa --export-method ad-hoc
...
...
lib/config/constant.dart
View file @
679a694
...
@@ -27,6 +27,21 @@ class Constant {
...
@@ -27,6 +27,21 @@ class Constant {
/// obs文件上传的逻辑前缀
/// obs文件上传的逻辑前缀
static
const
String
obsLogicPrefix
=
EnvConfig
.
env
==
'dev'
?
'd2/pridel/user/'
:
'p2/unpridel/user/'
;
static
const
String
obsLogicPrefix
=
EnvConfig
.
env
==
'dev'
?
'd2/pridel/user/'
:
'p2/unpridel/user/'
;
// 定义obs存储业务上的关键业务类型,属于这种类型的业务,在存储上区分其分属于何种删除规则
static
const
List
<
String
>
obsPridelFileConfigs
=
[
'homework'
,
'clockin'
,
'clock'
,
'clazzclock'
,
'clockinQcard'
,
'recite'
,
'aloud'
,
'hurdle'
,
'tbx'
,
'txbb'
,
'dictation'
,
'xegd'
,
'kouyu'
];
/// 版本相关
/// 版本相关
/// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///
...
...
lib/data/repositories/message/upload_file.dart
View file @
679a694
import
'dart:convert'
;
import
'dart:convert'
;
import
'dart:io'
;
import
'dart:io'
;
import
'package:appframe/config/evn_config.dart'
;
import
'package:appframe/config/constant.dart'
;
import
'package:appframe/config/constant.dart'
;
import
'package:appframe/config/locator.dart'
;
import
'package:appframe/config/locator.dart'
;
import
'package:appframe/services/api_service.dart'
;
import
'package:appframe/services/api_service.dart'
;
...
@@ -307,14 +308,28 @@ class UploadFileHandler extends MessageHandler {
...
@@ -307,14 +308,28 @@ class UploadFileHandler extends MessageHandler {
}
}
String
_getLoginPrefix
(
String
busi
,
String
subBusi
)
{
String
_getLoginPrefix
(
String
busi
,
String
subBusi
)
{
var
now
=
DateTime
.
now
();
var
now
=
DateTime
.
now
();
var
year
=
now
.
year
;
var
year
=
now
.
year
;
var
month
=
now
.
month
;
var
month
=
now
.
month
;
var
day
=
now
.
day
;
var
day
=
now
.
day
;
String
userCode
=
getIt
.
get
<
SharedPreferences
>().
getString
(
'auth_userCode'
)
??
'unknown'
;
String
userCode
=
getIt
.
get
<
SharedPreferences
>().
getString
(
'auth_userCode'
)
??
'na'
;
String
classCode
=
getIt
.
get
<
SharedPreferences
>().
getString
(
'auth_classCode'
)
??
'nac'
;
String
obsLogicPrefix
=
"d2"
;
if
(
EnvConfig
.
env
==
'pro'
){
obsLogicPrefix
=
"p2"
;
}
return
'
${Constant.obsLogicPrefix}$year$month$day
/app/
$userCode
/
${busi}
_
$subBusi
'
;
String
busiCode
=
'
${busi}
_
$subBusi
'
;
// 属于该特定业务范围的素材,都被看作日后运维可以优先删除的文件,规则:http://wiki.zbuku.cn/confluence/pages/viewpage.action?pageId=137172780
if
(
Constant
.
obsPridelFileConfigs
.
contains
(
busiCode
)){
obsLogicPrefix
=
'
$obsLogicPrefix
/pridel/user/'
;
}
else
{
obsLogicPrefix
=
'
$obsLogicPrefix
/unpridel/user/'
;
}
return
'
$obsLogicPrefix$year$month$day
/app/
$classCode
/
${busi}
_
$subBusi
/
$userCode
'
;
}
}
String
_addPreUrl
(
String
location
)
{
String
_addPreUrl
(
String
location
)
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment