diff --git a/hwe/c_dipcenter.php b/hwe/c_dipcenter.php index 41fa6f56..19785b1d 100644 --- a/hwe/c_dipcenter.php +++ b/hwe/c_dipcenter.php @@ -7,8 +7,8 @@ include "func.php"; // $btn, $msg, $scoutmsg, $rate, $bill, $secretlimit $btn = Util::getPost('btn'); -$msg = Util::getPost('msg'); -$scoutmsg = Util::getPost('scoutMsg'); +//$msg = Util::getPost('msg'); +//$scoutmsg = Util::getPost('scoutMsg'); $rate = Util::getPost('rate', 'int'); $bill = Util::getPost('bill', 'int'); $secretlimit = Util::getPost('secretlimit', 'int'); @@ -34,14 +34,14 @@ if ($permission < 0) { $nationID = $me['nation']; $nationStor = KVStorage::getStorage($db, $nationID, 'nation_env'); -if ($btn == "국가방침 수정") { +/*if ($btn == "국가방침 수정") { $msg = mb_substr($msg, 0, 16384); //$msg = StringUtil:: $nationStor->notice = WebUtil::htmlPurify($msg); } elseif ($btn == "임관 권유문 수정") { $scoutmsg = mb_substr($scoutmsg, 0, 1000); $nationStor->scout_msg = WebUtil::htmlPurify($scoutmsg); -} elseif ($btn == "세율") { +} else*/if ($btn == "세율") { $rate = Util::valueFit($rate, 5, 30); $db->update('nation', [ 'rate' => $rate, diff --git a/hwe/sammo/API/Nation/SetNotice.php b/hwe/sammo/API/Nation/SetNotice.php new file mode 100644 index 00000000..6c30ac57 --- /dev/null +++ b/hwe/sammo/API/Nation/SetNotice.php @@ -0,0 +1,58 @@ +args); + $v->rule('required', [ + 'msg', + ])->rule('lengthMax', 'msg', 16384); + + if (!$v->validate()) { + return $v->errorStr(); + } + return null; + } + + public function getRequiredSessionMode(): int + { + return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY; + } + + public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag) + { + $msg = $this->args['msg']; + $userID = $session->userID; + $db = DB::db(); + $me = $db->queryFirstRow('SELECT `no`,nation,`officer_level`,permission,penalty FROM general WHERE `owner`=%i', $userID); + + $permission = checkSecretPermission($me, false); + if($permission < 0){ + return "권한이 부족합니다."; + } + if ($me['officer_level'] < 5 && $permission != 4){ + return "권한이 부족합니다."; + } + + $nationID = $me['nation']; + + $nationStor = KVStorage::getStorage($db, $nationID, 'nation_env'); + $nationStor->notice = WebUtil::htmlPurify($msg); + + return [ + 'result' => true + ]; + } +} diff --git a/hwe/sammo/API/Nation/SetScoutMsg.php b/hwe/sammo/API/Nation/SetScoutMsg.php new file mode 100644 index 00000000..d48bed93 --- /dev/null +++ b/hwe/sammo/API/Nation/SetScoutMsg.php @@ -0,0 +1,58 @@ +args); + $v->rule('required', [ + 'msg', + ])->rule('lengthMax', 'msg', 1000); + + if (!$v->validate()) { + return $v->errorStr(); + } + return null; + } + + public function getRequiredSessionMode(): int + { + return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY; + } + + public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag) + { + $msg = $this->args['msg']; + $userID = $session->userID; + $db = DB::db(); + $me = $db->queryFirstRow('SELECT `no`,nation,`officer_level`,permission,penalty FROM general WHERE `owner`=%i', $userID); + + $permission = checkSecretPermission($me, false); + if($permission < 0){ + return "권한이 부족합니다."; + } + if ($me['officer_level'] < 5 && $permission != 4){ + return "권한이 부족합니다."; + } + + $nationID = $me['nation']; + + $nationStor = KVStorage::getStorage($db, $nationID, 'nation_env'); + $nationStor->scout_msg = WebUtil::htmlPurify($msg); + + return [ + 'result' => true + ]; + } +} diff --git a/hwe/ts/PartialDipcenter.vue b/hwe/ts/PartialDipcenter.vue index 7982792d..ae94abdd 100644 --- a/hwe/ts/PartialDipcenter.vue +++ b/hwe/ts/PartialDipcenter.vue @@ -1,53 +1,123 @@ \ No newline at end of file diff --git a/hwe/ts/components/TipTap.vue b/hwe/ts/components/TipTap.vue new file mode 100644 index 00000000..7042cb50 --- /dev/null +++ b/hwe/ts/components/TipTap.vue @@ -0,0 +1,133 @@ + + + \ No newline at end of file diff --git a/package.json b/package.json index 2d370889..0ace3edf 100644 --- a/package.json +++ b/package.json @@ -19,9 +19,14 @@ "license": "MIT", "type": "module", "dependencies": { + "@tiptap/extension-image": "^2.0.0-beta.24", + "@tiptap/extension-link": "^2.0.0-beta.33", + "@tiptap/starter-kit": "^2.0.0-beta.156", + "@tiptap/vue-3": "^2.0.0-beta.83", "@types/bootstrap": "^5.1.6", "@types/downloadjs": "^1.4.2", "@types/linkifyjs": "^2.1.4", + "@types/quill": "^2.0.9", "@types/select2": "^4.0.54", "@vueup/vue-quill": "^1.0.0-beta.7", "async-validator": "^4.0.7",