27caeb530258b2a4c91R39">39
         photoPath   <-  map["photoPath"]
40 40
         name        <-  map["name"]

+ 0 - 1
PaiAi/PaiaiDataKit/DataLayer/Repositories/Remote/GroupPhotoRemoteAPI.swift

@@ -34,7 +34,6 @@ struct GroupPhotoRemoteAPI {
34 34
     
35 35
     func uploadPhoto(data: Data) -> Single<[PhotoItem]> {
36 36
         let name = ShareUserId + "\(Date.timeIntervalSinceReferenceDate)"
37
-        print(name)
38 37
         let file = FileModel(fileName: name, fileData: data)
39 38
         let uploadResource = UploadResource<[PhotoItem]>(path: .photoUpload,
40 39
                                                        parameter: ["user_id": ShareUserId,

+ 9 - 21
PaiAi/PaiaiDataKit/DataLayer/Repositories/Remote/GuestUserInfoRemoteAPI.swift

@@ -11,28 +11,24 @@ import RxSwift
11 11
 
12 12
 struct GuestUserInfoRemoteAPI: UserInfoRemoteAPI {
13 13
     
14
-    typealias Model = UserInfo
15
-    
16
-    var path: Interfaces { return .guestLogin }
17
-    var parameter: Parameter = [:]
18
-    
19
-    init() {
20
-        parameter = ["uuid": getUUID()]
14
+    private func parse(_ json: JSON) -> UserInfo? {
15
+        guard let data  = json["data"] as? [String: AnyObject] else { return nil }
16
+        return UserInfo(json: data)
21 17
     }
22 18
     
23 19
     func login() -> Single<UserInfo> {
24
-        return Single.create(subscribe: { (observer) in
25
-            observer(.success(UserInfo(json: ["user_id": "fiDz2Ms" as AnyObject, "userName": "郑剑飞" as AnyObject, "photoPath": "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJibSYLgvXpMakvD9FaCqfiaWqcMiaiaz905YxWPuO4hy8F2lGheV7kVr9vKKXFgmL1S5s4QJgxwuwtVw/132" as AnyObject])))
26
-            return Disposables.create()
27
-        })
20
+        let contentResource = ContentResource(path: .guestLogin,
21
+                                              parameter: ["uuid": getUUID()],
22
+                                              parseJSON: parse)
23
+        return contentResource.loadContent()
28 24
     }
29 25
     
30 26
     func getUUID() -> String {
31 27
         let keyChainDic = NSMutableDictionary()
32 28
         keyChainDic.setObject(String(kSecClassGenericPassword), forKey: kSecClass as! NSCopying)
33 29
         keyChainDic.setObject("uuid", forKey: kSecAttrAccount as! NSCopying)
34
-        keyChainDic.setObject(kCFBooleanTrue, forKey: kSecReturnAttributes as! NSCopying)
35
-        keyChainDic.setObject(kCFBooleanTrue, forKey: kSecReturnData as! NSCopying)
30
+        keyChainDic.setObject(kCFBooleanTrue as Any, forKey: kSecReturnAttributes as! NSCopying)
31
+        keyChainDic.setObject(kCFBooleanTrue as Any, forKey: kSecReturnData as! NSCopying)
36 32
         
37 33
         var result: AnyObject?
38 34
         var uuid: String? = nil
@@ -51,11 +47,3 @@ struct GuestUserInfoRemoteAPI: UserInfoRemoteAPI {
51 47
         return uuidStr
52 48
     }
53 49
 }
54
-
55
-//extension GuestUserInfoRemoteAPI {
56
-//    func parse(_ json: JSON) -> UserInfo? {
57
-//        guard let result = json["data"] as? [String: AnyObject] else { return nil }
58
-//        return UserInfo(json: result)
59
-//    }
60
-//
61
-//}

+ 4 - 0
PaiAi/PaiaiDataKit/DataLayer/Repositories/Remote/WXUserInfoRemoteAPI.swift

@@ -45,6 +45,10 @@ class WXUserInfoRemoteAPI: UserInfoRemoteAPI {
45 45
     }
46 46
     
47 47
     func login() -> Single<UserInfo> {
48
+        return Single.create(subscribe: { (observer) in
49
+            observer(.success(UserInfo(json: ["user_id": "fiDz2Ms" as AnyObject, "userName": "郑剑飞" as AnyObject, "photoPath": "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJibSYLgvXpMakvD9FaCqfiaWqcMiaiaz905YxWPuO4hy8F2lGheV7kVr9vKKXFgmL1S5s4QJgxwuwtVw/132" as AnyObject])))
50
+            return Disposables.create()
51
+        })
48 52
         return Single.create(subscribe: { (observer) -> Disposable in
49 53
             
50 54
 //            let wxLoginObserver = self.addWXLoginDidFinish()

+ 1 - 1
PaiAi/PaiaiUIKit/Reusable/UIKit/PageViewController/PageViewController.swift

@@ -177,7 +177,7 @@ fileprivate extension PageViewController {
177 177
         setSliderViewDetail()
178 178
     }
179 179
     
180
-    fileprivate func setSliderViewDetail() {
180
+    func setSliderViewDetail() {
181 181
         guard let label = menuView.viewWithTag(baseTag) else { return }
182 182
         sliderConstraint = sliderView.centerXAnchor
183 183
             .constraint(equalTo: label.centerXAnchor)

adminSystem - Gogs: Go Git Service

説明なし

FFIB: 11e3a9652a first 8 年 前
..
node_modules 11e3a9652a first 8 年 前
.npmignore 11e3a9652a first 8 年 前
.travis.yml 11e3a9652a first 8 年 前
LICENSE 11e3a9652a first 8 年 前
README.md 11e3a9652a first 8 年 前
index.js 11e3a9652a first 8 年 前
package.json 11e3a9652a first 8 年 前
test.js 11e3a9652a first 8 年 前

README.md

origin(al)

Made by unshiftVersion npmBuild StatusDependenciesCoverage StatusIRC channel

Original generates the origin URL for a given URL or URL object. In addition to that it also comes with a simple same function to check if two URL's have the same origin.

Install

This module is browserify and node compatible and is therefor release in the npm registry and can be installed using:

npm install --save original

Usage

In all the examples we assume that the module is loaded using:

'use strict';

var origin = require('original');

To get the origin of a given URL simply call origin function with any given URL to get origin.

var o = origin('https://google.com/foo/bar?path');

// o = https://google.com

To compare if two URL's share the same origin you can call the same method.

if (origin.same('https://google.com/foo', 'https://primus.io')) {
  console.log('same');
} else {
  console.log('guess what, google.com and primus.io are not the same origin');
}

And that's it.

License

MIT