mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-01 23:26:38 +00:00
Compare commits
8 Commits
v3.5.0
...
release_v3
Author | SHA1 | Date | |
---|---|---|---|
ca6c2aec96 | |||
34859c839b | |||
039f9d9cf8 | |||
224829dd1f | |||
1a5122209a | |||
48aff7cf37 | |||
e673f9be9d | |||
20469bd669 |
@ -2,9 +2,14 @@
|
|||||||
|
|
||||||
# 小说精品屋-plus
|
# 小说精品屋-plus
|
||||||
|
|
||||||
|
[](https://github.com/201206030/novel-plus)
|
||||||
|
[](https://github.com/201206030/novel-plus)
|
||||||
|
[](https://gitee.com/novel_dev_team/novel-plus)
|
||||||
|
[](https://gitee.com/novel_dev_team/novel-plus)
|
||||||
|
|
||||||
#### 官网
|
#### 官网
|
||||||
|
|
||||||
https://xiongxyang.gitee.io/home/
|
https://xiongxyang.gitee.io
|
||||||
|
|
||||||
#### 新项目:小说精品屋-微服务版
|
#### 新项目:小说精品屋-微服务版
|
||||||
|
|
||||||
@ -254,7 +259,7 @@ docker安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4271989)
|
|||||||
|
|
||||||
#### QQ交流群
|
#### QQ交流群
|
||||||
|
|
||||||
[点击前往官网查看](https://xiongxyang.gitee.io/home/service.htm)
|
[点击前往官网查看](https://xiongxyang.gitee.io/service.htm)
|
||||||
|
|
||||||
问问题的三要素
|
问问题的三要素
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<artifactId>novel-admin</artifactId>
|
<artifactId>novel-admin</artifactId>
|
||||||
<version>3.3.0</version>
|
<version>3.5.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>novel-admin</name>
|
<name>novel-admin</name>
|
||||||
|
@ -2,20 +2,18 @@ package com.java2nb;
|
|||||||
|
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
//关闭SpringSecurity的功能
|
|
||||||
@EnableAutoConfiguration(exclude = {
|
|
||||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
|
||||||
})
|
|
||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
@ServletComponentScan
|
@ServletComponentScan
|
||||||
@MapperScan("com.java2nb.*.dao")
|
@MapperScan("com.java2nb.*.dao")
|
||||||
@SpringBootApplication
|
@SpringBootApplication(exclude = {
|
||||||
|
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||||
|
})
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
public class AdminApplication {
|
public class AdminApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@ -9,8 +9,8 @@ logging:
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: test123456
|
password: test123456
|
||||||
#password:
|
#password:
|
||||||
|
@ -1,16 +1,19 @@
|
|||||||
java2nb:
|
java2nb:
|
||||||
uploadPath: /var/java2nb/uploaded_files/
|
uploadPath: /var/pic/
|
||||||
|
username: admin
|
||||||
|
password: 111111
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
root: error
|
root: error
|
||||||
com.java2nb: info
|
com.java2nb: error
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/java2nb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
username: java2nb
|
username: root
|
||||||
password: java2nb1019
|
password: test123456
|
||||||
|
#password:
|
||||||
initialSize: 1
|
initialSize: 1
|
||||||
minIdle: 3
|
minIdle: 3
|
||||||
maxActive: 20
|
maxActive: 20
|
||||||
@ -34,18 +37,18 @@ spring:
|
|||||||
# 合并多个DruidDataSource的监控数据
|
# 合并多个DruidDataSource的监控数据
|
||||||
#useGlobalDataSourceStat: true
|
#useGlobalDataSourceStat: true
|
||||||
redis:
|
redis:
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 6379
|
port: 6379
|
||||||
password:
|
password: test
|
||||||
# 连接超时时间(毫秒)
|
# 连接超时时间(毫秒)
|
||||||
timeout: 10000
|
timeout: 10000
|
||||||
jedis:
|
jedis:
|
||||||
pool:
|
pool:
|
||||||
# 连接池中的最大空闲连接
|
# 连接池中的最大空闲连接
|
||||||
max-idle: 8
|
max-idle: 8
|
||||||
# 连接池中的最小空闲连接
|
# 连接池中的最小空闲连接
|
||||||
min-idle: 10
|
min-idle: 10
|
||||||
# 连接池最大连接数(使用负值表示没有限制)
|
# 连接池最大连接数(使用负值表示没有限制)
|
||||||
max-active: 100
|
max-active: 100
|
||||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
max-wait: -1
|
max-wait: -1
|
@ -1,6 +1,15 @@
|
|||||||
__ ________ ___.
|
${AnsiColor.CYAN}
|
||||||
|__|____ ___ _______ \_____ \ ____\_ |__
|
|
||||||
| \__ \\ \/ /\__ \ / ____/ / \| __ \
|
--------------------------------------------------------------------------------
|
||||||
| |/ __ \\ / / __ \_/ \| | \ \_\ \
|
${AnsiColor.RED}
|
||||||
/\__| (____ /\_/ (____ /\_______ \___| /___ /
|
|| / | / /
|
||||||
\______| \/ \/ \/ \/ \/
|
|| / | / / ___ // ___ ___ _ __
|
||||||
|
|| / /||/ / //___) ) // // ) ) // ) ) // ) ) ) )
|
||||||
|
||/ / | / // // // // / / // / / / /
|
||||||
|
| / | / ((____ // ((____ ((___/ / // / / / / 小说精品屋欢迎您!!!
|
||||||
|
|
||||||
|
-------Powered By XXY
|
||||||
|
${AnsiColor.CYAN}
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
${AnsiColor.BRIGHT_YELLOW}
|
||||||
|
::: Spring-Boot ${spring-boot.formatted-version} :::
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<version>3.4.1</version>
|
<version>3.5.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -71,8 +71,3 @@ sharding:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
pic:
|
|
||||||
save:
|
|
||||||
type: 2 #图片保存方式, 1不保存,使用爬取的网络图片 ,2保存在自己的存储介质
|
|
||||||
storage: local #存储介质,local:本地,OSS:阿里云对象存储,fastDfs:分布式文件系统
|
|
||||||
path: /var/pic #图片保存路径
|
|
82
novel-common/src/main/resources/application-common-prod.yml
Normal file
82
novel-common/src/main/resources/application-common-prod.yml
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
spring:
|
||||||
|
profiles:
|
||||||
|
include: [common]
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
#Redis服务器IP
|
||||||
|
redis:
|
||||||
|
host: 127.0.0.1
|
||||||
|
#Redis服务器连接端口
|
||||||
|
port: 6379
|
||||||
|
#Redis服务器连接密码
|
||||||
|
password: test
|
||||||
|
jedis:
|
||||||
|
pool:
|
||||||
|
#连接池最大连接数(使用负值表示没有限制)
|
||||||
|
max-active: 8
|
||||||
|
#连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
|
max-wait: 1
|
||||||
|
#连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
|
max-idle: 8
|
||||||
|
#连接池中的最小空闲连接
|
||||||
|
min-idle: 0
|
||||||
|
#连接超时时间(毫秒)
|
||||||
|
timeout: 30000
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://127.0.0.1:3306/novel_biz?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: test123456
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
|
||||||
|
|
||||||
|
####使用shardingJdbc时,
|
||||||
|
####所有的jdbcType都不能是LONGVARCHAR,否则会导致java.io.NotSerializableException: java.io.StringReader错误
|
||||||
|
##### 应该替换所有的 LONGVARCHAR 类型为VARCHAR
|
||||||
|
|
||||||
|
sharding:
|
||||||
|
jdbc:
|
||||||
|
datasource:
|
||||||
|
names: ds0 #,ds1
|
||||||
|
ds0:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: test123456
|
||||||
|
# ds1:
|
||||||
|
# type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
# driver-class-name: com.mysql.jdbc.Driver
|
||||||
|
# url: jdbc:mysql://localhost:3306/novel_plus2
|
||||||
|
# username: root
|
||||||
|
# password: test123456
|
||||||
|
config:
|
||||||
|
sharding:
|
||||||
|
props:
|
||||||
|
sql.show: true
|
||||||
|
tables:
|
||||||
|
book_content: #book_content表
|
||||||
|
key-generator-column-name: id #主键
|
||||||
|
actual-data-nodes: ds${0}.book_content${0..9} #数据节点
|
||||||
|
# database-strategy: #分库策略
|
||||||
|
# inline:
|
||||||
|
# sharding-column: book_id
|
||||||
|
# algorithm-expression: ds${book_id % 10}
|
||||||
|
table-strategy: #分表策略
|
||||||
|
inline:
|
||||||
|
shardingColumn: index_id
|
||||||
|
algorithm-expression: book_content${index_id % 10}
|
||||||
|
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
root: error
|
||||||
|
com.java2nb: error
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
|||||||
spring:
|
|
||||||
profiles:
|
|
||||||
include: [common]
|
|
||||||
datasource:
|
|
||||||
url: jdbc:mysql://127.0.0.1:3306/novel_biz?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
|
|
||||||
|
|
||||||
pic:
|
|
||||||
save:
|
|
||||||
type: 2 #图片保存方式, 1不保存,使用网络图片 ,2本地保存
|
|
||||||
path: /var/pic #图片保存路径
|
|
||||||
|
|
||||||
|
|
||||||
|
|
15
novel-common/src/main/resources/banner.txt
Normal file
15
novel-common/src/main/resources/banner.txt
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
${AnsiColor.CYAN}
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
${AnsiColor.RED}
|
||||||
|
|| / | / /
|
||||||
|
|| / | / / ___ // ___ ___ _ __
|
||||||
|
|| / /||/ / //___) ) // // ) ) // ) ) // ) ) ) )
|
||||||
|
||/ / | / // // // // / / // / / / /
|
||||||
|
| / | / ((____ // ((____ ((___/ / // / / / / 小说精品屋欢迎您!!!
|
||||||
|
|
||||||
|
-------Powered By XXY
|
||||||
|
${AnsiColor.CYAN}
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
${AnsiColor.BRIGHT_YELLOW}
|
||||||
|
::: Spring-Boot ${spring-boot.formatted-version} :::
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<version>3.4.1</version>
|
<version>3.5.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
3
novel-crawl/src/main/resources/application-prod.yml
Normal file
3
novel-crawl/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
spring:
|
||||||
|
profiles:
|
||||||
|
include: [common-prod]
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<version>3.4.1</version>
|
<version>3.5.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
include: [common-dev]
|
include: [common-dev]
|
||||||
|
|
||||||
|
|
||||||
|
pic:
|
||||||
|
save:
|
||||||
|
type: 1 #图片保存方式, 1不保存,使用爬取的网络图片 ,2保存在自己的存储介质
|
||||||
|
storage: local #存储介质,local:本地,OSS:阿里云对象存储,fastDfs:分布式文件系统
|
||||||
|
path: /Users/xiongxiaoyang/java #图片保存路径
|
24
novel-front/src/main/resources/application-prod.yml
Normal file
24
novel-front/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
spring:
|
||||||
|
profiles:
|
||||||
|
include: [common-prod]
|
||||||
|
|
||||||
|
#静态文件路径配置
|
||||||
|
resources:
|
||||||
|
static-locations: file:${user.dir}/templates/${templates.name}/static/
|
||||||
|
#thymeleaf模版路径配置
|
||||||
|
thymeleaf:
|
||||||
|
prefix: file:${user.dir}/templates/${templates.name}/html/
|
||||||
|
suffix: .html
|
||||||
|
|
||||||
|
#模版配置
|
||||||
|
templates:
|
||||||
|
name: orange
|
||||||
|
|
||||||
|
|
||||||
|
pic:
|
||||||
|
save:
|
||||||
|
type: 2 #图片保存方式, 1不保存,使用爬取的网络图片 ,2保存在自己的存储介质
|
||||||
|
storage: local #存储介质,local:本地,OSS:阿里云对象存储,fastDfs:分布式文件系统
|
||||||
|
path: /var/pic #图片保存路径
|
||||||
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
spring:
|
|
||||||
profiles:
|
|
||||||
include: [common-test]
|
|
@ -3,7 +3,7 @@ website:
|
|||||||
#网站名
|
#网站名
|
||||||
name: 小说精品屋
|
name: 小说精品屋
|
||||||
#域名
|
#域名
|
||||||
domain: xiongxyang.gitee.io/home
|
domain: xiongxyang.gitee.io
|
||||||
#SEO关键词
|
#SEO关键词
|
||||||
keyword: ${website.name},小说,小说CMS,原创文学系统,开源小说系统,免费小说建站程序
|
keyword: ${website.name},小说,小说CMS,原创文学系统,开源小说系统,免费小说建站程序
|
||||||
#SEO描述
|
#SEO描述
|
||||||
|
@ -25,13 +25,7 @@ spring:
|
|||||||
jest:
|
jest:
|
||||||
uris: http://192.168.0.105:9200
|
uris: http://192.168.0.105:9200
|
||||||
|
|
||||||
#thymeleaf模版路径配置
|
|
||||||
thymeleaf:
|
|
||||||
prefix: file:${user.dir}/templates/${templates.name}/html/
|
|
||||||
suffix: .html
|
|
||||||
#静态文件路径配置
|
|
||||||
resources:
|
|
||||||
static-locations: file:${user.dir}/templates/${templates.name}/static/
|
|
||||||
|
|
||||||
redisson:
|
redisson:
|
||||||
singleServerConfig:
|
singleServerConfig:
|
||||||
@ -76,9 +70,7 @@ book:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#模版配置
|
|
||||||
templates:
|
|
||||||
name: orange
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,14 @@
|
|||||||
<div class="my_info cf">
|
<div class="my_info cf">
|
||||||
<div class="my_info_txt">
|
<div class="my_info_txt">
|
||||||
<ul class="mytab_list">
|
<ul class="mytab_list">
|
||||||
<li><i class="tit">我的头像</i><a href="javascript:void(0);"><img id="imgLogo" class="user_img" alt="我的头像" src="/images/man.png" /></a></li>
|
<li ><i class="tit">我的头像</i>
|
||||||
|
<a style="position: relative" >
|
||||||
|
<img id="imgLogo" class="user_img" alt="我的头像" src="/images/man.png" />
|
||||||
|
<input class="opacity" onchange="picChange()" type="file" id="file0" name="file" title="点击上传图片" style="z-index: 100;cursor: pointer;left: 0px; top: -25px; width: 60px; height: 80px; opacity: 0; position: absolute; "/>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
<li><i class="tit">我的昵称</i><a href="/user/set_name.html" id="my_name"></a></li>
|
<li><i class="tit">我的昵称</i><a href="/user/set_name.html" id="my_name"></a></li>
|
||||||
<li style="display:none"><i class="tit">电子邮箱</i><a href="javascript:void(0);"></a></li>
|
<li style="display:none"><i class="tit">电子邮箱</i><a href="javascript:void(0);"></a></li>
|
||||||
<li><i class="tit">我的性别</i><a href="/user/set_sex.html" id="my_sex"></a></li>
|
<li><i class="tit">我的性别</i><a href="/user/set_sex.html" id="my_sex"></a></li>
|
||||||
@ -42,6 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div th:replace="common/js :: js"></div>
|
<div th:replace="common/js :: js"></div>
|
||||||
<script src="/javascript/user.js" type="text/javascript"></script>
|
<script src="/javascript/user.js" type="text/javascript"></script>
|
||||||
|
<script src="/javascript/ajaxfileupload.js" type="text/javascript"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//查询用户信息
|
//查询用户信息
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -82,6 +90,58 @@
|
|||||||
layer.alert('网络异常');
|
layer.alert('网络异常');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function picChange() {
|
||||||
|
var file = $("#file0").val(); //文件名称
|
||||||
|
if (file != "") {
|
||||||
|
|
||||||
|
$.ajaxFileUpload({
|
||||||
|
url : "/file/upload", //用于文件上传的服务器端请求地址
|
||||||
|
secureuri : false, //是否需要安全协议,一般设置为false
|
||||||
|
fileElementId : "file0", //文件上传域的ID
|
||||||
|
dataType : "json", //返回值类型 一般设置为json
|
||||||
|
type : "post",
|
||||||
|
success : function(data) { //服务器成功响应处理函数
|
||||||
|
if (data.code == 200) {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/user/updateUserInfo",
|
||||||
|
data: {'userPhoto':data.data},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 200) {
|
||||||
|
window.location.href = '/user/setup.html';
|
||||||
|
|
||||||
|
} else if (data.code == 1001) {
|
||||||
|
//未登录
|
||||||
|
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
layer.alert(data.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
layer.alert('网络异常');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}else {
|
||||||
|
layer.alert('图片上传失败');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("请选择上传文件!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<version>3.4.1</version>
|
<version>3.5.0</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>novel-common</module>
|
<module>novel-common</module>
|
||||||
<module>novel-front</module>
|
<module>novel-front</module>
|
||||||
|
@ -25,7 +25,14 @@
|
|||||||
<div class="my_info cf">
|
<div class="my_info cf">
|
||||||
<div class="my_info_txt">
|
<div class="my_info_txt">
|
||||||
<ul class="mytab_list">
|
<ul class="mytab_list">
|
||||||
<li><i class="tit">我的头像</i><a href="javascript:void(0);"><img id="imgLogo" class="user_img" alt="我的头像" src="/images/man.png" /></a></li>
|
<li ><i class="tit">我的头像</i>
|
||||||
|
<a style="position: relative" >
|
||||||
|
<img id="imgLogo" class="user_img" alt="我的头像" src="/images/man.png" />
|
||||||
|
<input class="opacity" onchange="picChange()" type="file" id="file0" name="file" title="点击上传图片" style="z-index: 100;cursor: pointer;left: 0px; top: -25px; width: 60px; height: 80px; opacity: 0; position: absolute; "/>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
<li><i class="tit">我的昵称</i><a href="/user/set_name.html" id="my_name"></a></li>
|
<li><i class="tit">我的昵称</i><a href="/user/set_name.html" id="my_name"></a></li>
|
||||||
<li style="display:none"><i class="tit">电子邮箱</i><a href="javascript:void(0);"></a></li>
|
<li style="display:none"><i class="tit">电子邮箱</i><a href="javascript:void(0);"></a></li>
|
||||||
<li><i class="tit">我的性别</i><a href="/user/set_sex.html" id="my_sex"></a></li>
|
<li><i class="tit">我的性别</i><a href="/user/set_sex.html" id="my_sex"></a></li>
|
||||||
@ -42,6 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div th:replace="common/js :: js"></div>
|
<div th:replace="common/js :: js"></div>
|
||||||
<script src="/javascript/user.js" type="text/javascript"></script>
|
<script src="/javascript/user.js" type="text/javascript"></script>
|
||||||
|
<script src="/javascript/ajaxfileupload.js" type="text/javascript"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//查询用户信息
|
//查询用户信息
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -82,6 +90,58 @@
|
|||||||
layer.alert('网络异常');
|
layer.alert('网络异常');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function picChange() {
|
||||||
|
var file = $("#file0").val(); //文件名称
|
||||||
|
if (file != "") {
|
||||||
|
|
||||||
|
$.ajaxFileUpload({
|
||||||
|
url : "/file/upload", //用于文件上传的服务器端请求地址
|
||||||
|
secureuri : false, //是否需要安全协议,一般设置为false
|
||||||
|
fileElementId : "file0", //文件上传域的ID
|
||||||
|
dataType : "json", //返回值类型 一般设置为json
|
||||||
|
type : "post",
|
||||||
|
success : function(data) { //服务器成功响应处理函数
|
||||||
|
if (data.code == 200) {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/user/updateUserInfo",
|
||||||
|
data: {'userPhoto':data.data},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 200) {
|
||||||
|
window.location.href = '/user/setup.html';
|
||||||
|
|
||||||
|
} else if (data.code == 1001) {
|
||||||
|
//未登录
|
||||||
|
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
layer.alert(data.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
layer.alert('网络异常');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}else {
|
||||||
|
layer.alert('图片上传失败');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("请选择上传文件!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user