Merge branch 'develop_admin_password' into 'release'

Develop admin password

See merge request StarlockTeam/app-starlock!166
This commit is contained in:
吴亚茜 2025-06-13 03:17:38 +00:00
commit 037f556644
4 changed files with 82 additions and 28 deletions

View File

@ -60,13 +60,19 @@ variables:
.setup_fastlane_android: .setup_fastlane_android:
extends: .build_rule extends: .build_rule
before_script: before_script:
- export PUB_HOSTED_URL=https://pub.flutter-io.cn
- export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
- ls -li - ls -li
- export NEXT_VERSION="$(cat app_new.version)" - export NEXT_VERSION="$(cat app_new.version)"
# - flutter pub get # - flutter pub get
- export PATH="/opt/homebrew/bin:$PATH" - export PATH="/opt/homebrew/bin:$PATH"
- eval "$(rbenv init -)" - eval "$(rbenv init -)"
- bundle config mirror.https://rubygems.org https://gems.ruby-china.com - rbenv global 2.6.10 # 你实际用的 Ruby 版本
- bundle install --gemfile android/Gemfile --quiet - ruby -v
- which ruby
- gem env
- bundle config mirror.https://rubygems.org https://mirrors.aliyun.com/rubygems/
- bundle install --gemfile android/Gemfile --path vendor/bundle_android --quiet
cache: cache:
paths: paths:
- app_new.version - app_new.version
@ -74,13 +80,19 @@ variables:
.setup_fastlane_ios: .setup_fastlane_ios:
extends: .build_rule extends: .build_rule
before_script: before_script:
- export PUB_HOSTED_URL=https://pub.flutter-io.cn
- export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
- ls -li - ls -li
- export NEXT_VERSION="$(cat app_new.version)" - export NEXT_VERSION="$(cat app_new.version)"
# - flutter pub get - flutter pub get
- export PATH="/opt/homebrew/bin:$PATH" - export PATH="/opt/homebrew/bin:$PATH"
- eval "$(rbenv init -)" - eval "$(rbenv init -)"
- bundle config mirror.https://rubygems.org https://gems.ruby-china.com - rbenv global 2.6.10 # 你实际用的 Ruby 版本
- bundle install --gemfile ios/Gemfile --quiet - ruby -v
- which ruby
- gem env
- bundle config mirror.https://rubygems.org https://mirrors.aliyun.com/rubygems/
- bundle install --gemfile ios/Gemfile --path vendor/bundle_ios --quiet
cache: cache:
paths: paths:
- app_new.version - app_new.version

View File

@ -133,20 +133,20 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
} }
}); });
})), })),
Obx(() => Visibility( // Obx(() => Visibility(
visible: state.lockBasicInfo.value.isLockOwner == 1, // visible: state.lockBasicInfo.value.isLockOwner == 1,
child: CommonItem( // child: CommonItem(
leftTitel: '管理员开锁密码'.tr, // leftTitel: '管理员开锁密码'.tr,
rightTitle: state.lockBasicInfo.value.adminPwd, // rightTitle: state.lockBasicInfo.value.adminPwd,
isHaveLine: true, // isHaveLine: true,
isHaveDirection: true, // isHaveDirection: true,
action: () { // action: () {
Get.toNamed(Routers.adminOpenLockPasswordPage, // Get.toNamed(Routers.adminOpenLockPasswordPage,
arguments: <String, LockSetInfoData>{ // arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value // 'lockSetInfoData': state.lockSetInfoData.value
}); // });
}), // }),
)), // )),
Obx(() => Visibility( Obx(() => Visibility(
visible: (state.lockBasicInfo.value.lockName ?? '') visible: (state.lockBasicInfo.value.lockName ?? '')
.contains('T9A'), .contains('T9A'),

View File

@ -99,7 +99,7 @@ class _LockSetPageState extends State<LockSetPage>
CommonItem( CommonItem(
leftTitel: '基本信息'.tr, leftTitel: '基本信息'.tr,
rightTitle: '', rightTitle: '',
isHaveLine: false, isHaveLine: state.lockBasicInfo.value.isLockOwner == 1,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
if (!state.lockSetInfoData.value.isValid()) { if (!state.lockSetInfoData.value.isValid()) {
@ -111,6 +111,25 @@ class _LockSetPageState extends State<LockSetPage>
'lockSetInfoData': state.lockSetInfoData.value 'lockSetInfoData': state.lockSetInfoData.value
}); });
}), }),
//
Obx(() => Visibility(
visible: state.lockBasicInfo.value.isLockOwner == 1,
child: CommonItem(
leftTitel: '管理员开锁密码'.tr,
rightTitle: state.lockBasicInfo.value.adminPwd,
isHaveLine: false,
isHaveDirection: true,
action: () {
if (!state.lockSetInfoData.value.isValid()) {
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr);
return;
}
Get.toNamed(Routers.adminOpenLockPasswordPage,
arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value
});
}),
)),
SizedBox(height: 10.h), SizedBox(height: 10.h),
// //
Obx(() => Visibility( Obx(() => Visibility(
@ -201,7 +220,7 @@ class _LockSetPageState extends State<LockSetPage>
CommonItem( CommonItem(
leftTitel: '基本信息'.tr, leftTitel: '基本信息'.tr,
rightTitle: '', rightTitle: '',
isHaveLine: false, isHaveLine: state.lockBasicInfo.value.isLockOwner == 1,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Get.toNamed(Routers.basicInformationPage, Get.toNamed(Routers.basicInformationPage,
@ -209,6 +228,25 @@ class _LockSetPageState extends State<LockSetPage>
'lockSetInfoData': state.lockSetInfoData.value 'lockSetInfoData': state.lockSetInfoData.value
}); });
}), }),
//
Obx(() => Visibility(
visible: state.lockBasicInfo.value.isLockOwner == 1,
child: CommonItem(
leftTitel: '管理员开锁密码'.tr,
rightTitle: state.lockBasicInfo.value.adminPwd,
isHaveLine: true,
isHaveDirection: true,
action: () {
if (!state.lockSetInfoData.value.isValid()) {
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr);
return;
}
Get.toNamed(Routers.adminOpenLockPasswordPage,
arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value
});
}),
)),
SizedBox(height: 10.h), SizedBox(height: 10.h),
//by DaisyWu //by DaisyWu
// //

