切换导航条
此项目
正在载入...
登录
郭盛
/
resource
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
魏强
5 years ago
提交
ebe3a617fcd85054f38ca89542ab020f57bca92d
2 个父辈
3e2fd20d
db0e2011
1 个管道 的构建
通过
耗费 0 秒
Merge branch 'master' of
http://114.215.101.231:8099/guosheng/resource
变更
6
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
66 行增加
和
9 行删除
api/config.php
api/index/controller/ResourceController.php
api/wxapp/controller/PublicController.php
app/user/controller/AdminIndexController.php
data/lang/zh-cn/admin_menu.php
public/themes/admin_simpleboot3/user/admin_index/index.html
api/config.php
查看文件 @
ebe3a61
...
...
@@ -255,4 +255,8 @@ return [
'cmf_default_theme'
=>
'simpleboot3'
,
'cmf_admin_theme_path'
=>
'themes/admin/'
,
'cmf_admin_default_theme'
=>
'simpleboot3'
,
//小程序配置
'app_id'
=>
'wxd4445f65df16adca'
,
'app_secret'
=>
'68043ad6055fd24e25d86c171a1a2057'
,
];
...
...
api/index/controller/ResourceController.php
查看文件 @
ebe3a61
...
...
@@ -86,7 +86,8 @@ class ResourceController extends RestBaseController
*
* @header name:XX-Token require:1 default: desc:token
*
* @param name:city type:int require:0 other: desc:当前城市ID(默认为当前城市,如果不授权默认为全国)
* @param name:lng type:string require:0 other: desc:当前城市经度(默认为当前城市,如果不授权默认为全国)
* @param name:lat type:string require:0 other: desc:当前城市纬度(默认为当前城市,如果不授权默认为全国)
* @param name:page type:int require:0 other: desc:当前页(默认1)
* @param name:pageNum type:int require:0 other: desc:每页显示数据个数(默认10)
*
...
...
@@ -98,12 +99,19 @@ class ResourceController extends RestBaseController
*/
public
function
index
()
{
$user_id
=
$this
->
getUserId
();
//
$user_id = $this->getUserId();
$page
=
$this
->
request
->
param
(
'page'
,
1
,
'intval'
);
$pageNum
=
$this
->
request
->
param
(
'pageNum'
,
10
,
'intval'
);
$city
=
$this
->
request
->
param
(
'city_id'
);
if
(
!
empty
(
$city
)){
$where
[
'city'
]
=
[
'like'
,
"%
$city
%"
];
$param
=
$this
->
request
->
param
();
if
(
!
empty
(
$param
[
'lng'
])){
if
(
empty
(
$param
[
'lat'
])){
$this
->
error
([
'code'
=>
40005
,
'msg'
=>
'确实必要参数'
]);
}
$city
=
Db
::
name
(
'area'
)
->
where
(
'lng'
,
$param
[
'lng'
])
->
where
(
'lat'
,
$param
[
'lat'
])
->
find
();
$where
[
'city'
]
=
[
'like'
,
"%
$city[id]%"]
;
}
$where['delete_time']
= ['eq',0];
$where['job_type']
= ['in',[1,2,3,4]];
...
...
@@ -116,6 +124,7 @@ class ResourceController extends RestBaseController
->page(
$page
,
$pageNum
)
->select()
->toArray();
foreach (
$list
as
$k
=>
$v
){
$list[$k]['create_time']
= date('Y-m-d',
$v['create_time']
);
}
...
...
api/wxapp/controller/PublicController.php
查看文件 @
ebe3a61
...
...
@@ -175,4 +175,50 @@ class PublicController extends RestBaseController
}
/**
* @title 通过code获取token
* @description 通过code获取token
* @author Tiger Yang
* @url /wxapp/public/getToken
* @method POST
*
* @param name:code type:string require:1 other: desc:code
*
* @return is_register:是否注册(0未注册,1已注册)
* @return token:token
*/
public
function
getToken
(){
$validate
=
new
Validate
([
'code'
=>
'require'
,
]);
$validate
->
message
([
'code.require'
=>
'缺少参数code!'
,
]);
$data
=
$this
->
request
->
param
();
if
(
!
$validate
->
check
(
$data
))
{
$this
->
error
([
'code'
=>
'40003'
,
'msg'
=>
$validate
->
getError
()]);
}
$code
=
$data
[
'code'
];
$appId
=
config
(
'app_id'
);
$appSecret
=
config
(
'app_secret'
);
$response
=
cmf_curl_get
(
"https://api.weixin.qq.com/sns/jscode2session?appid=
$appId
&secret=
$appSecret
&js_code=
$code
&grant_type=authorization_code"
);
$response
=
json_decode
(
$response
,
true
);
if
(
!
empty
(
$response
[
'errcode'
]))
{
$this
->
error
([
'code'
=>
'41001'
,
'msg'
=>
'操作失败:'
.
$response
[
'errcode'
]]);
}
$third_party_user
=
Db
::
name
(
'third_party_user'
)
->
where
([
'openid'
=>
$response
[
'openid'
]])
->
find
();
if
(
empty
(
$third_party_user
)){
$this
->
success
(
'SUCCESS'
,[
'is_register'
=>
0
]);
}
$user_token
=
Db
::
name
(
'user_token'
)
->
where
([
'user_id'
=>
$third_party_user
[
'user_id'
],
'device_type'
=>
'wxapp'
])
->
find
();
$data
[
'is_register'
]
=
1
;
$data
[
'token'
]
=
$user_token
[
'token'
];
$this
->
success
(
'SUCCESS'
,
$data
);
}
}
...
...
app/user/controller/AdminIndexController.php
查看文件 @
ebe3a61
...
...
@@ -88,9 +88,6 @@ class AdminIndexController extends AdminBaseController
// $list[$k]['authentication'] = 0;
// }
// }
//
//
//
// 获取分页显示
$page
=
$list
->
render
();
...
...
data/lang/zh-cn/admin_menu.php
查看文件 @
ebe3a61
...
...
@@ -99,6 +99,7 @@ return array (
'ADMIN_SLIDEITEM_EDITPOST'
=>
'幻灯片页面编辑提交'
,
'ADMIN_SLIDEITEM_INDEX'
=>
'幻灯片页面列表'
,
'ADMIN_SLIDEITEM_LISTORDER'
=>
'幻灯片页面排序'
,
'ADMIN_STATISTIC_INDEX'
=>
'信息统计'
,
'ADMIN_STORAGE_INDEX'
=>
'文件存储'
,
'ADMIN_STORAGE_SETTINGPOST'
=>
'文件存储设置提交'
,
'ADMIN_THEME_ACTIVE'
=>
'启用模板'
,
...
...
public/themes/admin_simpleboot3/user/admin_index/index.html
查看文件 @
ebe3a61
...
...
@@ -28,7 +28,7 @@
<th>
{:lang('REGISTRATION_TIME')}
</th>
<th>
{:lang('LAST_LOGIN_TIME')}
</th>
<th>
{:lang('LAST_LOGIN_IP')}
</th>
<th>
{:lang('STATUS')}
</th>
<th>
用户状态
</th>
<th>
认证状态
</th>
<th>
{:lang('ACTIONS')}
</th>
</tr>
...
...
请
注册
或
登录
后发表评论