Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Temporarily disable bulk download due to bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
hqy2000 committed May 15, 2018
1 parent 09e406b commit 6c0bdbd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
4 changes: 2 additions & 2 deletions app/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.12</string>
<string>1.2.13</string>
<key>CFBundleVersion</key>
<string>493</string>
<string>496</string>
<key>CodeNameCN</key>
<string>決別</string>
<key>CodeNameEN</key>
Expand Down
16 changes: 8 additions & 8 deletions app/v2/Controller/Main_v2.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="GuO-ug-mbw">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="GuO-ug-mbw">
<device id="retina5_9" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -20,36 +20,36 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="FJL-X1-LET">
<rect key="frame" x="56" y="291" width="262.66666666666669" height="230"/>
<rect key="frame" x="56.333333333333343" y="291" width="262.33333333333326" height="230"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="用户名" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="xsN-Sz-GJ9">
<rect key="frame" x="0.0" y="0.0" width="262.66666666666669" height="30"/>
<rect key="frame" x="0.0" y="0.0" width="262.33333333333331" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="D0K-KH-kGj">
<rect key="frame" x="0.0" y="50" width="262.66666666666669" height="30"/>
<rect key="frame" x="0.0" y="50" width="262.33333333333331" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oFp-Tu-j7Y">
<rect key="frame" x="0.0" y="100" width="262.66666666666669" height="30"/>
<rect key="frame" x="0.0" y="100" width="262.33333333333331" height="30"/>
<state key="normal" title="登陆"/>
<connections>
<action selector="login:" destination="MAC-v6-KWc" eventType="touchDown" id="QUP-Uz-w4z"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8dl-91-y8D">
<rect key="frame" x="0.0" y="150" width="262.66666666666669" height="30"/>
<rect key="frame" x="0.0" y="150" width="262.33333333333331" height="30"/>
<state key="normal" title="注册"/>
<connections>
<action selector="register:" destination="MAC-v6-KWc" eventType="touchDown" id="Gk9-qD-Z20"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XJX-yy-h1Z">
<rect key="frame" x="0.0" y="200" width="262.66666666666669" height="30"/>
<rect key="frame" x="0.0" y="200" width="262.33333333333331" height="30"/>
<state key="normal" title="忘记密码"/>
<connections>
<action selector="reset:" destination="MAC-v6-KWc" eventType="touchDown" id="Lk8-bb-pph"/>
Expand Down
5 changes: 4 additions & 1 deletion app/v2/Controller/School/ResourceViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,14 @@ class ResourcesViewController:UITableViewController {
DispatchQueue.main.async {
if self.tabBarController?.selectedViewController is ResourcesViewController {
//self.navigationItem.prompt = "路径: /" + (self.provider.path as NSArray).componentsJoined(by: "/")
self.navigationItem.rightBarButtonItems = [self.headerButton]
/*
if(self.multiMode){
self.navigationItem.rightBarButtonItems = [self.headerButton,self.multiButton,self.deleteButton,self.downloadButton]
} else {
self.navigationItem.rightBarButtonItems = [self.headerButton,self.multiButton]
}
*/
if(self.provider.path.count > 0){
//self.navigationItem.hidesBackButton = true
self.swipe.isEnabled = true
Expand Down Expand Up @@ -249,7 +252,7 @@ class ResourcesViewController:UITableViewController {
} else {
self.tableView.isUserInteractionEnabled = false
let toDownload = checkMarkschemes(file)
if(toDownload.count == 1) {
if(toDownload.count == 1 || true) {
self.provider.getFile(file: file, progress: { progress in
DispatchQueue.main.async {
SVProgressHUD.showProgress(Float(progress), status: file.filename)
Expand Down
20 changes: 10 additions & 10 deletions app/v2/Provider/SchoolProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@ class SchoolProvider:AbstractProvider<SchoolRequest> {
}

public func periodUpdate() {
DispatchQueue.main.asyncAfter(deadline: .now() + 1800 , execute: {
if(self.requiresUpdate && self.client != nil) {
//self.notifier.showInfo("正在刷新访问密钥")
self.request(target: .pastpaperToken(), type: StsToken.self, success: { response in
let token = response
let stsTokenProvider = OSSStsTokenCredentialProvider(accessKeyId: token.accessKeyId, secretKeyId: token.accessKeySecret, securityToken: token.securityToken)
self.client = OSSClient(endpoint: "https://oss-cn-shanghai.aliyuncs.com", credentialProvider: stsTokenProvider)
})
if(self.requiresUpdate && self.client != nil) {
//self.notifier.showInfo("正在刷新访问密钥")
self.request(target: .pastpaperToken(), type: StsToken.self, success: { response in
let token = response
let stsTokenProvider = OSSStsTokenCredentialProvider(accessKeyId: token.accessKeyId, secretKeyId: token.accessKeySecret, securityToken: token.securityToken)
self.client = OSSClient(endpoint: "https://oss-cn-shanghai.aliyuncs.com", credentialProvider: stsTokenProvider)
})
DispatchQueue.main.asyncAfter(deadline: .now() + 1800 , execute: {
self.periodUpdate()
}
})
})
}
}

fileprivate func requestList(result:[File] = [],next:String? = nil, completion: @escaping (_ files:[File]) -> Void)
Expand Down

0 comments on commit 6c0bdbd

Please sign in to comment.