Files
2022-08-31 14:06:07 +08:00

119 lines
3.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 数据资源中心高效研发框架 **ADC-DA**
## 1.官网地址
* http://221.239.111.146:50006/html/index.html
## 2.平台测试接口地址
* http://localhost:8080/swagger-ui.html
## 3.详细使用步骤 IDEA
0. 详细文档请参考官网,以下仅用IDEA演示
1. 忽略SSL验证
```sh
git config --global http.sslVerify false
```
2. 获取源码方式有二
|-1. 用Git Bash
```sh
git clone https://60.247.58.117:50018/ADC-DA-Open/ADC-DA-2.0.git
```
|-2. 用idea
![avatar](img/use_idea_git_01.PNG)![avatar](img/use_idea_git_02.PNG)
3. 启动平台 方法有二
|-1.从spring-bootrun启动
![avatar](img/spring-boot-run.PNG )
|-2.从AdcDaApplication启动 (可能需要修改pom.xml中的参数)
![avatar](img/adc_run.jpg)
* 若无法正常用idea运行,请将根目录下的pom.xml中的如下代码注释掉
```xml
<!-- Provided -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
<version>${spring.boot.version}</version>
</dependency>
```
3. 启动成功 访问swagger
|-1.
![avatar](img/Successful_startup.PNG)
|-2.
![avatar](img/swagger.PNG)
4. 访问前端页面
http://localhost:8080/index.html
layui版本框架可以直接访问,也可以采用nginx进行分离式部署
5. 启动nginx (建议)
|-1. 配置nginx目录下conf目录中的nginx.conf文件,不要用记事本编辑conf文件,可以用写字板或其他编写代码的程序
|-1.1 需要配置的有 serverrootproxy_pass
server {
listen 8011;
#前端端口号
root C:/IDEA/test/ADC-DA-2.0/adc-da-ui/src/main/resources;
#项目路径,定位到adc-da-ui/main/resources,注意"/"
location / {
# 动态页面 后端端口号
if ( !-e $request_filename) {
proxy_pass http://localhost:8080;
}
#root html;
#index index.html index.htm;
}
}
|-2.启动nginx 任务管理器-详细里面会有2个nginx信息
![avatar](img/nginx_start.PNG)
|-3. 访问 http://localhost:8011/html/index.html
|-3.1 如果可以访问 http://localhost:8011/swagger-ui.html ,不能访问index.html,则一定是root路径错误。
|-3.2若可以访问 http://localhost:8080/swagger-ui.html ,不能访问 http://localhost:8011/swagger-ui.html ,则一定是端口配置错误。
RSA非对称加密
methods: {
login () {
let pubkey = `MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKtSP3y2DkyoDQsFGr6sn4saLBFwcijEPWsWQ1Hnz8sIvn7V3TyNrSesf+7nPgnUk9Gt/7aKsXUkY67BzMJ5xkECAwEAAQ==`
let pwd = this.encryptedData(pubkey, this.loginForm.password)
let username = this.encryptedData(pubkey, this.loginForm.username)
this.$axios
.post('/login', {
username: username,
password: pwd
})
.then(successRes => {
if (successRes.data.code === 200) {
this.$store.commit('login', this.loginForm)
let path = this.$route.query.redirect
this.$router.replace({path: path === '/' || path === undefined ? '/index' : path})
}
})
.catch(failRes => {
})
},
// 加密
encryptedData (publicKey, str) {
// 私钥 和后端沟通
// 新建JSEncrypt对象
let encryptor = new JSEncrypt()
// 设置公钥
encryptor.setPublicKey(publicKey)
// 加密数据
let decrypt = encryptor.encrypt(str.toString())
return decrypt
}
}