diff --git a/app/Http/Controllers/Api/SystemController.php b/app/Http/Controllers/Api/SystemController.php new file mode 100755 index 000000000..88206ec0c --- /dev/null +++ b/app/Http/Controllers/Api/SystemController.php @@ -0,0 +1,347 @@ +isAdmin()) { + return Base::retError('权限不足!'); + } + $all = Request::input(); + foreach ($all AS $key => $value) { + if (!in_array($key, ['reg', 'login_code'])) { + unset($all[$key]); + } + } + $setting = Base::setting('system', Base::newTrim($all)); + } else { + $setting = Base::setting('system'); + } + // + $setting['reg'] = $setting['reg'] ?: 'open'; + $setting['login_code'] = $setting['login_code'] ?: 'auto'; + // + return Base::retSuccess('success', $setting ?: json_decode('{}')); + } + + /** + * @api {get} api/system/get/info 02. 获取终端详细信息 + * + * @apiVersion 1.0.0 + * @apiGroup system + * @apiName get__info + * + * @apiParam {String} key key值 + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function get__info() + { + if (Request::input("key") !== env('APP_KEY')) { + return []; + } + return Base::retSuccess('success', [ + 'ip' => Base::getIp(), + 'ip-info' => Base::getIpInfo(Base::getIp()), + 'ip-gcj02' => Base::getIpGcj02(Base::getIp()), + 'ip-iscn' => Base::isCnIp(Base::getIp()), + 'header' => Request::header(), + 'token' => Base::getToken(), + 'url' => url('') . Base::getUrl(), + ]); + } + + /** + * @api {get} api/system/get/ip 03. 获取IP地址 + * + * @apiVersion 1.0.0 + * @apiGroup system + * @apiName get__ip + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function get__ip() { + return Base::getIp(); + } + + /** + * @api {get} api/system/get/cnip 04. 是否中国IP地址 + * + * @apiVersion 1.0.0 + * @apiGroup system + * @apiName get__cnip + * + * @apiParam {String} ip IP值 + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function get__cnip() { + return Base::isCnIp(Request::input('ip')); + } + + /** + * @api {get} api/system/get/ipgcj02 05. 获取IP地址经纬度 + * + * @apiVersion 1.0.0 + * @apiGroup system + * @apiName get__ipgcj02 + * + * @apiParam {String} ip IP值 + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function get__ipgcj02() { + return Base::getIpGcj02(Request::input("ip")); + } + + /** + * @api {get} api/system/get/ipinfo 06. 获取IP地址详细信息 + * + * @apiVersion 1.0.0 + * @apiGroup system + * @apiName get__ipinfo + * + * @apiParam {String} ip IP值 + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function get__ipinfo() { + return Base::getIpInfo(Request::input("ip")); + } + + /** + * @api {post} api/system/imgupload 10. 上传图片 + * + * @apiDescription 需要token身份 + * @apiVersion 1.0.0 + * @apiGroup system + * @apiName imgupload + * + * @apiParam {String} image64 图片base64 + * @apiParam {String} filename 文件名 + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function imgupload() + { + if (User::token2userid() === 0) { + return Base::retError('身份失效,等重新登录!'); + } + $scale = [intval(Request::input('width')), intval(Request::input('height'))]; + if (!$scale[0] && !$scale[1]) { + $scale = [2160, 4160, -1]; + } + $path = "uploads/picture/" . User::token2userid() . "/" . date("Ym") . "/"; + $image64 = trim(Base::getPostValue('image64')); + $fileName = trim(Base::getPostValue('filename')); + if ($image64) { + $data = Base::image64save([ + "image64" => $image64, + "path" => $path, + "fileName" => $fileName, + "scale" => $scale + ]); + } else { + $data = Base::upload([ + "file" => Request::file('image'), + "type" => 'image', + "path" => $path, + "fileName" => $fileName, + "scale" => $scale + ]); + } + if (Base::isError($data)) { + return Base::retError($data['msg']); + } else { + return Base::retSuccess('success', $data['data']); + } + } + + /** + * @api {get} api/system/get/imgview 11. 浏览图片空间 + * + * @apiDescription 需要token身份 + * @apiVersion 1.0.0 + * @apiGroup system + * @apiName imgview + * + * @apiParam {String} path 路径 + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function imgview() + { + if (User::token2userid() === 0) { + return Base::retError('身份失效,等重新登录!'); + } + $publicPath = "uploads/picture/" . User::token2userid() . "/"; + $dirPath = public_path($publicPath); + $dirs = $files = []; + // + $path = Request::input('path'); + if ($path && is_string($path)) { + $path = str_replace(array('||', '|'), '/', $path); + $path = trim($path, '/'); + $path = str_replace('..', '', $path); + $path = Base::leftDelete($path, $publicPath); + if ($path) { + $path = $path . '/'; + $dirPath .= $path; + // + $dirs[] = [ + 'type' => 'dir', + 'title' => '...', + 'path' => substr(substr($path, 0, -1), 0, strripos(substr($path, 0, -1), '/')), + 'url' => '', + 'thumb' => Base::fillUrl('images/other/dir.png'), + 'inode' => 0, + ]; + } + } else { + $path = ''; + } + $list = glob($dirPath . '*', GLOB_BRACE); + foreach ($list as $v) { + $filename = basename($v); + $pathTemp = $publicPath . $path . $filename; + if (is_dir($v)) { + $dirs[] = [ + 'type' => 'dir', + 'title' => $filename, + 'path' => $pathTemp, + 'url' => Base::fillUrl($pathTemp), + 'thumb' => Base::fillUrl('images/other/dir.png'), + 'inode' => fileatime($v), + ]; + } elseif (substr($filename, -10) != "_thumb.jpg") { + $array = [ + 'type' => 'file', + 'title' => $filename, + 'path' => $pathTemp, + 'url' => Base::fillUrl($pathTemp), + 'thumb' => $pathTemp, + 'inode' => fileatime($v), + ]; + // + $extension = pathinfo($dirPath . $filename, PATHINFO_EXTENSION); + if (in_array($extension, array('gif', 'jpg', 'jpeg', 'png', 'bmp'))) { + if (file_exists($dirPath . $filename . '_thumb.jpg')) { + $array['thumb'] .= '_thumb.jpg'; + } + $array['thumb'] = Base::fillUrl($array['thumb']); + $files[] = $array; + } + } + } + if ($dirs) { + $inOrder = []; + foreach ($dirs as $key => $item) { + $inOrder[$key] = $item['title']; + } + array_multisort($inOrder, SORT_DESC, $dirs); + } + if ($files) { + $inOrder = []; + foreach ($files as $key => $item) { + $inOrder[$key] = $item['inode']; + } + array_multisort($inOrder, SORT_DESC, $files); + } + // + return Base::retSuccess('success', ['dirs' => $dirs, 'files' => $files]); + } + + /** + * @api {post} api/system/fileupload 12. 上传文件 + * + * @apiDescription 需要token身份 + * @apiVersion 1.0.0 + * @apiGroup system + * @apiName fileupload + * + * @apiParam {String} [image64] 图片base64 + * @apiParam {String} filename 文件名 + * @apiParam {String} [files] 文件名 + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function fileupload() + { + if (User::token2userid() === 0) { + return Base::retError('身份失效,等重新登录!'); + } + $path = "uploads/files/" . User::token2userid() . "/" . date("Ym") . "/"; + $image64 = trim(Base::getPostValue('image64')); + $fileName = trim(Base::getPostValue('filename')); + if ($image64) { + $data = Base::image64save([ + "image64" => $image64, + "path" => $path, + "fileName" => $fileName, + ]); + } else { + $data = Base::upload([ + "file" => Request::file('files'), + "type" => 'file', + "path" => $path, + "fileName" => $fileName, + ]); + } + // + return $data; + } +} diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index b1ea14cc3..d0a7b8fd6 100755 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -28,7 +28,7 @@ class UsersController extends AbstractController * - login:登录(默认) * - reg:注册 * @apiParam {String} email 邮箱 - * @apiParam {String} userpass 密码 + * @apiParam {String} password 密码 * @apiParam {String} [code] 登录验证码 * @apiParam {String} [key] 登陆验证码key * @@ -40,13 +40,13 @@ class UsersController extends AbstractController { $type = trim(Request::input('type')); $email = trim(Request::input('email')); - $userpass = trim(Request::input('userpass')); + $password = trim(Request::input('password')); if ($type == 'reg') { $setting = Base::setting('system'); if ($setting['reg'] == 'close') { return Base::retError('未开放注册!'); } - $user = User::reg($email, $userpass); + $user = User::reg($email, $password); if (Base::isError($user)) { return $user; } else { @@ -81,7 +81,7 @@ class UsersController extends AbstractController if (empty($user)) { return $retError('账号或密码错误!'); } - if ($user->userpass != Base::md52($userpass, $user->encrypt)) { + if ($user->password != Base::md52($password, $user->encrypt)) { return $retError('账号或密码错误!'); } Cache::forget("code::" . $email); @@ -96,8 +96,7 @@ class UsersController extends AbstractController ]; $user->updateInstance($array); $user->save(); - // - $user->token = User::token($user); + User::token($user); return Base::retSuccess($type == 'reg' ? "注册成功" : "登录成功", $user); } @@ -181,6 +180,8 @@ class UsersController extends AbstractController $user = User::IDE($user['data']); } // + User::token($user); + // if (strlen($callback) > 3) { return $callback . '(' . json_encode(Base::retSuccess('success', $user)) . ')'; } @@ -197,6 +198,7 @@ class UsersController extends AbstractController * * @apiParam {Object} [userimg] 会员头像(地址) * @apiParam {String} [nickname] 昵称 + * @apiParam {String} [profession] 职位/职称 * * @apiSuccess {Number} ret 返回状态码(1正确、0错误) * @apiSuccess {String} msg 返回信息(错误描述) @@ -222,14 +224,26 @@ class UsersController extends AbstractController if ($nickname) { if (mb_strlen($nickname) < 2) { return Base::retError('昵称不可以少于2个字!'); - } elseif (mb_strlen($nickname) > 8) { - return Base::retError('昵称最多只能设置8个字!'); + } elseif (mb_strlen($nickname) > 20) { + return Base::retError('昵称最多只能设置20个字!'); } else { $user->nickname = $nickname; } } + //职位/职称 + $profession = trim(Request::input('profession')); + if ($profession) { + if (mb_strlen($profession) < 2) { + return Base::retError('职位/职称不可以少于2个字!'); + } elseif (mb_strlen($profession) > 20) { + return Base::retError('职位/职称最多只能设置20个字!'); + } else { + $user->profession = $profession; + } + } // $user->save(); + User::token($user); return Base::retSuccess('修改成功!', $user); } @@ -277,15 +291,16 @@ class UsersController extends AbstractController return Base::retError('当前环境禁止修改密码!'); } // - $verify = User::whereUserid($user->userid)->whereUserpass(Base::md52($oldpass, User::token2encrypt()))->count(); + $verify = User::whereUserid($user->userid)->wherePassword(Base::md52($oldpass, User::token2encrypt()))->count(); if (empty($verify)) { return Base::retError('请填写正确的旧密码!'); } // $user->encrypt = Base::generatePassword(6); - $user->userpass = Base::md52($newpass, $user->encrypt); + $user->password = Base::md52($newpass, $user->encrypt); $user->changepass = 0; $user->save(); + User::token($user); return Base::retSuccess('修改成功!', $user); } diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 8ff89d06c..52064db32 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -12,6 +12,12 @@ class VerifyCsrfToken extends Middleware * @var array */ protected $except = [ + //上传图片 + 'api/system/imgupload/', + + //上传文件 + 'api/system/fileupload/', + // 添加任务 'api/project/task/add/', ]; diff --git a/app/Models/ProjectTask.php b/app/Models/ProjectTask.php index 8008751da..1c7a750b3 100644 --- a/app/Models/ProjectTask.php +++ b/app/Models/ProjectTask.php @@ -49,6 +49,8 @@ use Carbon\Carbon; * @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereUserid($value) * @mixin \Eloquent + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProjectTaskTag[] $taskTag + * @property-read int|null $task_tag_count */ class ProjectTask extends AbstractModel { diff --git a/app/Models/User.php b/app/Models/User.php index f3453eeac..245577efd 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -16,9 +16,10 @@ use Carbon\Carbon; * @property string|null $az A-Z * @property string|null $email 邮箱 * @property string $nickname 昵称 + * @property string|null $profession 职位/职称 * @property string $userimg 头像 * @property string|null $encrypt - * @property string|null $userpass 登录密码 + * @property string|null $password 登录密码 * @property int|null $changepass 登录需要修改密码 * @property int|null $login_num 累计登录次数 * @property string|null $last_ip 最后登录IP @@ -44,10 +45,11 @@ use Carbon\Carbon; * @method static \Illuminate\Database\Eloquent\Builder|User whereLineIp($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereLoginNum($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereNickname($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereProfession($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereUserid($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereUserimg($value) - * @method static \Illuminate\Database\Eloquent\Builder|User whereUserpass($value) + * @method static \Illuminate\Database\Eloquent\Builder|User wherePassword($value) * @mixin \Eloquent */ class User extends AbstractModel @@ -55,8 +57,6 @@ class User extends AbstractModel protected $primaryKey = 'userid'; protected $hidden = [ - 'encrypt', - 'userpass', 'updated_at', ]; @@ -119,6 +119,15 @@ class User extends AbstractModel return WebSocket::whereUserid($this->userid)->exists(); } + /** + * 判断是否管理员 + * @return bool + */ + public function isAdmin() + { + return in_array('admin', $this->identity); + } + /** ***************************************************************************************** */ /** ***************************************************************************************** */ @@ -127,11 +136,11 @@ class User extends AbstractModel /** * 注册会员 * @param $email - * @param $userpass + * @param $password * @param array $other * @return array */ - public static function reg($email, $userpass, $other = []) + public static function reg($email, $password, $other = []) { //邮箱 if (!Base::isMail($email)) { @@ -141,9 +150,9 @@ class User extends AbstractModel return Base::retError('邮箱地址已存在!'); } //密码 - if (strlen($userpass) < 6) { + if (strlen($password) < 6) { return Base::retError(['密码设置不能小于%位数!', 6]); - } elseif (strlen($userpass) > 32) { + } elseif (strlen($password) > 32) { return Base::retError(['密码最多只能设置%位数!', 32]); } //开始注册 @@ -151,7 +160,7 @@ class User extends AbstractModel $inArray = [ 'encrypt' => $encrypt, 'email' => $email, - 'userpass' => Base::md52($userpass, $encrypt), + 'password' => Base::md52($password, $encrypt), 'created_ip' => Base::getIp(), ]; if ($other) { @@ -293,7 +302,10 @@ class User extends AbstractModel */ public static function token($userinfo) { - return base64_encode($userinfo->userid . '#$' . $userinfo->email . '#$' . $userinfo->encrypt . '#$' . time() . '#$' . Base::generatePassword(6)); + $userinfo->token = base64_encode($userinfo->userid . '#$' . $userinfo->email . '#$' . $userinfo->encrypt . '#$' . time() . '#$' . Base::generatePassword(6)); + unset($userinfo->encrypt); + unset($userinfo->password); + return $userinfo->token; } /** @@ -355,7 +367,7 @@ class User extends AbstractModel if (isset($_A["__static_userid2basic_" . $userid])) { return $_A["__static_userid2basic_" . $userid]; } - $fields = ['userid', 'email', 'nickname', 'userimg']; + $fields = ['userid', 'email', 'nickname', 'profession', 'userimg']; $userInfo = self::whereUserid($userid)->select($fields)->first(); if ($userInfo) { $userInfo->online = $userInfo->getOnlineStatus(); @@ -383,8 +395,8 @@ class User extends AbstractModel */ public static function needCode($email) { - $loginCode = Base::settingFind('system', 'loginCode'); - switch ($loginCode) { + $login_code = Base::settingFind('system', 'login_code'); + switch ($login_code) { case 'open': return Base::retSuccess('need'); diff --git a/app/Module/Base.php b/app/Module/Base.php index 6b46be91c..bed515690 100755 --- a/app/Module/Base.php +++ b/app/Module/Base.php @@ -1149,6 +1149,7 @@ class Base if ($array !== false) { $setting = $array; $row->updateInstance(['setting' => $array]); + $row->save(); } $_A["__static_setting_" . $setname] = $setting; return $setting; diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index 1b3b04f56..4342f7246 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -10,7 +10,7 @@ -
  • +
  • @@ -293,9 +293,10 @@ export default { toggleRoute(path) { this.goForward({path: '/manage/' + path}); }, + classNameRoute(path) { return { - "active": this.curPath == '/manage/' + path + "active": $A.leftExists(this.curPath, '/manage/' + path) }; }, diff --git a/resources/assets/js/pages/manage/components/project-list.vue b/resources/assets/js/pages/manage/components/project-list.vue index 493ccfb64..f51910505 100644 --- a/resources/assets/js/pages/manage/components/project-list.vue +++ b/resources/assets/js/pages/manage/components/project-list.vue @@ -652,12 +652,13 @@ > pre { margin: 0; padding: 0; + line-height: 1.5; } } .ivu-icon { font-size: 22px; color: #666666; - padding-left: 4px; + margin-left: 8px; } &.has-desc { .task-title { @@ -668,7 +669,7 @@ .task-desc { color: #999999; margin-top: 10px; - line-height: 18px; + line-height: 20px; } .task-tags { margin-top: 10px; diff --git a/resources/assets/js/pages/manage/setting.vue b/resources/assets/js/pages/manage/setting.vue deleted file mode 100644 index 330c48d4d..000000000 --- a/resources/assets/js/pages/manage/setting.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/resources/assets/js/pages/manage/setting/index.vue b/resources/assets/js/pages/manage/setting/index.vue new file mode 100644 index 000000000..b2b887e18 --- /dev/null +++ b/resources/assets/js/pages/manage/setting/index.vue @@ -0,0 +1,150 @@ + + + + diff --git a/resources/assets/js/pages/manage/setting/password.vue b/resources/assets/js/pages/manage/setting/password.vue new file mode 100644 index 000000000..75a709267 --- /dev/null +++ b/resources/assets/js/pages/manage/setting/password.vue @@ -0,0 +1,107 @@ + + + diff --git a/resources/assets/js/pages/manage/setting/personal.vue b/resources/assets/js/pages/manage/setting/personal.vue new file mode 100644 index 000000000..2971f32ca --- /dev/null +++ b/resources/assets/js/pages/manage/setting/personal.vue @@ -0,0 +1,99 @@ + + + diff --git a/resources/assets/js/pages/manage/setting/priority.vue b/resources/assets/js/pages/manage/setting/priority.vue new file mode 100644 index 000000000..5506f1ac0 --- /dev/null +++ b/resources/assets/js/pages/manage/setting/priority.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/resources/assets/js/pages/manage/setting/system.vue b/resources/assets/js/pages/manage/setting/system.vue new file mode 100644 index 000000000..31acc1cea --- /dev/null +++ b/resources/assets/js/pages/manage/setting/system.vue @@ -0,0 +1,77 @@ + + + diff --git a/resources/assets/js/routes.js b/resources/assets/js/routes.js index 917887fa3..37870cee7 100755 --- a/resources/assets/js/routes.js +++ b/resources/assets/js/routes.js @@ -25,7 +25,33 @@ export default [ { name: 'manage-setting', path: 'setting', - component: () => import('./pages/manage/setting.vue'), + component: () => import('./pages/manage/setting/index.vue'), + children: [ + { + path: '', + redirect: 'personal', + }, + { + name: 'manage-setting-personal', + path: 'personal', + component: () => import('./pages/manage/setting/personal.vue'), + }, + { + name: 'manage-setting-password', + path: 'password', + component: () => import('./pages/manage/setting/password.vue'), + }, + { + name: 'manage-setting-personal', + path: 'system', + component: () => import('./pages/manage/setting/system.vue'), + }, + { + name: 'manage-setting-personal', + path: 'priority', + component: () => import('./pages/manage/setting/priority.vue'), + }, + ] }, { name: 'manage-project-detail', diff --git a/resources/assets/js/store/mutations.js b/resources/assets/js/store/mutations.js index 1a844fd76..6d22c1f9b 100644 --- a/resources/assets/js/store/mutations.js +++ b/resources/assets/js/store/mutations.js @@ -23,20 +23,18 @@ export default { * @param callback */ getUserInfo(state, callback) { - if (typeof callback === 'function' || callback === true) { - $A.apiAjax({ - url: 'users/info', - error: () => { - $A.userLogout(); - }, - success: ({ret, data, msg}) => { - if (ret === 1) { - this.commit('setUserInfo', data); - typeof callback === "function" && callback(data); - } - }, - }); - } + $A.apiAjax({ + url: 'users/info', + error: () => { + $A.userLogout(); + }, + success: ({ret, data, msg}) => { + if (ret === 1) { + this.commit('setUserInfo', data); + typeof callback === "function" && callback(data); + } + }, + }); return state.userInfo; }, @@ -107,27 +105,45 @@ export default { return; } const {userid, success, complete} = params; - if (typeof success === "function") { - if (state._isArray(userid)) { - userid.forEach((uid) => { - state.cacheUserBasic[uid] && success(state.cacheUserBasic[uid], false) - }); - } else { - state.cacheUserBasic[userid] && success(state.cacheUserBasic[userid], false) + const time = Math.round(new Date().getTime() / 1000); + const array = []; + (state._isArray(userid) ? userid : [userid]).some((uid) => { + if (state.cacheUserBasic[uid]) { + typeof success === "function" && success(state.cacheUserBasic[uid].data, false); + if (time - state.cacheUserBasic[uid].time <= 10) { + return false; + } } + array.push(uid); + }); + if (array.length === 0) { + typeof complete === "function" && complete() + return; } + // + if (state.cacheUserBasic["::loading"] === true) { + setTimeout(() => { + this.commit('getUserBasic', params); + }, 20); + return; + } + state.cacheUserBasic["::loading"] = true; $A.apiAjax({ url: 'users/basic', data: { - userid: userid + userid: array }, complete: () => { + state.cacheUserBasic["::loading"] = false; typeof complete === "function" && complete() }, success: ({ret, data, msg}) => { if (ret === 1) { data.forEach((item) => { - state.cacheUserBasic[item.userid] = item; + state.cacheUserBasic[item.userid] = { + time, + data: item + }; typeof success === "function" && success(item, true) }); } else { diff --git a/resources/assets/sass/main.scss b/resources/assets/sass/main.scss index 18b84473a..9a6fb0bdd 100755 --- a/resources/assets/sass/main.scss +++ b/resources/assets/sass/main.scss @@ -15,6 +15,13 @@ } } +body { + .ivu-input, + .ivu-select-selection { + border-color: #e8e8e8; + } +} + .ivu-modal-wrap { &.simple-modal { .ivu-modal { @@ -328,10 +335,6 @@ .ivu-form-item-label { font-weight: 600; } - .ivu-input, - .ivu-select-selection { - border-color: #e8e8e8; - } .teditor-box { .tox-tinymce { border-color: #e8e8e8; @@ -580,5 +583,36 @@ } } - +.setting-item { + .ivu-input, + .ivu-select-selection { + max-width: 460px; + } + .form-tip { + color: #999999; + } + .setting-footer { + > button { + height: 34px; + line-height: 32px; + padding: 0 32px; + } + } + &.submit { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + .setting-footer { + position: absolute; + left: 0; + right: 0; + bottom: 0; + z-index: 1; + padding: 16px 24px 0; + border-top: 1px solid #F4F4F5; + } + } +} diff --git a/routes/web.php b/routes/web.php index 371844068..c2ab20b9f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,7 @@ middleware(['webapi'])->group(function () { // 会员 Route::any('users/{method}', UsersController::class); Route::any('users/{method}/{action}', UsersController::class); - //项目 + // 项目 Route::any('project/{method}', ProjectController::class); Route::any('project/{method}/{action}', ProjectController::class); + // 系统 + Route::any('system/{method}', SystemController::class); + Route::any('system/{method}/{action}', SystemController::class); }); /**