Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
d7da4805
Commit
d7da4805
authored
Oct 09, 2016
by
汪波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.fingerage.com:999/xiabin/zuiketang
parents
6aece933
de5baa06
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
653 additions
and
100 deletions
+653
-100
Qiniu.php
src/common/components/Qiniu.php
+32
-5
Support.php
src/common/models/Support.php
+33
-1
UploadPools.php
src/common/models/UploadPools.php
+149
-0
AppAsset.php
src/frontend/assets/AppAsset.php
+0
-1
HomeController.php
src/frontend/controllers/HomeController.php
+65
-0
MyCourseController.php
src/frontend/controllers/MyCourseController.php
+2
-2
QiniuCallbackController.php
src/frontend/controllers/QiniuCallbackController.php
+66
-7
main.php
src/frontend/views/layouts/main.php
+23
-49
user-center.php
src/frontend/views/layouts/user-center.php
+12
-1
index.php
src/frontend/views/site/index.php
+57
-31
login.css
src/frontend/web/css/login.css
+211
-0
info.js
src/frontend/web/js/user-center/info.js
+2
-2
webpack.config.js
src/frontend/web/webpack.config.js
+1
-1
No files found.
src/common/components/Qiniu.php
View file @
d7da4805
...
...
@@ -71,17 +71,36 @@ class Qiniu extends Object
{
return
$this
->
generateRandomDir
()
.
'/'
.
$this
->
generateRandomName
(
$len
)
.
$ext
;
}
/**
* 获取指定存储的配置
*
* @param string $storage
* @param string $item
* @return mixed
*/
public
function
getStorageConfig
(
$storage
,
$item
=
null
)
{
if
(
!
isset
(
$this
->
storages
[
$storage
]))
{
return
null
;
}
if
(
$item
===
null
)
{
return
$this
->
storages
[
$storage
];
}
else
{
return
isset
(
$this
->
storages
[
$storage
][
$item
])
?
$this
->
storages
[
$storage
][
$item
]
:
null
;
}
}
/**
* 获取七牛上传 Token
*
* @param string $storage 要存储的空间名称
* @param string $filename 要存储的目标文件路径
* @param string $returnBody 返回的数据格式
* @param int $deadSeconds 生成的Token有效期
* @return string
*/
public
function
getUploadToken
(
$storage
,
$filename
,
$
returnBody
,
$
deadSeconds
=
3600
)
public
function
getUploadToken
(
$storage
,
$filename
,
$deadSeconds
=
3600
)
{
if
(
!
isset
(
$this
->
storages
[
$storage
]))
{
exit
(
'Unknow storage: '
.
$storage
.
"
\n
"
);
...
...
@@ -92,18 +111,26 @@ class Qiniu extends Object
$callbackUrl
=
Url
::
to
([
'qiniu-callback/rem-upload'
],
true
);
$policy
=
[
'returnBody'
=>
$returnBody
,
'returnBody'
=>
'{"key":$(key)}'
,
'saveKey'
=>
$filename
,
'fsizeLimit'
=>
$config
[
'fsizeLimit'
],
'mimeLimit'
=>
$config
[
'mimeLimit'
],
'callbackUrl'
=>
'http://t.pp.cc/tmp/qiniu_callback.php'
,
'callbackBody'
=>
'key=$(key)&fsize=$(fsize)&time=$(year)-$(mon)-$(day) $(hour)%3A$(min)%3A$(sec)'
'callbackBody'
=>
'key=$(key)&storage='
.
$storage
.
'&bucket='
.
$config
[
'bucket'
]
.
'&uuid=$(uuid)&time=$(year)-$(mon)-$(day)+$(hour)%3A$(min)%3A$(sec)&fsize=$(fsize)'
.
'&w=$(imageInfo.width)&h=$(imageInfo.height)'
];
$auth
=
$this
->
getAuthInstance
();
return
$auth
->
uploadToken
(
$config
[
'bucket'
],
null
,
$deadSeconds
,
$policy
);
}
/**
* 验证并解析 Upload Token 中的数据
*
* @param string $token
* @return mixed|null
*/
public
function
decodeUploadToken
(
$token
)
{
$arr
=
explode
(
':'
,
$token
);
...
...
src/common/models/Support.php
View file @
d7da4805
...
...
@@ -3,6 +3,8 @@
namespace
common\models
;
use
Yii
;
use
yii\behaviors\TimestampBehavior
;
use
yii\redis\ActiveRecord
;
/**
* This is the model class for table "support".
...
...
@@ -22,13 +24,30 @@ class Support extends \yii\db\ActiveRecord
return
'support'
;
}
/**
* @inheritdoc
*/
public
function
behaviors
()
{
return
[
[
'class'
=>
TimestampBehavior
::
className
(),
'attributes'
=>
[
ActiveRecord
::
EVENT_BEFORE_INSERT
=>
[
'created_at'
],
],
// if you're using datetime instead of UNIX timestamp:
// 'value' => new Expression('NOW()'),
],];
}
/**
* @inheritdoc
*/
public
function
rules
()
{
return
[
[[
'user_id'
,
'courseware_id'
,
'created_at'
],
'required'
],
[[
'user_id'
,
'courseware_id'
,],
'required'
],
[[
'user_id'
,
'courseware_id'
,
'created_at'
],
'integer'
],
];
}
...
...
@@ -45,4 +64,17 @@ class Support extends \yii\db\ActiveRecord
'created_at'
=>
'Created At'
,
];
}
/**
* 获取该课程是否点赞
* @param $userId
* @param $coursewareId
* @return mixed
*/
public
static
function
findByUserIdAndCoursewareId
(
$userId
,
$coursewareId
)
{
return
self
::
find
()
->
select
(
'id,user_id,courseware_id,created_at'
)
->
where
(
"user_id=:user_id and courseware_id=:courseware_id"
,
[
'user_id'
=>
$userId
,
'courseware_id'
=>
$coursewareId
])
->
asArray
()
->
one
();
}
}
src/common/models/UploadPools.php
0 → 100644
View file @
d7da4805
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 16/10/9
* Time: 10:10
*/
namespace
common\models
;
use
yii\db\ActiveRecord
;
/**
* 文件上传池模型
*
* 当使用本地七牛接口上传文件后,七牛的通知会自动在本地上传池中生成文件信息,并等待被认领确认使用
* 若超过24小时的非使用中状态文件,会被自动删除以防止产生过多的垃圾文件
*
* @property string $uuid
* @property string $skey 存储键名,使用 Storage:Key 的方式连接,如 public:preview/30/27/3e/ZuofZkkK5721.jpg
* @property int $filesize
* @property int $status 文件状态:0未认领,1使用中,2已废弃(待删除)
* @property int $upload_timeg
* @package common\models
*/
class
UploadPools
extends
ActiveRecord
{
const
STATUS_UNUSE
=
0
;
//未认领状态
const
STATUS_USED
=
1
;
//使用中状态
const
STATUS_DELETED
=
2
;
//待删除状态
/**
* @inheritdoc
*/
public
static
function
tableName
()
{
return
'upload_pools'
;
}
public
function
rules
()
{
return
[
[[
'uuid'
,
'skey'
,
'filesize'
,
'upload_time'
],
'required'
],
[
'skey'
,
'validateSkey'
]
];
}
public
function
validateSkey
(
$attr
,
$params
)
{
if
(
!
preg_match
(
'/^\w+:[\w\.\/]+$/'
,
$this
->
$attr
))
{
$this
->
addError
(
$attr
,
"
$attr
format is not a validate skey."
);
}
}
/**
* 获取上传池中的文件
*
* @param string $uuid
* @return array
*/
public
static
function
getFileInfo
(
$uuid
)
{
$file
=
self
::
findOne
([
'uuid'
=>
$uuid
]);
if
(
$file
)
{
$file
=
$file
->
toArray
();
list
(
$file
[
'storage'
],
$file
[
'key'
])
=
explode
(
':'
,
$file
[
'skey'
]);
$file
[
'url'
]
=
\Yii
::
$app
->
qiniu
->
getStorageConfig
(
$file
[
'storage'
],
'url'
)
.
$file
[
'key'
];
}
return
$file
;
}
/**
* 认领文件
*
* 只有未认领的文件才可被认领
* 认领后该文件会被标记为已使用并且不可再被认领
*
* @param string $uuid 文件 uuid
* @return array|false 认领成功返回文件信息,认领失败返回 false
*/
public
static
function
claimFile
(
$uuid
)
{
$file
=
self
::
findOne
([
'uuid'
=>
$uuid
]);
return
self
::
claimFileConfirm
(
$file
);
}
/**
* 使用 skey 认领文件
*
* 详情见 UploadPools::claimFile()
*
* @see UploadPools::claimFile()
* @param string $skey 文件 skey
* @return array|false 认领成功返回文件信息,认领失败返回 false
*/
public
static
function
claimFileBySkey
(
$skey
)
{
$file
=
self
::
find
()
->
where
([
'skey'
=>
$skey
])
->
one
();
return
self
::
claimFileConfirm
(
$file
);
}
/**
* 删除存储的文件
*
* 删除仅是对文件做弃用标记,该文件会在过一段时间后被计划任务彻底删除
*
* @param string $skey
* @return bool
*/
public
static
function
deleteFile
(
$skey
)
{
$file
=
self
::
find
()
->
where
([
'skey'
=>
$skey
])
->
one
();
if
(
!
$file
)
{
$file
=
new
self
();
$file
->
uuid
=
self
::
findBySql
(
'SELECT UUID() AS uuid'
)
->
one
()
->
uuid
;
$file
->
skey
=
$skey
;
$file
->
filesize
=
0
;
}
$file
->
status
=
self
::
STATUS_DELETED
;
$file
->
upload_time
=
time
();
return
$file
->
save
();
}
public
static
function
getSkey
(
$storage
,
$key
)
{
return
$storage
.
':'
.
$key
;
}
/**
* @param ActiveRecord $file
* @return array|false 认领成功返回文件信息,认领失败返回 false
*/
protected
static
function
claimFileConfirm
(
$file
)
{
if
(
$file
&&
$file
->
status
==
self
::
STATUS_UNUSE
)
{
$file
->
status
=
self
::
STATUS_USED
;
$file
->
save
();
return
$file
->
toArray
();
}
return
false
;
}
}
\ No newline at end of file
src/frontend/assets/AppAsset.php
View file @
d7da4805
...
...
@@ -14,7 +14,6 @@ class AppAsset extends AssetBundle
public
$baseUrl
=
'@web/assets'
;
public
$css
=
[
'css/style.css'
];
public
$js
=
[
...
...
src/frontend/controllers/HomeController.php
View file @
d7da4805
...
...
@@ -2,6 +2,10 @@
namespace
frontend\controllers
;
use
common\models\Support
;
use
Yii
;
use
common\libs\Utils
;
class
HomeController
extends
\yii\web\Controller
{
public
function
actionIndex
()
...
...
@@ -9,4 +13,65 @@ class HomeController extends \yii\web\Controller
return
$this
->
render
(
'index'
);
}
/**
* 点赞或者取消点赞
* @param $coursewareId
* @throws \yii\web\ForbiddenHttpException
*/
public
function
actionSupport
(
$coursewareId
)
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
$userId
=
Yii
::
$app
->
user
->
identity
->
getId
();
$support
=
Support
::
findByUserIdAndCoursewareId
(
$userId
,
$coursewareId
);
//没有点赞则点赞否则则取消点赞
if
(
count
(
$support
)
===
0
)
{
$support
=
new
Support
();
$support
->
user_id
=
$userId
;
$support
->
courseware_id
=
$coursewareId
;
$support
->
save
();
}
else
{
Support
::
deleteAll
(
'id=:id'
,
[
'id'
=>
$support
[
'id'
]]);
}
Utils
::
ajaxResponse
(
TRUE
);
}
else
{
throw
new
\yii\web\ForbiddenHttpException
(
'非法请求'
);
}
}
/**
* 收藏
* @param $courseId
* @throws \yii\web\ForbiddenHttpException
*/
public
function
actionFavorite
(
$courseId
)
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
$userId
=
Yii
::
$app
->
user
->
identity
->
getId
();
Utils
::
ajaxResponse
(
TRUE
,
$courseId
,
$userId
);
}
else
{
throw
new
\yii\web\ForbiddenHttpException
(
'非法请求'
);
}
}
/**
* 评论
* @throws \yii\web\ForbiddenHttpException
*/
public
function
actionComments
()
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
$userId
=
Yii
::
$app
->
user
->
identity
->
getId
();
Utils
::
ajaxResponse
(
TRUE
,
''
,
$userId
);
}
else
{
throw
new
\yii\web\ForbiddenHttpException
(
'非法请求'
);
}
}
}
src/frontend/controllers/MyCourseController.php
View file @
d7da4805
...
...
@@ -25,12 +25,12 @@ class MyCourseController extends \yii\web\Controller
//图片上传Token
//$imgName = 'preview/'.$qiniu->genRandomDir().'/'.Yii::$app->security->generateRandomString(20);
$imgPath
=
'preview/'
.
$qiniu
->
generateRandomFilePath
(
'$(min)$(sec)$(ext)'
,
8
);
$thumbToken
=
$qiniu
->
getUploadToken
(
'public'
,
$imgPath
,
$returnBody
,
3600
,
true
);
$thumbToken
=
$qiniu
->
getUploadToken
(
'public'
,
$imgPath
,
3600
,
true
);
//视频上传Token
//$videoName = 'source/'.$qiniu->genRandomDir().'/'.Yii::$app->security->generateRandomString(20);
$videoName
=
'source/'
.
$qiniu
->
generateRandomFilePath
(
'$(ext)'
);
$videoToken
=
$qiniu
->
getUploadToken
(
'video'
,
$videoName
,
$returnBody
,
86400
);
$videoToken
=
$qiniu
->
getUploadToken
(
'video'
,
$videoName
,
86400
);
$model
=
new
CoursePublishForm
();
return
$this
->
render
(
'publish'
,
compact
(
'model'
,
'thumbToken'
,
'videoToken'
));
...
...
src/frontend/controllers/QiniuCallbackController.php
View file @
d7da4805
...
...
@@ -7,9 +7,14 @@
*/
namespace
frontend\controllers
;
use
yii\helpers\Url
;
use
Yii
;
use
yii\web\Response
;
use
common\models\UploadPools
;
class
QiniuCallbackController
extends
\yii\web\Controller
{
class
QiniuCallbackController
extends
\yii\web\Controller
{
public
$enableCsrfValidation
=
false
;
/**
* 上传回调 - 记录上传的文件
...
...
@@ -19,18 +24,72 @@ class QiniuCallbackController extends \yii\web\Controller {
public
function
actionRemUpload
()
{
/* @var \Qiniu\Auth $auth */
$auth
=
\Yii
::
$app
->
qiniu
->
getAuthInstance
();
$auth
=
Yii
::
$app
->
qiniu
->
getAuthInstance
();
$response
=
Yii
::
$app
->
response
;
$response
->
format
=
Response
::
FORMAT_JSON
;
//验证回调请求
$requestBody
=
file_get_contents
(
'php://input'
);
$authorization
=
isset
(
$_SERVER
[
'HTTP_AUTHORIZATION'
])
?
$_SERVER
[
'HTTP_AUTHORIZATION'
]
:
''
;
$currentUrl
=
\Yii
::
$app
->
request
->
hostInfo
.
\Yii
::
$app
->
request
->
getUrl
();
$currentUrl
=
Yii
::
$app
->
request
->
hostInfo
.
Yii
::
$app
->
request
->
getUrl
();
$currentUrl
=
'http://t.pp.cc/tmp/qiniu_callback.php'
;
if
(
!
$auth
->
verifyCallback
(
$_SERVER
[
'CONTENT_TYPE'
],
$authorization
,
$currentUrl
,
$requestBody
))
{
return
[
'error'
=>
'回调验证失败!'
];
}
$post
=
Yii
::
$app
->
request
->
post
();
//检查是否存在相同的uuid
$data
=
UploadPools
::
findOne
(
$post
[
'uuid'
]);
if
(
$data
)
{
return
$this
->
responseCallback
(
$data
);
}
//保存新文件信息
$model
=
new
UploadPools
();
$model
->
skey
=
$post
[
'storage'
]
.
':'
.
$post
[
'key'
];
$model
->
filesize
=
$post
[
'fsize'
];
$model
->
uuid
=
$post
[
'uuid'
];
$model
->
upload_time
=
strtotime
(
$post
[
'time'
]);
//图片的宽高信息
$post
[
'w'
]
&&
$model
->
w
=
$post
[
'w'
];
$post
[
'h'
]
&&
$model
->
h
=
$post
[
'h'
];
if
(
$
auth
->
verifyCallback
(
$_SERVER
[
'CONTENT_TYPE'
],
$authorization
,
$currentUrl
,
$requestBody
))
{
echo
'ok'
;
if
(
$
model
->
save
(
))
{
return
$this
->
responseCallback
(
$model
)
;
}
else
{
echo
'no'
;
return
[
'error'
=>
join
(
"
\n
"
,
$model
->
errors
)]
;
}
}
/**
* 响应回调成功的信息
*
* 公开资源会返回文件 key,原始链接和图片宽高等信息,私有资源只返回 uuid 和文件尺寸
* 私有资源使用得到的 uuid 通过 UploadPools::getFileInfo() 或者 UploadPools::claimFile() 认领文件获取文件详细信息
* 需要其它更详细的信息调用七牛云 API 获取
*
* @param $model
* @return array
*/
private
function
responseCallback
(
$model
)
{
$return
=
[
'uuid'
=>
$model
->
uuid
,
'filesize'
=>
$model
->
filesize
];
list
(
$storage
,
$key
)
=
explode
(
':'
,
$model
->
skey
);
//public
if
(
$storage
!=
'video'
)
{
$return
[
'key'
]
=
$key
;
$return
[
'src'
]
=
Yii
::
$app
->
qiniu
->
getStorageConfig
(
$storage
,
'url'
)
.
$key
;
$return
[
'w'
]
=
$model
->
w
;
$return
[
'h'
]
=
$model
->
h
;
}
return
$return
;
}
}
\ No newline at end of file
src/frontend/views/layouts/main.php
View file @
d7da4805
...
...
@@ -11,14 +11,22 @@ use frontend\assets\AppAsset;
use
common\widgets\Alert
;
AppAsset
::
register
(
$this
);
AppAsset
::
addCss
(
$this
,
'@web/assets/css/site.css'
);
AppAsset
::
addCss
(
$this
,
'@web/assets/css/login_css.css'
);
?>
<?php
$this
->
beginPage
()
?>
<!DOCTYPE html>
<html>
<html
lang=
"
<?=
Yii
::
$app
->
language
?>
"
>
<head
>
<title>
注册/登录
</title
>
<meta
charset=
"
<?=
Yii
::
$app
->
charset
?>
"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
name=
"description"
content=
""
>
<meta
name=
"keywords"
content=
""
>
<!-- Use latest IE randering angine and switch on chrome Frame if available -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<link
rel=
"shortcut icon"
href=
"
<?=
AppAsset
::
getStaticUrl
(
'img/favicon.ico'
)
?>
"
>
<?=
Html
::
csrfMetaTags
()
?>
<title>
<?=
Html
::
encode
(
$this
->
title
)
?>
</title>
<?php
$this
->
head
()
?>
...
...
@@ -26,56 +34,22 @@ AppAsset::addCss($this, '@web/assets/css/site.css');
<body>
<?php
$this
->
beginBody
()
?>
<div
class=
"wrap"
>
<?php
NavBar
::
begin
([
'brandLabel'
=>
'My Company'
,
'brandUrl'
=>
Yii
::
$app
->
homeUrl
,
'options'
=>
[
'class'
=>
'navbar-inverse navbar-fixed-top'
,
],
]);
$menuItems
=
[
[
'label'
=>
'Home'
,
'url'
=>
[
'/site/index'
]],
[
'label'
=>
'About'
,
'url'
=>
[
'/site/about'
]],
[
'label'
=>
'Contact'
,
'url'
=>
[
'/site/contact'
]],
];
if
(
Yii
::
$app
->
user
->
isGuest
)
{
$menuItems
[]
=
[
'label'
=>
'Signup'
,
'url'
=>
[
'/site/signup'
]];
$menuItems
[]
=
[
'label'
=>
'Login'
,
'url'
=>
[
'/site/login'
]];
}
else
{
$menuItems
[]
=
'<li>'
.
Html
::
beginForm
([
'/site/logout'
],
'post'
)
.
Html
::
submitButton
(
'Logout ('
.
Yii
::
$app
->
user
->
identity
->
username
.
')'
,
[
'class'
=>
'btn btn-link'
]
)
.
Html
::
endForm
()
.
'</li>'
;
}
echo
Nav
::
widget
([
'options'
=>
[
'class'
=>
'navbar-nav navbar-right'
],
'items'
=>
$menuItems
,
]);
NavBar
::
end
();
?>
<nav
class=
"navbar navbar-main navbar-static-top"
>
<div
class=
"logo pull-left"
>
云涯 YunYa
</div>
<ul
class=
"nav navbar-nav pull-right yun-login-btn"
>
<li><a
href=
"#"
>
登录
</a></li>
<li
class=
"active"
><a
href=
"#"
>
注册
</a></li>
</ul>
</nav>
<div
class=
"container"
>
<?=
$content
?>
<div
class=
"container"
>
<?=
Breadcrumbs
::
widget
([
'links'
=>
isset
(
$this
->
params
[
'breadcrumbs'
])
?
$this
->
params
[
'breadcrumbs'
]
:
[],
])
?>
<?=
Alert
::
widget
()
?>
<?=
$content
?>
</div>
</div>
<footer
class=
"footer"
>
<div
class=
"container"
>
<p
class=
"pull-left"
>
©
My Company
<?=
date
(
'Y'
)
?>
</p>
<p
class=
"pull-right"
>
<?=
Yii
::
powered
()
?>
</p>
</div>
</footer>
<?php
$this
->
endBody
()
?>
</body>
...
...
src/frontend/views/layouts/user-center.php
View file @
d7da4805
...
...
@@ -7,6 +7,17 @@ use frontend\assets\AppAsset;
/* @var $content string */
AppAsset
::
register
(
$this
);
AppAsset
::
addCss
(
$this
,
'@web/assets/css/style.css'
);
//$assetsUrl = Yii::$app->assetManager->baseUrl.'/assets';
//
//$js = <<<JS
//var global = (function () {
// this.static_url = "$assetsUrl";
//})();
//JS;
//
//$this->registerJs($js, View::POS_HEAD);
$js
=
<<<JS
$(function() {
...
...
@@ -39,7 +50,7 @@ $this->registerJs($js, View::POS_END);
?>
<?php
$this
->
beginPage
()
?>
<!DOCTYPE html>
<html
lang=
"
<?=
Yii
::
$app
->
language
?>
"
>
<html
lang=
"
<?=
\
Yii
::
$app
->
language
?>
"
>
<head>
<meta
charset=
"
<?=
Yii
::
$app
->
charset
?>
"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
...
...
src/frontend/views/site/index.php
View file @
d7da4805
...
...
@@ -2,52 +2,78 @@
/* @var $this yii\web\View */
$this
->
title
=
'
My Yii Application
'
;
$this
->
title
=
'
云崖
'
;
?>
<div
class=
"site-index"
>
<div
class=
"z-m-center"
>
<h3>
云涯
</h3>
<p>
欢迎来到最课堂,专注在线直播
</p>
<div
class=
"jumbotron"
>
<h1>
Congratulations!
</h1>
<p
class=
"lead"
>
You have successfully created your Yii-powered application.
</p>
<p><a
class=
"btn btn-lg btn-success"
href=
"http://www.yiiframework.com"
>
Get started with Yii
</a></p>
<div
id=
"myTab"
class=
"tab-a"
>
<ul>
<li><a
href=
"#login"
data-toggle=
"tab"
>
登录
</a></li>
<li
class=
"active"
><a
href=
"#register"
data-toggle=
"tab"
>
注册
</a></li>
</ul>
</div>
<div
class=
"
body-c
ontent"
>
<div
class=
"
tab-content"
id=
"myTabC
ontent"
>
<div
class=
"row"
>
<div
class=
"col-lg-4"
>
<h2>
Heading
</h2>
<div
class=
"tab-pane fade"
id=
"login"
>
<div
class=
"reg-box"
>
<div
class=
"phone input-wrapper"
>
<input
type=
"text"
class=
""
placeholder=
"手机号码"
required=
""
autofocus=
""
>
<span
class=
"tips"
>
手机号或者密码错误
</span>
</div>
<div
class=
"password input-wrapper last-wrapper"
>
<input
type=
"password"
class=
""
placeholder=
"密码"
required=
""
>
</div>
</div>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.
</p>
<div
class=
"checkbox part-wap"
>
<label>
<input
type=
"checkbox"
value=
"remember-me"
>
记住密码
</label>
<a
href=
"#"
>
忘记密码?
</a>
</div>
<p><a
class=
"btn btn-default"
href=
"http://www.yiiframework.com/doc/"
>
Yii Documentation
»
</a></p>
<div
class=
"foot-reg-btn"
>
<button
class=
"btn btn-log"
type=
"submit"
>
登录
</button>
</div>
<div
class=
"col-lg-4"
>
<h2>
Heading
</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.
</p>
<div
class=
"div-line"
>
或
</div>
<p><a
class=
"btn btn-default"
href=
"http://www.yiiframework.com/forum/"
>
Yii Forum
»
</a></p>
<div
class=
"foot-reg-btn"
>
<button
class=
"btn btn-reg"
type=
"submit"
>
微信登录
</button>
</div>
<div
class=
"col-lg-4"
>
<h2>
Heading
</h2>
</div>
<div
class=
"tab-pane fade in active"
id=
"register"
>
<div
class=
"reg-box"
>
<div
class=
"phone input-wrapper"
>
<input
type=
"text"
class=
""
placeholder=
"手机号码"
required=
""
autofocus=
""
>
<span
class=
"tips"
>
手机号或者密码错误
</span>
</div>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.
</p>
<div
class=
"v-code input-wrapper"
>
<input
type=
"text"
class=
""
placeholder=
"验证码"
required=
""
>
<button
class=
"btn btn-get-vcode"
>
获取验证码
</button>
<span
class=
"tips tip-vcode"
>
验证码错误
</span>
</div>
<p><a
class=
"btn btn-default"
href=
"http://www.yiiframework.com/extensions/"
>
Yii Extensions
»
</a></p>
<div
class=
"password input-wrapper"
>
<input
type=
"password"
class=
""
placeholder=
"输入密码"
required=
""
>
</div>
<div
class=
"check-password input-wrapper last-wrapper"
>
<input
type=
"password"
class=
""
placeholder=
"再次输入密码"
required=
""
>
</div>
</div>
<div
class=
"foot-reg-btn"
>
<button
class=
"btn btn-reg"
type=
"submit"
>
注册
</button>
</div>
</div>
</div>
</div>
src/frontend/web/css/login.css
0 → 100644
View file @
d7da4805
@charset
"utf-8"
;
body
{
font-family
:
"Microsoft YaHei"
,
"Helvitica Neue"
,
Helvitica
,
Arial
,
"Hiragino Sans GB"
,
"Arial Regular"
,
"Microsoft JhengHei"
,
sans-serif
;
background-color
:
#f7f8fa
;
}
a
,
a
:hover
,
a
:link
{
text-decoration
:
none
;
}
.navbar-main
{
background-color
:
#fff
;
box-shadow
:
0
0
30px
rgba
(
0
,
0
,
0
,
.05
);
}
.logo
{
line-height
:
50px
;
margin-left
:
30px
;
}
.yun-login-btn
{
margin-right
:
30px
;
}
.yun-login-btn
li
a
{
color
:
#333
;
}
.yun-login-btn
li
:last-child
a
{
background-color
:
#34bf49
;
color
:
#fff
;
}
.z-m-center
{
text-align
:
center
;
}
.z-m-center
>
p
{
font-size
:
12px
;
padding
:
0
0
20px
;
color
:
#999
;
}
.tab-a
ul
,
li
,
.tab-find
ul
,
li
{
list-style
:
none
;
margin
:
0
;
padding
:
0
;
}
.tab-a
li
,
.tab-find
li
{
display
:
inline-block
;
margin-right
:
25px
;
}
.tab-a
li
:last-child
,
.tab-find
li
:last-child
{
margin-right
:
0
;
}
.tab-a
a
{
display
:
inline-block
;
color
:
#333
;
height
:
60px
;
line-height
:
60px
;
padding
:
0
5px
;
border-bottom
:
2px
solid
transparent
;
}
.tab-a
li
.active
a
{
border-bottom
:
2px
solid
#2a6496
;
}
.tab-find
{
margin-top
:
20px
;
}
.tab-find
a
{
display
:
inline-block
;
width
:
50px
;
height
:
50px
;
text-align
:
center
;
line-height
:
50px
;
background-color
:
#fff
;
border-radius
:
100%
;
}
.tab-find
li
.active
a
{
background-color
:
#4285f4
;
color
:
#fff
;
}
.tab-pane
{
margin-top
:
40px
;
}
.form-register
{
width
:
300px
;
display
:
inline-block
;
border
:
1px
solid
#d5d5d5
;
border-radius
:
3px
;
background-color
:
#fff
;
}
.reg-box
{
width
:
300px
;
display
:
inline-block
;
border
:
1px
solid
#d5d5d5
;
border-radius
:
3px
;
background
:
#fff
;
}
.input-wrapper
{
position
:
relative
;
border
:
0
;
border-radius
:
0
;
box-shadow
:
none
;
}
.input-wrapper
input
{
width
:
100%
;
height
:
50px
;
line-height
:
50px
;
border
:
none
;
border-bottom
:
1px
solid
#f3f3f3
;
text-indent
:
10px
;
font-size
:
14px
;
background-color
:
transparent
;
outline
:
none
;
}
.last-wrapper
input
{
border-bottom
:
none
;
}
.input-wrapper
span
.tips
{
display
:
inline-block
;
height
:
50px
;
line-height
:
50px
;
position
:
absolute
;
right
:
0
;
top
:
0
;
padding
:
0
10px
;
color
:
#f03434
;
font-size
:
12px
;
}
.input-wrapper
span
.tip-vcode
{
right
:
85px
;
}
.btn-get-vcode
{
position
:
absolute
;
top
:
0
;
right
:
0
;
background-color
:
transparent
;
height
:
50px
;
border-radius
:
0
;
border
:
none
;
border-left
:
1px
solid
#f3f3f3
;
outline
:
none
;
font-size
:
12px
;
color
:
#2a6496
;
}
.foot-reg-btn
{
margin-top
:
20px
;
}
.btn-reg
{
width
:
300px
;
height
:
44px
;
line-height
:
44px
;
padding
:
0
;
background-color
:
#34bf49
;
color
:
#fff
;
}
.btn-reg
:hover
{
background-color
:
#31b445
;
color
:
#fff
;
}
.btn-log
{
width
:
300px
;
height
:
44px
;
line-height
:
44px
;
padding
:
0
;
background-color
:
#4285f4
;
color
:
#fff
;
}
.btn-log
:hover
{
background-color
:
#3f7de4
;
color
:
#fff
;
}
.part-wap
{
width
:
300px
;
margin
:
20px
auto
0
;
text-align
:
left
;
}
.part-wap
a
{
float
:
right
;
}
.div-line
{
margin-top
:
20px
;
color
:
#999
;
font-size
:
12px
;
}
.sucess-box
span
{
display
:
inline-block
;
height
:
50px
;
width
:
50px
;
border-radius
:
100%
;
background-color
:
#34bf49
;
line-height
:
50px
;
text-align
:
center
;
font-size
:
24px
;
color
:
#fff
;
}
.sucess-box
p
{
line-height
:
30px
;
font-size
:
12px
;
color
:
#34bf49
;
padding-bottom
:
20px
;
}
src/frontend/web/js/user-center/info.js
View file @
d7da4805
...
...
@@ -3,8 +3,8 @@
*/
layer
.
msg
(
'玩命提示中'
);
var
token
=
$
(
'#avatar-uploader'
).
attr
(
'token'
);
require
.
ensure
(
'../
single-lib
/plupload/plupload.full.min.js'
,
function
()
{
require
(
'script!../
single-lib
/plupload/plupload.full.min.js'
);
require
.
ensure
(
'../
libs
/plupload/plupload.full.min.js'
,
function
()
{
require
(
'script!../
libs
/plupload/plupload.full.min.js'
);
var
uploader
=
new
plupload
.
Uploader
({
runtimes
:
'html5,flash,html4'
,
browse_button
:
'avatar-uploader'
,
...
...
src/frontend/web/webpack.config.js
View file @
d7da4805
...
...
@@ -10,7 +10,7 @@ var ExtractTextPlugin = require("extract-text-webpack-plugin");
var
entry
=
{
vendor
:
[
"jquery"
,
"vue"
,
js_dir
+
"/utils/layer"
],
site
:
[
css_dir
+
'/site
.css'
],
login_css
:
[
css_dir
+
'/login
.css'
],
style
:
[
css_dir
+
'/reset.css'
,
css_dir
+
'/style.css'
],
signup
:
[
js_dir
+
'/site/signup.js'
],
login
:
[
js_dir
+
'/site/login.js'
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment