diff --git a/.gitignore b/.gitignore
index 5c115c5..f3dcd24 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
+api_docs/
+.idea/
+
# Windows
[Dd]esktop.ini
Thumbs.db
@@ -9,8 +12,4 @@ $RECYCLE.BIN/
.Spotlight-V100
.TemporaryItems
.Trashes
-project.config.json
-
-api_docs/
-.idea/
\ No newline at end of file
diff --git a/miniprogram/.gitignore b/miniprogram/.gitignore
index fd5160b..a7f4eac 100644
--- a/miniprogram/.gitignore
+++ b/miniprogram/.gitignore
@@ -1,3 +1,5 @@
+js/apiConfig.js
+
# Windows
[Dd]esktop.ini
Thumbs.db
@@ -9,15 +11,6 @@ $RECYCLE.BIN/
.Spotlight-V100
.TemporaryItems
.Trashes
-project.config.json
-app.js
-
-towxml
-we-cropper
-components/weui
-
-.idea
-api_docs
# Node.js
node_modules/
diff --git a/miniprogram/account/.gitignore b/miniprogram/account/.gitignore
new file mode 100644
index 0000000..fff60ac
--- /dev/null
+++ b/miniprogram/account/.gitignore
@@ -0,0 +1 @@
+towxml/
\ No newline at end of file
diff --git a/miniprogram/account/pages/about/about.js b/miniprogram/account/pages/about/about.js
new file mode 100644
index 0000000..e9540cc
--- /dev/null
+++ b/miniprogram/account/pages/about/about.js
@@ -0,0 +1,76 @@
+const Towxml = require('../../towxml/main');
+
+if (!global.towxml)
+ global.towxml = new Towxml();
+
+Page({
+ /**
+ * 页面的初始数据
+ */
+ md: '# 服务协议\n\n尊敬的用户,您好!\n欢迎使用本网站,在您使用本网站前,请您认真阅读并遵守《服务协议》(以下简称”本协议”),请您务必审慎阅读、充分理解协议的各条款内容。\n当您在注册过程中点击查看”看过并同意本服务协议”,按照注册流程成功注册为网站的用户即表示您已充分阅读、理解并完全接受本协议中的全部条款。您承诺接受并遵守本协议的约定,届时您不应以未阅读本协议的内容等理由,主张本协议无效或本协议中的某些条款无效,或要求撤销本协议。\n\n## 本网站权利和义务\n1. 尊重用户隐私:尊重用户隐私,保障用户隐私安全是网站的一项基本政策;\n2. 管理网站用户:网站依据国家法律、地方法律和国际法律等的标准以及本行业的规则来管理网站注册用户;\n3. 处理用户反馈:网站的相关人员会及时处理用户反馈的问题并给予及时回复。\n## 用户权利和义务\n1. 用户在使用网站的过程中,必须遵守如下原则:\n2. 遵守中国的有关法律和法规;\n3. 使用网络服务不作非法用途;\n4. 不干扰和混乱网络服务;\n5. 遵守所有使用网络服务的网络协议、规定、程序和惯例;\n6. 不传输任何非法的、骚扰性的、中伤他人的、辱骂性的、恐吓性的、伤害性的、庸俗的,淫秽等信息资料;\n7. 不传输任何教唆他人构成犯罪行为的资料;\n8. 用户不得故意或者过失损害网站合法权利和利益。及时回复。\n## 关于责任\n鉴于网络服务的特殊性,本网站有权在事先通知的情况下,变更、中断、升级部分网络服务。本网站不担保网络服务不会中断,但承诺在用户可承受的时间内快速恢复服务,同时确保用户数据的安全性和可靠性。\n\n## 免责条款\n鉴于互联网服务的特点,本网站对用户自行上传的资料不承担任何法律责任,希望各网友对网站提供的互动服务中的内容进行监督,若发现存在侵犯任何第三人著作权等合法权益的内容,请及时告知,我们将严格按照《信息网络传播权保护条例》中的规定予以删除。\n\n1. 本网站属于非赢利性网站,转载的文章遵循原作者的版权声明,如果原文没有版权声明,按照目前互联网开放的原则,我们将在不通知作者的情况下,转载文章;如果原文明确注明“禁止转载”,我们一定不会转载。如果我们转载的文章不符合作者的版权声明或者作者不想让我们转载您的文章的话,请来信告知:zhongjin@educoder.net\n2. 本网站转载文章仅为传播更多信息之目的,凡在本网站出现的信息,均仅供参考。本网站将尽力确保所提供信息的准确性及可靠性,但不保证信息的正确性和完整性,且不对因信息的不正确或遗漏导致的任何损失或损害承担责任。\n3. 任何透过本网站网页而链接及得到的资讯、产品及服务,本网站概不负责,亦不负任何法律责任。\n4. 本网站所刊发、转载的文章,其版权均归原作者所有,如其他媒体、网站或个人从本网下载使用,请在转载有关文章时务必尊重该文章的著作权,保留本网注明的“稿件来源”,并自负版权等法律责任。\n## 侵权投诉\nEducoder平台是一个接受外来投稿的平台,部分图片和文字来自互联网或原作者自行编辑。投稿到Educoder平台的文章,默认作者授权其全部图文内容在Educoder平台、在其微信公众号及微博帐号进行发布,Educoder平台对这一部分内容不进行预先审查。\n如您发现平台上文章或图片涉嫌侵犯您的权利请您将所涉及的文章 URL 和侵权理由以邮件形式发送到邮箱(zhongjin@educoder.net),我们将在核实情况后依照《中华人民共和国侵权责任法》及其司法解释对内容进行屏蔽、删除和通知原作者。\n\n## 服务条款的修改\n本网站保留在必要时对本协议修改的权利,一旦发生变动,这些条款可由网站项目组及时更新,且毋须另行通知,修改后的条款一旦在网页上公布即有效代替原来的服务条款。您可随时查阅最新版服务条款。\n\n**本协议最终解释权归本网站所有**。'
+,
+
+ data: {
+ article: {}
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ const _ts = this;
+ let data = global.towxml.toJson(this.md,'markdown');
+ _ts.setData({
+ article: data
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/pages/about/about.json b/miniprogram/account/pages/about/about.json
similarity index 100%
rename from miniprogram/pages/about/about.json
rename to miniprogram/account/pages/about/about.json
diff --git a/miniprogram/pages/about/about.wxml b/miniprogram/account/pages/about/about.wxml
similarity index 51%
rename from miniprogram/pages/about/about.wxml
rename to miniprogram/account/pages/about/about.wxml
index 70e900f..f8cfd98 100644
--- a/miniprogram/pages/about/about.wxml
+++ b/miniprogram/account/pages/about/about.wxml
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/miniprogram/pages/about/about.wxss b/miniprogram/account/pages/about/about.wxss
similarity index 64%
rename from miniprogram/pages/about/about.wxss
rename to miniprogram/account/pages/about/about.wxss
index e417485..f142ba9 100644
--- a/miniprogram/pages/about/about.wxss
+++ b/miniprogram/account/pages/about/about.wxss
@@ -1,16 +1,15 @@
/* pages/about/about.wxss */
/**基础风格样式**/
-@import '/towxml/style/main.wxss';
-
-
+@import '/account/towxml/style/main.wxss';
/**如果页面有动态主题切换,则需要将使用到的样式全部引入**/
/**主题配色(浅色样式)**/
-@import '/towxml/style/theme/light.wxss';
+@import '/account/towxml/style/theme/light.wxss';
/**主题配色(深色样式)**/
-@import '/towxml/style/theme/dark.wxss';
+@import '/account/towxml/style/theme/dark.wxss';
+
.container{
padding-bottom: 40rpx;
diff --git a/miniprogram/pages/agreement/agreement.js b/miniprogram/account/pages/agreement/agreement.js
similarity index 97%
rename from miniprogram/pages/agreement/agreement.js
rename to miniprogram/account/pages/agreement/agreement.js
index 3af4e74..7ac0699 100644
--- a/miniprogram/pages/agreement/agreement.js
+++ b/miniprogram/account/pages/agreement/agreement.js
@@ -1,5 +1,7 @@
-// pages/agreement/agreement.js
-const app = getApp();
+const Towxml = require('../../towxml/main');
+
+if(!global.towxml)
+ global.towxml = new Towxml();
Page({
@@ -14,7 +16,7 @@ Page({
*/
onLoad: function (options) {
const _ts = this;
- let data = app.towxml.toJson(this.agreement, 'markdown');
+ let data = global.towxml.toJson(this.agreement, 'markdown');
_ts.setData({
article: data
});
diff --git a/miniprogram/pages/agreement/agreement.json b/miniprogram/account/pages/agreement/agreement.json
similarity index 100%
rename from miniprogram/pages/agreement/agreement.json
rename to miniprogram/account/pages/agreement/agreement.json
diff --git a/miniprogram/pages/agreement/agreement.wxml b/miniprogram/account/pages/agreement/agreement.wxml
similarity index 51%
rename from miniprogram/pages/agreement/agreement.wxml
rename to miniprogram/account/pages/agreement/agreement.wxml
index 70e900f..f8cfd98 100644
--- a/miniprogram/pages/agreement/agreement.wxml
+++ b/miniprogram/account/pages/agreement/agreement.wxml
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/miniprogram/pages/agreement/agreement.wxss b/miniprogram/account/pages/agreement/agreement.wxss
similarity index 63%
rename from miniprogram/pages/agreement/agreement.wxss
rename to miniprogram/account/pages/agreement/agreement.wxss
index e417485..e09007c 100644
--- a/miniprogram/pages/agreement/agreement.wxss
+++ b/miniprogram/account/pages/agreement/agreement.wxss
@@ -1,16 +1,14 @@
/* pages/about/about.wxss */
/**基础风格样式**/
-@import '/towxml/style/main.wxss';
-
-
+@import '/account/towxml/style/main.wxss';
/**如果页面有动态主题切换,则需要将使用到的样式全部引入**/
/**主题配色(浅色样式)**/
-@import '/towxml/style/theme/light.wxss';
+@import '/account/towxml/style/theme/light.wxss';
/**主题配色(深色样式)**/
-@import '/towxml/style/theme/dark.wxss';
+@import '/account/towxml/style/theme/dark.wxss';
.container{
padding-bottom: 40rpx;
diff --git a/miniprogram/pages/login/login.js b/miniprogram/account/pages/login/login.js
similarity index 78%
rename from miniprogram/pages/login/login.js
rename to miniprogram/account/pages/login/login.js
index 5db5ecc..d3b3e3d 100644
--- a/miniprogram/pages/login/login.js
+++ b/miniprogram/account/pages/login/login.js
@@ -14,6 +14,14 @@ Page({
wx.setStorage({
key: 'login',
data: this.data.login,
+ });
+ wx.setStorage({
+ key: '_password',
+ data: this.data.password,
+ });
+ wx.setStorage({
+ key: 'autologin',
+ data: 1,
})
},
load_input:function(){
@@ -41,7 +49,7 @@ Page({
this.login_test();
return;
}
- app.client.login({login: login, password: password, autologin: 1,
+ app.callApi({name:"accounts.login",data:{login: login, password: password, autologin: 1},
success:res=>{
console.log("login success");
console.log(res);
@@ -49,12 +57,10 @@ Page({
wx.navigateBack({
delta: 1
});
- app.logining = false;
- console.log("login_successful!!!!");
},
fail(error){
wx.showToast({
- title: error.toString(),
+ title: error.message,
icon: "none"
})
}
@@ -98,41 +104,10 @@ Page({
onReady: function () {
},
-
onShow: function () {
this.pull_test();
},
-
-
onHide: function () {
},
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- app.logining = false;
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
-
- }
})
\ No newline at end of file
diff --git a/miniprogram/pages/login/login.json b/miniprogram/account/pages/login/login.json
similarity index 100%
rename from miniprogram/pages/login/login.json
rename to miniprogram/account/pages/login/login.json
diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/account/pages/login/login.wxml
similarity index 74%
rename from miniprogram/pages/login/login.wxml
rename to miniprogram/account/pages/login/login.wxml
index 3f70fc6..22afe83 100644
--- a/miniprogram/pages/login/login.wxml
+++ b/miniprogram/account/pages/login/login.wxml
@@ -1,6 +1,6 @@
-
+
@@ -30,9 +30,4 @@
注册
忘记密码
-
-
-
-
-
diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/account/pages/login/login.wxss
similarity index 100%
rename from miniprogram/pages/login/login.wxss
rename to miniprogram/account/pages/login/login.wxss
diff --git a/miniprogram/pages/register/register.js b/miniprogram/account/pages/register/register.js
similarity index 56%
rename from miniprogram/pages/register/register.js
rename to miniprogram/account/pages/register/register.js
index 1ebc947..ae3fc3e 100644
--- a/miniprogram/pages/register/register.js
+++ b/miniprogram/account/pages/register/register.js
@@ -12,7 +12,7 @@ Page({
register: function({detail:{value}}){
console.log("register");
console.info(value);
- app.client.register(value).then(res=>{
+ app.api("accounts.register")(value).then(res=>{
wx.showToast({
title: res.message,
});
@@ -32,8 +32,10 @@ Page({
send_code: function(){
if (!this.data.login) return;
this.countDown();
- app.client.get_verification_code_for_register({
- login: this.data.login,
+ app.client.callApi({
+ name:"accounts.get_verification_code",
+ data:{login: this.data.login,
+ type:1},
success:res=>{
wx.showToast({
title: "发送成功"
@@ -58,60 +60,5 @@ Page({
}
}, 1000)
})
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
-
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
-
}
})
\ No newline at end of file
diff --git a/miniprogram/pages/register/register.json b/miniprogram/account/pages/register/register.json
similarity index 100%
rename from miniprogram/pages/register/register.json
rename to miniprogram/account/pages/register/register.json
diff --git a/miniprogram/pages/register/register.wxml b/miniprogram/account/pages/register/register.wxml
similarity index 90%
rename from miniprogram/pages/register/register.wxml
rename to miniprogram/account/pages/register/register.wxml
index ddbd1eb..df5bd66 100644
--- a/miniprogram/pages/register/register.wxml
+++ b/miniprogram/account/pages/register/register.wxml
@@ -1,6 +1,6 @@
-
+