bjb пре 4 месеци
родитељ
комит
15f2a196c6

+ 1 - 13
build-profile.json5

@@ -1,19 +1,7 @@
 {
   "app": {
     "signingConfigs": [
-      {
-        "name": "default",
-        "type": "HarmonyOS",
-        "material": {
-          "certpath": "C:\\Users\\ISCS\\.ohos\\config\\default_HMOS_Bozzys_HP5OM4eVV84UM2fMSmeCbI2qYo1z8QX2kkiC2cONM8Y=.cer",
-          "keyAlias": "debugKey",
-          "keyPassword": "0000001BA4611120FAA29D85A4F2452B7A14F842CEA20AFB5A7569656E4D417F10A5E1C542B5134A58817C",
-          "profile": "C:\\Users\\ISCS\\.ohos\\config\\default_HMOS_Bozzys_HP5OM4eVV84UM2fMSmeCbI2qYo1z8QX2kkiC2cONM8Y=.p7b",
-          "signAlg": "SHA256withECDSA",
-          "storeFile": "C:\\Users\\ISCS\\.ohos\\config\\default_HMOS_Bozzys_HP5OM4eVV84UM2fMSmeCbI2qYo1z8QX2kkiC2cONM8Y=.p12",
-          "storePassword": "0000001BE34B50440810C37CD0E204691198BC6FE26E1F6F3DBDAA7E49F37886FDB4BFCB01136883738F8D"
-        }
-      }
+
     ],
     "products": [
       {

+ 7 - 1
entry/src/main/ets/pages/PageHomeComponents/TabSettings.ets

@@ -59,7 +59,10 @@ export struct TabSettings {
       Row() {
         Stack() {
           CardContainer({ radius: "50%" }) {
-            Stack().width("100%").height("100%").linearGradient({ angle: 135, colors: [['#FFAE00', 0.0], ['#F7C700', 1.0]] })
+            Stack()
+              .width("100%")
+              .height("100%")
+              .linearGradient({ angle: 135, colors: [['#FFAE00', 0.0], ['#F7C700', 1.0]] })
             Text("P").fontSize(20).fontWeight(FontWeight.Bold)
             Image(this.vm.user.avatar).size({ width: 60, height: 60 })
           }
@@ -94,5 +97,8 @@ export struct TabSettings {
     .backgroundColor("#FA666C")
     .borderRadius(6)
     .justifyContent(FlexAlign.Center)
+    .onClick(() => {
+      this.getUIContext().showAlertDialog({ title: "提示", message: "确定要退出登录吗?" })
+    })
   }
 }

+ 6 - 0
entry/src/main/ets/vm/VMLogin.ets

@@ -13,12 +13,17 @@ export class VMLogin {
   account: string = ""
   // 验证码或密码
   code: string = ""
+  // 是否登录成功
+  isLogin: boolean = false
 
   setLoginType(type: number) {
     this.loginType = type
   }
 
   login(skip: Function) {
+    if (this.isLogin) {
+      return
+    }
     if (this.account.trim() == "") {
       const msg = this.loginType == 0 ? "请输入手机号" : "请输入用户名"
       promptAction.openToast({ message: msg }).catch()
@@ -32,6 +37,7 @@ export class VMLogin {
     hideKeyboard()
     Loading.showLoading({ text: '登录中...' })
     ReqApi.login(this.account.trim(), this.code).then((rsp) => {
+      this.isLogin = true
       Storage.setLogin(true)
       Storage.setToken(rsp.data?.accessToken ?? "")
       Storage.setRefreshToken(rsp.data?.refreshToken ?? "")