View File

@ -10,17 +10,21 @@ echo "PRIVATE-TOKEN: $TOKEN $URL/projects/$PROJECT_ID/repository/tags"
tags_json=$(curl -H "Content-Type: application/json" -H "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/tags") tags_json=$(curl -H "Content-Type: application/json" -H "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/tags")
#echo "tags_json:$tags_json\n" #echo "tags_json:$tags_json\n"
tags=$(echo "$tags_json" | jq -r '.[].name') tags=$(echo "$tags_json" | jq -r '.[].name')
# 只保留不带 _sky 后缀的 tag 作为最新 tag
plain_tags=$(echo "$tags" | grep -v '_sky$')
latest_tag=$(echo "$plain_tags" | head -n 1)
tags_length=$(echo "$tags_json" | jq -r 'length') tags_length=$(echo "$tags_json" | jq -r 'length')
if [ "$tags_length" -lt 1 ]; then if [ "$tags_length" -lt 1 ]; then
next_tag="v1.0.0" next_tag="v1.0.0"
else else
newest_tag=$(echo "$tags" | head -n 1) IFS='.' read -r major minor patch <<< "$latest_tag"
IFS='.' read -r major minor patch <<< "$newest_tag"
major="${major#v}" major="${major#v}"
compare_json="" compare_json=""
if [[ "$1" == "generate_tag" ]];then if [[ "$1" == "generate_tag" ]];then
echo "generate_tag:$newest_tag-to-master\n" echo "generate_tag:$latest_tag-to-master\n"
compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$newest_tag&to=master") compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$latest_tag&to=master")
elif [[ "$1" == "generate_version" ]]; then elif [[ "$1" == "generate_version" ]]; then
echo "generate_version:master-to-$CI_COMMIT_BRANCH\n" echo "generate_version:master-to-$CI_COMMIT_BRANCH\n"
compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=master&to=$CI_COMMIT_BRANCH") compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=master&to=$CI_COMMIT_BRANCH")
@ -45,9 +49,9 @@ else
done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}') done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}')
next_tag="v$major.$new_minor.$new_patch" next_tag="v$major.$new_minor.$new_patch"
fi fi
echo "New Tag:$newest_tag;New version: $next_tag;command: $1" echo "New Tag:$latest_tag;New version: $next_tag;command: $1"
if [[ "$1" == "generate_tag" ]];then if [[ "$1" == "generate_tag" ]];then
if [ "$next_tag" == "$newest_tag" ]; then if [ "$next_tag" == "$latest_tag" ]; then
echo "no change from master,skip to generate tag" echo "no change from master,skip to generate tag"
exit 0 exit 0
fi fi