Commit be0393ff by 杨昕

code format

parent 96ca9d76
Pipeline #9911 passed with stages
in 31 seconds
...@@ -164,7 +164,12 @@ class UserModel extends Eloquent ...@@ -164,7 +164,12 @@ class UserModel extends Eloquent
* @throws DatabaseException * @throws DatabaseException
*/ */
public static function createUser($request){ public static function createUser($request){
try{ try{
$user = UserModel::where("name",$request->name)->first();
if (!empty($user)){
throw new \Exception("用户已存在");
}
$data = [ $data = [
'name' => $request->name, 'name' => $request->name,
...@@ -181,9 +186,7 @@ class UserModel extends Eloquent ...@@ -181,9 +186,7 @@ class UserModel extends Eloquent
} }
}catch (\Exception $exception){ }catch (\Exception $exception){
throw new DatabaseException($exception->getMessage()); throw new DatabaseException($exception->getMessage());
} }
return $flag; return $flag;
} }
......
...@@ -102,16 +102,16 @@ ...@@ -102,16 +102,16 @@
<label for="role">角色</label> <label for="role">角色</label>
<div class="input-group "> <div class="input-group ">
{{--<div class="input-group-addon"><i class="fa fa-phone"></i></div>--}} {{--<div class="input-group-addon"><i class="fa fa-phone"></i></div>--}}
<div class="checkbox"> {{--<div class="checkbox">--}}
<label class="radio-inline"> {{--<label class="radio-inline">--}}
<input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1" checked> {{--<input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1" checked>--}}
<span class="mr5" style="margin-right: 20px;">普通用户</span> {{--<span class="mr5" style="margin-right: 20px;">普通用户</span>--}}
</label> {{--</label>--}}
</div> {{--</div>--}}
<div class="checkbox"> <div class="checkbox">
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1" checked>
<span class="mr5" style="margin-right: 20px;">管理员</span> <span class="mr5" style="margin-right: 20px;">管理员</span>
</label> </label>
</div> </div>
......
...@@ -147,6 +147,7 @@ ...@@ -147,6 +147,7 @@
confirm: function () { confirm: function () {
fetch_response('DELETE',"/web/member/"+id).then(function (res) { fetch_response('DELETE',"/web/member/"+id).then(function (res) {
if (res.code==200) { if (res.code==200) {
$('body').toast({ $('body').toast({
position:'fixed', position:'fixed',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment