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:
extends: .build_rule
before_script:
- export PUB_HOSTED_URL=https://pub.flutter-io.cn
- export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
- ls -li
- export NEXT_VERSION="$(cat app_new.version)"
# - flutter pub get
# - flutter pub get
- export PATH="/opt/homebrew/bin:$PATH"
- eval "$(rbenv init -)"
- bundle config mirror.https://rubygems.org https://gems.ruby-china.com
- bundle install --gemfile android/Gemfile --quiet
- rbenv global 2.6.10 # 你实际用的 Ruby 版本
- 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:
paths:
- app_new.version
@ -74,13 +80,19 @@ variables:
.setup_fastlane_ios:
extends: .build_rule
before_script:
- export PUB_HOSTED_URL=https://pub.flutter-io.cn
- export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
- ls -li
- export NEXT_VERSION="$(cat app_new.version)"
# - flutter pub get
- flutter pub get
- export PATH="/opt/homebrew/bin:$PATH"
- eval "$(rbenv init -)"
- bundle config mirror.https://rubygems.org https://gems.ruby-china.com
- bundle install --gemfile ios/Gemfile --quiet
- rbenv global 2.6.10 # 你实际用的 Ruby 版本
- 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:
paths:
- app_new.version

View File

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

View File

@ -99,7 +99,7 @@ class _LockSetPageState extends State<LockSetPage>
CommonItem(
leftTitel: '基本信息'.tr,
rightTitle: '',
isHaveLine: false,
isHaveLine: state.lockBasicInfo.value.isLockOwner == 1,
isHaveDirection: true,
action: () {
if (!state.lockSetInfoData.value.isValid()) {
@ -111,6 +111,25 @@ class _LockSetPageState extends State<LockSetPage>
'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),
//
Obx(() => Visibility(
@ -201,7 +220,7 @@ class _LockSetPageState extends State<LockSetPage>
CommonItem(
leftTitel: '基本信息'.tr,
rightTitle: '',
isHaveLine: false,
isHaveLine: state.lockBasicInfo.value.isLockOwner == 1,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.basicInformationPage,
@ -209,6 +228,25 @@ class _LockSetPageState extends State<LockSetPage>
'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),
//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")
#echo "tags_json:$tags_json\n"
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')
if [ "$tags_length" -lt 1 ]; then
next_tag="v1.0.0"
else
newest_tag=$(echo "$tags" | head -n 1)
IFS='.' read -r major minor patch <<< "$newest_tag"
IFS='.' read -r major minor patch <<< "$latest_tag"
major="${major#v}"
compare_json=""
if [[ "$1" == "generate_tag" ]];then
echo "generate_tag:$newest_tag-to-master\n"
compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$newest_tag&to=master")
echo "generate_tag:$latest_tag-to-master\n"
compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$latest_tag&to=master")
elif [[ "$1" == "generate_version" ]]; then
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")
@ -45,9 +49,9 @@ else
done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}')
next_tag="v$major.$new_minor.$new_patch"
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 [ "$next_tag" == "$newest_tag" ]; then
if [ "$next_tag" == "$latest_tag" ]; then
echo "no change from master,skip to generate tag"
exit 0
fi