...
|
...
|
@@ -9,6 +9,7 @@ use fast\Random; |
|
|
use think\Config;
|
|
|
use app\common\model\Attachment;
|
|
|
use addons\qiniu\library\Auth;
|
|
|
use think\Db;
|
|
|
|
|
|
/**
|
|
|
* 公共接口
|
...
|
...
|
@@ -22,8 +23,8 @@ class Common extends Api |
|
|
* 加载初始化
|
|
|
*
|
|
|
* @param string $version 版本号
|
|
|
* @param string $lng 经度
|
|
|
* @param string $lat 纬度
|
|
|
* @param string $lng 经度
|
|
|
* @param string $lat 纬度
|
|
|
*/
|
|
|
public function init()
|
|
|
{
|
...
|
...
|
@@ -31,10 +32,10 @@ class Common extends Api |
|
|
$lng = $this->request->request('lng');
|
|
|
$lat = $this->request->request('lat');
|
|
|
$content = [
|
|
|
'citydata' => Area::getCityFromLngLat($lng, $lat),
|
|
|
'citydata' => Area::getCityFromLngLat($lng, $lat),
|
|
|
'versiondata' => Version::check($version),
|
|
|
'uploaddata' => Config::get('upload'),
|
|
|
'coverdata' => Config::get("cover"),
|
|
|
'uploaddata' => Config::get('upload'),
|
|
|
'coverdata' => Config::get("cover"),
|
|
|
];
|
|
|
$this->success('', $content);
|
|
|
} else {
|
...
|
...
|
@@ -162,4 +163,15 @@ class Common extends Api |
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
public function BindWeChar()
|
|
|
{
|
|
|
$user_id = $this->is_token($this->request->header());
|
|
|
$res = Db::name('user')->where('id', $user_id)->update(['openid' => '']);
|
|
|
if ($res) {
|
|
|
$this->success('成功', 1);
|
|
|
} else {
|
|
|
$this->error('失败', 0);
|
|
|
}
|
|
|
}
|
|
|
} |
...
|
...
|
|