|
@@ -22,7 +22,17 @@ class Applet extends Base
|
|
|
*/
|
|
|
public function bind()
|
|
|
{
|
|
|
- $applet = Dever::config('base', 'project')->applet;
|
|
|
+ $token = Dever::project('token');
|
|
|
+ $applet = array();
|
|
|
+ if ($token) {
|
|
|
+ $applet = Dever::db('token/project')->one(Dever::input('appid', 1));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!$applet) {
|
|
|
+ $applet = Dever::config('base', 'project')->applet;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
$appid = $applet['appid'];
|
|
|
$secret = $applet['secret'];
|
|
|
$url = $applet['url'];
|
|
@@ -258,11 +268,15 @@ class Applet extends Base
|
|
|
$update['set_avatar'] = $pic;
|
|
|
}
|
|
|
|
|
|
- //$update['set_city'] = $city;
|
|
|
+ $update['set_city'] = $city;
|
|
|
//$update['set_mobile'] = $mobile;
|
|
|
- //$update['set_province'] = $province;
|
|
|
- //$update['set_country'] = $country;
|
|
|
+ $update['set_province'] = $province;
|
|
|
+ $update['set_country'] = $country;
|
|
|
$update['where_id'] = $uid;
|
|
|
+
|
|
|
+ if ($country && $province && $city) {
|
|
|
+ $update['set_area'] = $country . ',' . $province . ',' . $city;
|
|
|
+ }
|
|
|
if (isset($update) && $update) {
|
|
|
Dever::load('passport/user-update', $update);
|
|
|
}
|