wfz 3 years ago
parent
commit
8cf365a790
5 changed files with 42 additions and 10 deletions
  1. 6 6
      api/account/account.pb.go
  2. 3 3
      api/account/account.proto
  3. 1 1
      go.mod
  4. 21 0
      js/api/account/account_http_pb.ts
  5. 11 0
      js/api/account/account_pb.ts

+ 6 - 6
api/account/account.pb.go

@@ -211,12 +211,12 @@ var file_account_proto_rawDesc = []byte{
 	0x75, 0x6e, 0x74, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x22,
 	0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x22, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x6f, 0x67,
 	0x69, 0x6e, 0x2f, 0x6d, 0x69, 0x6e, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x3a,
-	0x01, 0x2a, 0x42, 0x49, 0x0a, 0x0b, 0x61, 0x70, 0x69, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
-	0x74, 0x50, 0x01, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e,
-	0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2f, 0x70, 0x77,
-	0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x63,
-	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x62, 0x06, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x01, 0x2a, 0x42, 0x46, 0x0a, 0x0b, 0x61, 0x70, 0x69, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
+	0x74, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e,
+	0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75,
+	0x6e, 0x74, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x33,
 }
 
 var (

+ 3 - 3
api/account/account.proto

@@ -3,10 +3,10 @@ syntax = "proto3";
 package api.account;
 
 import "google/api/annotations.proto";
-import "google/protobuf/struct.proto";
-import "google/protobuf/empty.proto";
+//import "google/protobuf/struct.proto";
+//import "google/protobuf/empty.proto";
 
-option go_package = "git.ikuban.com/server/pw/pw-protobuf/api/account;account";
+option go_package = "git.ikuban.com/server/pw-protobuf/api/account;account";
 option java_multiple_files = true;
 option java_package = "api.account";
 

+ 1 - 1
go.mod

@@ -1,4 +1,4 @@
-module git.ikuban.com/server/pw/pw-protobuf
+module git.ikuban.com/server/pw-protobuf
 
 go 1.17
 

+ 21 - 0
js/api/account/account_http_pb.ts

@@ -0,0 +1,21 @@
+// @ts-ignore
+import { request } from 'ice';
+import {DebugLoginRequest,LoginReply,LoginRequest} from "./account_pb";
+
+const AccountService = {
+  DebugLogin: async (req?: DebugLoginRequest) => {
+	const res = await request.post<{ data: LoginReply, code: string, message: string }>('/api/login/debug', req);
+    return res.data;
+  },
+  MiniProgramLogin: async (req?: LoginRequest) => {
+	const res = await request.post<{ data: LoginReply, code: string, message: string }>('/api/login/mini_program', req);
+    return res.data;
+  },
+  WebLogin: async (req?: LoginRequest) => {
+	const res = await request.post<{ data: LoginReply, code: string, message: string }>('/api/login/mini_program', req);
+    return res.data;
+  },
+
+};
+
+export default AccountService;

+ 11 - 0
js/api/account/account_pb.ts

@@ -0,0 +1,11 @@
+export interface DebugLoginRequest{
+    userId?:string;
+    code?:string;
+}
+export interface LoginRequest{
+    jsCode?:string;
+}
+export interface LoginReply{
+    token?:string;
+}
+