Procházet zdrojové kódy

Merge branch 'master' of http://git.huxiukeji.com/lizhen/xiaoshan

lizhen_gitee před 3 měsíci
rodič
revize
4175f592af

+ 2 - 1
application/admin/lang/zh-cn/banner.php

@@ -15,5 +15,6 @@ return [
     'Updatetime' => '更新时间',
     'Type'       => '位置',
     'Type 1'     => '首页',
-    'Type 2'     => '商城'
+    'Type 2'     => '商城',
+    'Type 3'     => '首页nav',
 ];

+ 1 - 1
application/admin/model/Banner.php

@@ -46,7 +46,7 @@ class Banner extends Model
 
     public function getTypeList()
     {
-        return ['1' => __('Type 1'), '2' => __('Type 2')];
+        return ['1' => __('Type 1'), '2' => __('Type 2'), '3' => __('Type 3')];
     }
 
 

+ 7 - 0
application/api/controller/User.php

@@ -5,6 +5,7 @@ namespace app\api\controller;
 use app\common\controller\Api;
 use app\common\library\Ems;
 use app\common\library\Sms;
+use app\utils\Service\Tencent\TencentIm;
 use think\Validate;
 use think\Db;
 use app\common\library\Wechat;
@@ -45,6 +46,8 @@ class User extends Api
         $ret = $this->auth->login($account, $password);
         if ($ret) {
             $data = $this->auth->getUserinfo_smiple();
+            $im = new TencentIm();
+            $im->register(im_prefix($data['id']),$data['nickname'],$data['avatar']);
             $this->success(__('Logged in successful'), $data);
         } else {
             $this->error($this->auth->getError());
@@ -84,6 +87,8 @@ class User extends Api
         if ($ret) {
             Sms::flush($mobile, 'mobilelogin');
             $data = $this->auth->getUserinfo_smiple();
+            $im = new TencentIm();
+            $im->register(im_prefix($data['id']),$data['nickname'],$data['avatar']);
             $this->success(__('Logged in successful'), $data);
         } else {
             $this->error($this->auth->getError());
@@ -119,6 +124,8 @@ class User extends Api
         $ret = $this->auth->register('', $password, '', $mobile, []);
         if ($ret) {
             $data = $this->auth->getUserinfo_smiple();
+            $im = new TencentIm();
+            $im->register(im_prefix($data['id']),$data['nickname'],$data['avatar']);
             $this->success(__('Sign up successful'), $data);
         } else {
             $this->error($this->auth->getError());

+ 1 - 1
public/assets/js/backend/banner.js

@@ -33,7 +33,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'weigh', title: __('Weigh'), operate: false},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
-                        {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
+                        {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2'),"3":__('Type 3')}, formatter: Table.api.formatter.normal},
                         {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]