Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
maf
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fc9a0a73
authored
Jan 14, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
0ad3b137
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
8 deletions
+28
-8
Application/Home/Controller/IndexController.class.php
+19
-7
Application/Home/View/default/layout.tpl
+3
-0
Public/static/js/common.js
+6
-1
No files found.
Application/Home/Controller/IndexController.class.php
View file @
fc9a0a73
...
@@ -20,22 +20,33 @@ class IndexController extends Controller
...
@@ -20,22 +20,33 @@ class IndexController extends Controller
public
function
index
()
public
function
index
()
{
{
//
$user = $this->get_user_info_from_cookie();
$user
=
$this
->
get_user_info_from_cookie
();
//
//
如果没有获取到用户信息,引导用户授权
// 如果没有获取到用户信息,引导用户授权
//
if (!$user) {
if
(
!
$user
)
{
//
$this->request_auth($this->get_url());
$this
->
request_auth
(
$this
->
get_url
());
//
return;
return
;
//
}
}
session_start
();
session_start
();
$_SESSION
[
'joinTime'
]
=
time
();
$_SESSION
[
'joinTime'
]
=
time
();
$this
->
assign
(
'headimgurl'
);
$this
->
assign
(
'user_header_url'
,
$user
[
'headimgurl'
]);
$this
->
assign
(
'nickname'
,
$user
[
'nickname'
]);
$this
->
display
();
$this
->
display
();
}
}
public
function
getImage
(){
$url
=
$_GET
[
'url'
];
// $url = str_replace( 'http://wx.qlogo.cn/', 'http://wx.izhida.cn/', $url);
$data
=
$this
->
http_get_data
(
$url
);
echo
$data
;
return
;
}
public
function
cookie
()
public
function
cookie
()
{
{
SignedCookie
::
set_cookie
(
$this
->
cookie_uid_key
,
'o
Vsrlt0zUWMLvMx2-KPGVmY2I-Xc
'
,
C
(
'cookie_sign'
),
86400
*
60
);
SignedCookie
::
set_cookie
(
$this
->
cookie_uid_key
,
'o
MDOGs4ynBPiSItzoGz5FAZdlpuA
'
,
C
(
'cookie_sign'
),
86400
*
60
);
}
}
}
}
\ No newline at end of file
Application/Home/View/default/layout.tpl
View file @
fc9a0a73
...
@@ -98,6 +98,9 @@
...
@@ -98,6 +98,9 @@
<script>
<script>
window
.
base_resource_url
=
'__CDN__'
;
window
.
base_resource_url
=
'__CDN__'
;
window
.
getImageUrl
=
location
.
origin
+
'/Index/getImage'
;
window
.
user_header_url
=
'{:$user_header_url|default:""}'
;
var
link
=
location
.
origin
;
var
link
=
location
.
origin
;
var
friend_title
=
''
;
var
friend_title
=
''
;
...
...
Public/static/js/common.js
View file @
fc9a0a73
...
@@ -70,7 +70,7 @@ const fontSize = parseFloat($('html').css('fontSize'));
...
@@ -70,7 +70,7 @@ const fontSize = parseFloat($('html').css('fontSize'));
//canvas 位置
//canvas 位置
let
canvasArr
=
[
let
canvasArr
=
[
[
23
,
120
,
607
,
907
],
[
23
,
120
,
607
,
907
,
45
,
137
],
[
29
,
120
,
582
,
874
],
[
29
,
120
,
582
,
874
],
[
29
,
120
,
582
,
874
],
[
29
,
120
,
582
,
874
],
[
29
,
120
,
603
,
904
],
[
29
,
120
,
603
,
904
],
...
@@ -154,6 +154,11 @@ function createPoster() {
...
@@ -154,6 +154,11 @@ function createPoster() {
posterImg
.
src
=
'http://maf.dev.izhida.cn/Public/static/image2/poster'
+
resultType
+
'.png'
;
posterImg
.
src
=
'http://maf.dev.izhida.cn/Public/static/image2/poster'
+
resultType
+
'.png'
;
posterImg
.
onload
=
function
()
{
posterImg
.
onload
=
function
()
{
posterCtx
.
drawImage
(
posterImg
,
0
,
0
,
posterCanvas
.
width
,
posterCanvas
.
height
);
posterCtx
.
drawImage
(
posterImg
,
0
,
0
,
posterCanvas
.
width
,
posterCanvas
.
height
);
let
headimg
=
new
Image
();
headimg
.
src
=
window
.
getImageUrl
+
'?url='
+
encodeURI
(
user_header_url
);
headimg
.
onload
=
function
()
{
posterCtx
.
drawImage
(
headimg
,
designPxToRealPx
(
canvasArr
[
resultType
][
4
]),
designPxToRealPx
(
canvasArr
[
resultType
][
5
]),
designPxToRealPx
(
52
),
designPxToRealPx
(
52
));
}
}
}
}
}
...
...
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