hh 1 anno fa
parent
commit
feb870b07e

+ 5 - 5
entry/src/main/ets/common/util/request/RequestInstance.ets

@@ -1,11 +1,11 @@
 import JGRequest from './Request'
 
-const getToken = async (): Promise<string> => {
+const getToken = async (loginName: string, password: string, orgId: number, stationId: number): Promise<string> => {
   return await JGRequest.post("/api/auth/aioLogin", {
-    "userName": this.loginName,
-    "password": this.password,
-    "orgId": this.dept ? this.dept.id : 0,
-    "stationId": this.workstation ? this.workstation.id : 0,
+    "userName": loginName,
+    "password": password,
+    "orgId": orgId,
+    "stationId": stationId,
   })
 }
 

+ 1 - 1
entry/src/main/ets/pages/LoginPage.ets

@@ -170,7 +170,7 @@ struct LoginPage {
         }
         .onClick(()=>{
           if (this.loginName && this.loginName.length > 0 && this.password && this.password.length > 0) {
-            getToken().then(token =>{
+            getToken(this.loginName, this.password, this.dept ? this.dept.id : 0, this.workstation ? this.workstation.id : 0).then(token =>{
               if (token && token.length > 0) {
                 router.pushUrl({
                   url:'pages/Index'