File tree Expand file tree Collapse file tree 7 files changed +84
-13
lines changed Expand file tree Collapse file tree 7 files changed +84
-13
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ Qiniu-JavaScript-SDK 为客户端 SDK,没有包含 `token` 生成实现,为
4040
4141Qiniu-JavaScript-SDK 的示例 [ Demo] ( http://jssdk-v2.demo.qiniu.io ) 中的服务器端部分是基于 [ Node.js 服务器端 SDK] ( https://developer.qiniu.com/kodo/sdk/nodejs ) 开发的。
4242
43- * [ JavaScript SDK 在线示例] ( http://jssdk-v2.demo.qiniu.io/ )
43+ * [ JavaScript SDK 在线示例 V3] ( https://js-sdk-demo.qiniu.io )
44+ * [ JavaScript SDK 在线示例 V2] ( http://jssdk-v2.demo.qiniu.io )
4445
4546<!--
4647本 SDK 可使开发者忽略上传底层实现细节,而更多的关注 UI 层的展现。
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import classnames from './style.less'
1010
1111export const App = ( ) => {
1212 const [ fileList , setFileList ] = React . useState < UniqueFile [ ] > ( [ ] )
13- const [ settingVisible , setSettingVisible ] = React . useState ( false )
13+ const [ settingVisible , setSettingVisible ] = React . useState ( true )
1414
1515 const selectFile = ( file : UniqueFile ) => {
1616 setFileList ( files => [ file , ...files ] )
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ import * as React from 'react'
33import classnames from './style.less'
44
55interface IProps {
6- value : string | undefined
7- onChange ( v : string | undefined ) : void
6+ value : string
7+ onChange ( v : string ) : void
88
99 placeholder ?: string | undefined
1010}
Original file line number Diff line number Diff line change @@ -3,6 +3,50 @@ import * as React from 'react'
33import qiniuLogo from './assets/logo.svg'
44import classnames from './style.less'
55
6+ function Copyright ( ) {
7+ return (
8+ < >
9+ © { new Date ( ) . getFullYear ( ) } < a href = "https://www.qiniu.com/" rel = "noopener" target = "_blank" > 七牛云</ a >
10+ </ >
11+ )
12+ }
13+
14+ function OfficialDoc ( ) {
15+ return (
16+ < a
17+ rel = "noopener"
18+ target = "_blank"
19+ href = "http://developer.qiniu.com/code/v6/sdk/javascript.html"
20+ >
21+ 官方文档
22+ </ a >
23+ )
24+ }
25+
26+ function Issue ( ) {
27+ return (
28+ < a
29+ rel = "noopener"
30+ target = "_blank"
31+ href = "https://github.com/qiniu/js-sdk/issues"
32+ >
33+ 上报问题
34+ </ a >
35+ )
36+ }
37+
38+ function V2Link ( ) {
39+ return (
40+ < a
41+ rel = "noopener"
42+ target = "_blank"
43+ href = "http://jssdk-v2.demo.qiniu.io"
44+ >
45+ V2版本
46+ </ a >
47+ )
48+ }
49+
650interface IProps { }
751
852export function Layout ( props : React . PropsWithChildren < IProps > ) {
@@ -13,8 +57,10 @@ export function Layout(props: React.PropsWithChildren<IProps>) {
1357 { props . children }
1458 </ div >
1559 < footer className = { classnames . footer } >
16- 对象存储文件上传 DEMO
17- © { new Date ( ) . getFullYear ( ) } < a href = "https://www.qiniu.com/" rel = "noopener" target = "_blank" > 七牛云</ a >
60+ 对象存储文件上传 DEMO < Copyright />
61+ < OfficialDoc />
62+ < Issue />
63+ < V2Link />
1864 </ footer >
1965 </ >
2066 )
Original file line number Diff line number Diff line change 1919 text-align : center ;
2020
2121 a {
22- color : #777 ;
22+ color : inherit ;
23+ outline : none ;
24+ }
25+
26+ a :hover {
27+ color : rgb (44 , 178 , 255 );
2328 outline : none ;
2429 text-decoration : none ;
2530 }
31+
32+ a + a {
33+ margin-left : 0.5rem ;
34+ }
2635}
Original file line number Diff line number Diff line change @@ -8,11 +8,12 @@ interface IProps { }
88
99export function Settings ( props : IProps ) {
1010 const setting = React . useMemo ( ( ) => utils . loadSetting ( ) , [ ] )
11- const [ uphost , seUphost ] = React . useState < string | undefined > ( setting . uphost )
12- const [ deadline , setDeadline ] = React . useState < number > ( setting . deadline || 0 )
13- const [ assessKey , setAssessKey ] = React . useState < string | undefined > ( setting . assessKey )
14- const [ secretKey , setSecretKey ] = React . useState < string | undefined > ( setting . secretKey )
15- const [ bucketName , setBucketName ] = React . useState < string | undefined > ( setting . bucketName )
11+
12+ const [ deadline , setDeadline ] = React . useState < number > ( 0 )
13+ const [ uphost , seUphost ] = React . useState < string > ( setting . uphost || '' )
14+ const [ assessKey , setAssessKey ] = React . useState < string > ( setting . assessKey || '' )
15+ const [ secretKey , setSecretKey ] = React . useState < string > ( setting . secretKey || '' )
16+ const [ bucketName , setBucketName ] = React . useState < string > ( setting . bucketName || '' )
1617
1718 React . useEffect ( ( ) => {
1819 utils . saveSetting ( {
Original file line number Diff line number Diff line change @@ -4,6 +4,20 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
44const ESLintPlugin = require ( 'eslint-webpack-plugin' )
55const WebpackBar = require ( 'webpackbar' )
66
7+ const htmlTemp = `
8+ <!DOCTYPE html>
9+ <html>
10+ <head>
11+ <title state-data-title="">七牛云 - JS SDK 示例 V3</title>
12+ <meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=no">
13+ <link rel="shortcut icon" href="https://qiniu.staticfile.org/favicon.ico" type="image/vnd.microsoft.icon">
14+ </head>
15+ <body>
16+ <div id="root"></div>
17+ </body>
18+ </html>
19+ `
20+
721module . exports = {
822 context : path . join ( __dirname , 'src' ) ,
923 devtool : 'source-map' ,
@@ -70,7 +84,7 @@ module.exports = {
7084
7185 plugins : [
7286 new HtmlWebpackPlugin ( {
73- templateContent : '<!DOCTYPE html><html><body><div id="root"></div></body></html>' ,
87+ templateContent : htmlTemp ,
7488 inject : 'head'
7589 } ) ,
7690 new HotModuleReplacementPlugin ( ) ,
You can’t perform that action at this time.
0 commit comments