فهرست منبع

:wrench: remove WWW_DOMAIN_NAME rename RPC_DOMAIN_

visuddhinanda 4 سال پیش
والد
کامیت
5ba6930127

+ 8 - 1
change-logs.md

@@ -21,7 +21,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - remove file config.migrate.sample.php
 - finish command Install:wordbook
 
-## [1.0.1] - 2022-01-15
+## [1.0.2] - 2022-01-15
 
 - add HELP_SERVER to .env.sample /public/app/config.sample.js /public/app/config.sample.php
 - add GRAMMAR_SERVER to .env.sample /public/app/config.sample.js /public/app/config.sample.php
+
+## [1.0.3] - 2022-01-16
+
+- remove WWW_DOMAIN_PROTOCOL WWW_DOMAIN_NAME from config.sample.php
+- rename RPC_DOMAIN_NAME -> RPC_SERVER in config.sample.php
+- remove WWW_DOMAIN_NAME  from config.sample.js
+- rename RPC_DOMAIN_NAME -> RPC_SERVER in config.sample.js

+ 1 - 1
public/app/article/article.js

@@ -46,7 +46,7 @@ function articel_load(id, collection_id) {
 						$("#article_author").html( article_author );
 
 						//将绝对链接转换为 用户连接的主机链接
-						result.content = result.content.replace(/[A-z]*.wikipali.org/g,WWW_DOMAIN_NAME);
+						result.content = result.content.replace(/[A-z]*.wikipali.org/g,location.host);
 
 						$("#contents").html(note_init(result.content,"",result.owner,result.lang));
 						//处理<code>标签作为气泡注释

+ 2 - 1
public/app/article/my_article.js

@@ -51,8 +51,9 @@ function my_article_list() {
 						html += "</button>";
 						html += "</a></div>";
 						html += "<div style='flex:1;'>";
+						let host = location.protocol + '//' + location.host;
 						html +=
-							"<button class='icon_btn' onclick=\"copy_to_clipboard('"+WWW_DOMAIN_NAME+"/app/article/?id=" +
+							"<button class='icon_btn' onclick=\"copy_to_clipboard('"+host+"/app/article/?id=" +
 							iterator.id +
 							"')\" title='" +
 							gLocal.gui.copy_link +

+ 1 - 2
public/app/config.sample.js

@@ -1,5 +1,4 @@
-var WWW_DOMAIN_NAME="sg.wikipali.org";
-var RPC_DOMAIN_NAME="rpc.wikipali.org";
+var RPC_SERVER = "https://rpc.wikipali.org";
 
 /*
   |---------------

+ 2 - 3
public/app/config.sample.php

@@ -2,9 +2,8 @@
 
 
 #域名设置
-define("WWW_DOMAIN_PROTOCOL","https");
-define("WWW_DOMAIN_NAME","www.wikipali.org");
-define("RPC_DOMAIN_NAME","rpc.wikipali.org");
+
+define("RPC_SERVER","https://rpc.wikipali.org");
 define("ASSETS_SERVER","https://assets-hk.wikipali.org");
 define("HELP_SERVER","https://help-hk.wikipali.org");
 define("GRAMMAR_SERVER","https://grammar-hk.wikipali.org");

+ 2 - 2
public/app/db/user.php

@@ -175,8 +175,8 @@ class User extends Table
 			$ok = $this->_update(["reset_password_token"=>$resetToken],["reset_password_token"],["email"=>$email]);
 			if($ok){
 				#send email
-				$resetLink='https://'.WWW_DOMAIN_NAME."/app/ucenter/reset.php?token=".$resetToken;
-				$resetString=WWW_DOMAIN_NAME."/app/ucenter/reset.php";
+				$resetLink=WWW_SERVER."/app/ucenter/reset.php?token=".$resetToken;
+				$resetString=WWW_SERVER."/app/ucenter/reset.php";
 		
 				// 打开文件并读取数据
 				$irow=0;

+ 3 - 1
public/app/studio/js/index_mydoc.js

@@ -225,7 +225,9 @@ function title_change(id, title) {
 	}
 }
 function share_link_copy_to_clipboard(id) {
-	copy_to_clipboard(WWW_DOMAIN_NAME+"/app/studio/project.php?op=open&doc_id=" + id);
+	let host = location.protocol + '//' + location.host;
+
+	copy_to_clipboard(host+"/app/studio/project.php?op=open&doc_id=" + id);
 }
 function mydoc_file_select(doSelect) {
 	if (doSelect) {

+ 2 - 2
public/app/term/note.js

@@ -288,7 +288,7 @@ function render_read_mode_sent(iterator) {
 		let html = "<span class='tran_sent' lang='" + oneTran.lang + "' channal='" + oneTran.channal + "'>";
 
 		//将绝对链接转换为 用户连接的主机链接
-		oneTran.text = oneTran.text.replace(/[A-z]*.wikipali.org/g,WWW_DOMAIN_NAME);
+		oneTran.text = oneTran.text.replace(/[A-z]*.wikipali.org/g,location.host);
 
 		html += marked(term_std_str_to_tran(oneTran.text, oneTran.channal, oneTran.editor, oneTran.lang));
 		html += "</span>";
@@ -897,7 +897,7 @@ function render_one_sent_tran_a(iterator, diff = false) {
 	let sid = iterator.book + "-" + iterator.para + "-" + iterator.begin + "-" + iterator.end;
 
 	//将绝对链接转换为 用户连接的主机链接
-	let showText = iterator.text.replace(/[A-z]*.wikipali.org/g,WWW_DOMAIN_NAME);
+	let showText = iterator.text.replace(/[A-z]*.wikipali.org/g,location.host);
 
 	if (iterator.text == "") {
 		if (typeof iterator.channalinfo == "undefined") {

+ 2 - 2
public/app/ucenter/invite.php

@@ -23,8 +23,8 @@ if (PHP_SAPI == "cli") {
 		$invitecode = "invitecode://".$uuid;
 		$redis->set($invitecode,$email);
 		$redis->expire($invitecode,7*20*3600);
-		$SignUpLink=WWW_DOMAIN_PROTOCOL."://".WWW_DOMAIN_NAME . "/app/ucenter/sign_up.php?invite=".$uuid;
-		$SignUpString=WWW_DOMAIN_NAME . "/app/ucenter/sign_up.php";
+		$SignUpLink=WWW_SERVER . "/app/ucenter/sign_up.php?invite=".$uuid;
+		$SignUpString=WWW_SERVER . "/app/ucenter/sign_up.php";
 
 			// 打开文件并读取数据
 		$irow=0;