diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..53fd1ffde86689457828d48ec763e461264c0d10 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# slndemo + +#### 说明 +slndemo示例模拟演示了文件在OA系统中的流转,主要为办公系统跨平台在线处理Office文档提供了完美的解决方案。 +Word文档在线处理的核心环节,包括:起草文档、领导审批、核稿、领导盖章、正式发文。PageOffice产品支持PC端Word文档在线处理的所有环节;MobOffice产品支持了移动端领导审批和领导盖章的功能。支持PC端和移动端对文档审批和盖章的互认。 + +#### 安装步骤 + +1. 克隆项目到本地 +2. 将项目slndemo下的slndemodata.zip压缩包拷贝到本地D盘根目录下并解压 +3. 使用idea导入slndemo项目并运行 + + +#### 其他(PageOffice和MobOffice产品序列号) + +- 版 本:PageOffice企业版5(试用) +- 序列号:V541A-Y7PD-C6J1-4TPFH + +- 版 本:MobOffice专业版5(试用) +- 序列号:M7130-74051 + + + diff --git a/slndemodata.zip b/slndemodata.zip new file mode 100644 index 0000000000000000000000000000000000000000..71957ad6f7c0ce6e99302ea924395f548193479f Binary files /dev/null and b/slndemodata.zip differ diff --git a/src/main/java/com/zhuozhengsoft/slndemo/controller/IndexController.java b/src/main/java/com/zhuozhengsoft/slndemo/controller/IndexController.java index d042ed099040c88f25efa1e55bd8bd12c88c426c..a705d53824380fd9bf8d0d38ba6033bc89401b60 100644 --- a/src/main/java/com/zhuozhengsoft/slndemo/controller/IndexController.java +++ b/src/main/java/com/zhuozhengsoft/slndemo/controller/IndexController.java @@ -1,14 +1,11 @@ package com.zhuozhengsoft.slndemo.controller; - -import com.zhuozhengsoft.slndemo.utils.Base64Util; import com.zhuozhengsoft.slndemo.utils.QRCodeUtil; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import sun.misc.BASE64Encoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.FileOutputStream; /** * Author: dong @@ -17,9 +14,6 @@ import java.io.FileOutputStream; */ @Controller public class IndexController { - @Value("${imgpath}") - private String imgPath; - @RequestMapping(value = {"/","/index"}) public String index(HttpServletRequest request, HttpServletResponse response)throws Exception { @@ -27,24 +21,21 @@ public class IndexController { String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; if(!request.getServerName().equals("127.0.0.1") && !request.getServerName().toLowerCase().equals("localhost")){ + BASE64Encoder encoder = new BASE64Encoder(); + QRCodeUtil qrCode = new QRCodeUtil(basePath+"/mobile/login"); byte[] imageBytes = qrCode.getQRCodeBytes(); - FileOutputStream fos = new FileOutputStream(imgPath+"/mobile_qrcode.png"); - fos.write(imageBytes); - fos.close(); QRCodeUtil qrCode2 = new QRCodeUtil(basePath+"/apk/PoDroid_5.apk"); byte[] imageBytes2 = qrCode2.getQRCodeBytes(); - FileOutputStream fos2 = new FileOutputStream(imgPath+"/apk_qrcode.png"); - fos2.write(imageBytes2); - fos2.close(); + + String mobileQrCodeString = encoder.encode(imageBytes); + String apkQrCodeString = encoder.encode(imageBytes2); + request.setAttribute("mobImgPath", "data:image/png;base64,"+ apkQrCodeString ); + request.setAttribute("webImgPath","data:image/png;base64,"+ mobileQrCodeString ); }else{ request.setAttribute("msg","请用电脑IP访问,不要使用localhost或127.0.0.1"); } - String webImgPathBase64= Base64Util.strToBase64(imgPath + "mobile_qrcode.png"); - String mobImgPathBaseb4=Base64Util.strToBase64(imgPath+"apk_qrcode.png"); - request.setAttribute("mobImgPath", "data:image/png;base64,"+mobImgPathBaseb4); - request.setAttribute("webImgPath","data:image/png;base64,"+webImgPathBase64); return "index"; } } diff --git a/src/main/java/com/zhuozhengsoft/slndemo/utils/Base64Util.java b/src/main/java/com/zhuozhengsoft/slndemo/utils/Base64Util.java deleted file mode 100644 index d2114ee1278dd30c9158a4c568577b9d15fd12b6..0000000000000000000000000000000000000000 --- a/src/main/java/com/zhuozhengsoft/slndemo/utils/Base64Util.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.zhuozhengsoft.slndemo.utils; -import sun.misc.BASE64Encoder; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Objects; - -/** - * @Author: dong - * @Date: 2020/10/12 15:41 - * @Version 1.0 - */ -public class Base64Util { - public static String strToBase64(String imgPath) { - byte[] data = null; - String strBase64=""; - // 读取图片字节数组 - try { - InputStream in = new FileInputStream(imgPath); - data = new byte[in.available()]; - in.read(data); - in.close(); - } catch (IOException e) { - e.printStackTrace(); - } - // 对字节数组Base64编码 - BASE64Encoder encoder = new BASE64Encoder(); - // 返回Base64编码过的字节数组字符串 - strBase64=encoder.encode(Objects.requireNonNull(data)); - return strBase64; - } -} - diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index caa10ea2d900a433d9bfaa433770621cc56541e4..aa6e47489ddabe58f36dc9ca2bdf4bf1b69b8aeb 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -7,7 +7,7 @@ server.port=8888 #spring.datasource.url=jdbc:sqlite::resource:example.db #date_string_format=yyyy-MM-dd���sqlite3��Date��po��java.util.Date��ƥ������� -spring.datasource.url=jdbc:sqlite:D:/slndemo/demodata/slndata.db?date_string_format=yyyy-MM-dd +spring.datasource.url=jdbc:sqlite:D:/slndemodata/db/slndata.db?date_string_format=yyyy-MM-dd spring.datasource.username= spring.datasource.password= spring.datasource.driver-class-name=org.sqlite.JDBC @@ -26,16 +26,18 @@ spring.freemarker.charset=utf-8 #���freemakerҳ���${}ֵΪnull��ʱ���׳��쳣 spring.freemarker.settings.classic_compatible=true - debug=true #�����Ȳ��� spring.devtools.restart.enabled=true ######################################################## ###PageOffice ######################################################## -policpath=D:/slndemo/lic -moblicpath=D:/slndemo/lic +#pageoffice��Ʒ��moboffice��Ʒ����Ȩ�ļ�����Ŀ¼ +policpath=D:/slndemodata/lic +moblicpath=D:/slndemodata/lic +#����ǩ�¹���ƽ̨�����룬������ popassword=111111 -docpath=D:/slndemo/doc/ -imgpath=D:/slndemo/img/ -dbpath=D:/slndemo/demodata/ +#slndemo�õ���ģ���ļ��Ĵ��Ŀ¼ +docpath=D:/slndemodata/doc/ +#slndemo�����ݿ�slndata.db�ļ����Ŀ¼ +dbpath=D:/slndemodata/db/